* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
header h1 { font-size: 18px; }
header nav { display: flex; gap: 4px; }
header nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
}
header nav a:hover { color: #e2e8f0; }
header nav a.active { background: #334155; color: #fff; }
#last-update, #status { font-size: 12px; color: #94a3b8; margin-left: auto; }
.range-picker { margin-left: auto; font-size: 12px; color: #94a3b8; display: flex; gap: 6px; align-items: center; }
.logout-form { margin-left: auto; }
.logout-form + #last-update,
.logout-form + #status,
.logout-form + .range-picker { margin-left: 0; }
.logout-form button { padding: 4px 10px; font-size: 12px; }

main { flex: 1; display: flex; min-height: 0; }
#map { flex: 1; }
aside {
  width: 360px;
  overflow-y: auto;
  padding: 14px;
  background: #1e293b;
  border-left: 1px solid #334155;
}
aside h2 { font-size: 13px; text-transform: uppercase; color: #94a3b8; margin: 10px 0 8px; }
.hint { font-size: 12px; color: #64748b; margin: 4px 0 10px; line-height: 1.5; }

.car-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.car-card:hover { border-color: #64748b; }
.car-card .name { font-weight: 600; font-size: 14px; }
.car-card .row { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.badge.online { background: #064e3b; color: #34d399; }
.badge.offline { background: #450a0a; color: #f87171; }
.badge.home { background: #14532d; color: #86efac; }
.badge.away { background: #78350f; color: #fbbf24; }
.badge.alert { background: #7f1d1d; color: #fecaca; }

.alert-item {
  background: #0f172a;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.alert-item .time { color: #94a3b8; font-size: 11px; }
.empty { color: #64748b; font-size: 12px; padding: 6px 0; }

/* ---- inputs / buttons ---- */
input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"] {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}
button {
  background: #334155;
  border: 1px solid #475569;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: #475569; }

/* ---- login ---- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.14), transparent 30rem),
    #0f172a;
}
.login-shell { width: 100%; max-width: 420px; padding: 24px; display: block; min-height: auto; }
.login-card {
  background: rgba(30, 41, 59, 0.94);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.login-logo { font-size: 42px; margin-bottom: 8px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.login-form label { display: grid; gap: 6px; font-size: 13px; color: #cbd5e1; }
.login-form input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
}
.login-form button { padding: 11px 14px; border-radius: 10px; font-weight: 700; }
.login-message {
  margin-top: 14px;
  border: 1px solid #7f1d1d;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

/* ---- account ---- */
.account-main {
  display: block;
  overflow-y: auto;
  padding: 28px 20px;
}
.account-card {
  max-width: 520px;
  margin: 0 auto;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 22px;
}
.account-card h2 { font-size: 20px; margin-bottom: 8px; }
.account-card h3 { font-size: 14px; margin: 22px 0 8px; color: #e2e8f0; }
.account-form { display: grid; gap: 12px; margin-top: 12px; }
.account-form label { display: grid; gap: 6px; font-size: 13px; color: #cbd5e1; }
.account-form input { width: 100%; padding: 10px 12px; border-radius: 8px; }
.account-form button { justify-self: start; padding: 8px 12px; }

/* ---- settings ---- */
.zone-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.zone-card .zone-name { flex: 1; min-width: 0; }
.zone-card input[type="color"] {
  width: 26px; height: 26px; border: none; background: none; cursor: pointer; padding: 0;
}
.zone-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.setting-row { display: flex; gap: 8px; align-items: center; }
.setting-row label { font-size: 13px; }
.setting-row input { width: 80px; }
.zone-label {
  background: rgba(15, 23, 42, 0.75);
  border: none;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  box-shadow: none;
}

/* ---- report ---- */
.report-main { flex-direction: column; overflow-y: auto; }
#report-map { height: 45vh; min-height: 300px; flex: none; }
#report-content { padding: 16px 20px 40px; max-width: 1000px; margin: 0 auto; width: 100%; }
.report-header { font-size: 14px; color: #94a3b8; margin-bottom: 14px; }
.report-car {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.report-car h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.report-car h4 { font-size: 12px; text-transform: uppercase; color: #94a3b8; margin: 16px 0 8px; }
.route-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.stat {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.stat-value { font-size: 18px; font-weight: 700; }
.stat-label { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.stat-label span { color: #64748b; font-size: 10px; }

.bars { display: flex; gap: 6px; align-items: flex-end; padding: 6px 0; overflow-x: auto; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 42px; }
.bar { width: 26px; background: #38bdf8; border-radius: 4px 4px 0 0; }
.bar-val { font-size: 10px; color: #94a3b8; }
.bar-day { font-size: 10px; color: #64748b; }

.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th, .report-table td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
}
.report-table th { color: #94a3b8; font-weight: 600; }
.report-table a { color: #38bdf8; }

@media (max-width: 800px) {
  main { flex-direction: column; }
  #map { min-height: 50vh; }
  aside { width: 100%; border-left: none; border-top: 1px solid #334155; }
  header { flex-wrap: wrap; gap: 8px; }
}
