* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a2e;
}

.screen {
  height: 100vh;
  width: 100vw;
}

.hidden {
  display: none !important;
}

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
  margin: 0;
  font-size: 20px;
}

.login-card .subtitle {
  margin: 0 0 8px;
  color: #666;
  font-size: 14px;
}

.login-card input {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.login-card button {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.login-card button:hover {
  background: #0d47a1;
}

.error {
  color: #c62828;
  font-size: 13px;
  min-height: 16px;
  margin: 0;
}

/* Dashboard */
#dashboard-screen {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #0d47a1;
  color: #fff;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.topbar button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-action {
  background: #facc15 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  border: 1px solid #eab308 !important;
}

.btn-action:hover {
  background: #fde047 !important;
}

.vehicle-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.vehicle-card .odometer {
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
}

.btn-reset-single {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-single:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.dashboard-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 280px;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  background: #fafafa;
}

.sidebar-empty {
  padding: 16px;
  color: #888;
  font-size: 14px;
}

.vehicle-card {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.vehicle-card:hover {
  background: #eef3fb;
}

.vehicle-card .plate {
  font-weight: 600;
  font-size: 15px;
}

.vehicle-card .meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.vehicle-card .stale {
  color: #c62828;
}

#map {
  flex: 1;
}

/* Custom Yellow Car Marker */
.custom-car-marker {
  background: transparent !important;
  border: none !important;
}

.car-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.car-body-rot {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease-out;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.car-label {
  background: #1e293b;
  color: #facc15;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  border: 1px solid #ca8a04;
  letter-spacing: 0.5px;
}

.vehicle-card .model-tag {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-left: 6px;
}

.vehicle-card .battery-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  background: #f1f5f9;
  color: #334155;
}

.vehicle-card .battery-charging {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  margin-top: 4px;
}

.status-online {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-offline-gps {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  animation: pulse-amber 2s infinite ease-in-out;
}

.status-disconnected {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

