:root {
  color-scheme: light;
  --bg: #f4f1ed;
  --ink: #111111;
  --muted: #6c6a67;
  --accent: #1a1a1a;
  --accent-2: #ff5c2b;
  --panel: #ffffff;
  --panel-2: #f8f5f1;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  --radius: 20px;
  --font: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #ffe8dd 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, #dff1ff 0%, transparent 45%),
    var(--bg);
  min-height: 100vh;
}

.app {
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7b3b, #ff2b2b);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
}

.brand-tag {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.role-switch {
  display: flex;
  gap: 10px;
  background: var(--panel-2);
  padding: 6px;
  border-radius: 999px;
}

.role-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
}

.role-btn.active {
  background: #111;
  color: #fff;
}

.card {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.hotspot-list {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.hotspot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hotspot-pill {
  background: #111;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.primary-btn,
.ghost-btn {
  border-radius: 14px;
  border: none;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
}

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

.ghost-btn {
  background: #fff;
  border: 1px solid #dedad6;
  color: var(--ink);
}

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

.map-panel {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.map-title {
  font-weight: 700;
  font-size: 18px;
}

.map-subtitle {
  font-size: 12px;
  color: var(--muted);
}

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

.map-canvas {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  background: #101010;
  min-height: 360px;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 60%, rgba(255, 255, 255, 0.03) 60%),
    linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, 0.03) 60%);
  background-size: 40px 40px;
  background-color: #0e1014;
  opacity: 0.7;
}

.fallback-layer {
  position: absolute;
  inset: 0;
}

.marker {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.marker.driver {
  background: var(--accent-2);
  box-shadow: 0 0 12px rgba(255, 92, 43, 0.7);
}

.marker.user {
  background: #25d366;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.7);
}

.marker.driver::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.8;
}

.marker.hotspot {
  width: 10px;
  height: 10px;
  background: #ffd166;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.8);
}

.hotspot-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 209, 102, 0.6);
  transform: translate(-50%, -50%);
  opacity: 0.8;
}

.marker-label {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 10px;
}

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

.stat {
  background: var(--panel-2);
  border-radius: 14px;
  padding: 12px;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
}

.stat-value {
  font-weight: 700;
  font-size: 18px;
}

.toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.toast {
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slideIn 0.3s ease;
}

.toast.info {
  background: #222;
}

.toast.success {
  background: #0f5132;
}

.toast.warn {
  background: #8a3a1f;
}

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

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

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

  .map-footer {
    grid-template-columns: 1fr;
  }
}
