:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #616b7a;
  --accent: #1f4aa8;
  --border: #e0e5ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

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

.site-nav a {
  margin-left: 16px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.site-nav a:hover {
  color: var(--accent);
}

.content {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  margin-top: 0;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.login-card {
  max-width: 380px;
  margin: 40px auto;
}

label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

select,
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert {
  background: #ffe6e6;
  border: 1px solid #ffb3b3;
  color: #a40000;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f1f4f8;
  font-weight: 700;
}

.map-card {
  padding: 0;
}

.map {
  width: 100%;
  height: 420px;
  border-radius: 12px;
}

.dashboard-map {
  height: 520px;
}

.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
}

.driver-card .driver-level {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0;
}

.progress {
  background: #eef2f6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.progress.small {
  height: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.score-value {
  font-size: 32px;
  font-weight: 800;
  margin: 8px 0;
}

.rules {
  cursor: help;
}

.muted {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.logbook {
  margin-top: 24px;
}

.logbook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filters label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.filters input[type="date"] {
  padding: 6px 8px;
  margin-top: 6px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.active-card.hidden {
  display: none;
}

.active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f4f8;
  color: var(--muted);
}

.status-driving {
  background: #d7f4e1;
  color: #1b6b38;
}

.status-stopped {
  background: #ffe6e6;
  color: #a40000;
}

.status-jam {
  background: #fff4d6;
  color: #8a5b00;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.mission-card .mission-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.mission-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 12px;
}

.mission-claim {
  width: 100%;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2f6;
  color: var(--muted);
}

.pill-work {
  background: #d7f4e1;
  color: #1b6b38;
}

.pill-personal {
  background: #d6e4ff;
  color: #1f4aa8;
}

.pill-none {
  background: #f1f4f8;
  color: var(--muted);
}

.actions {
  margin-top: 16px;
}

.button-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
}

.chart {
  min-height: 180px;
}

.chart-svg {
  width: 100%;
  height: 180px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f4f8;
  color: var(--muted);
  font-size: 12px;
}

.badge.earned {
  background: #d7f4e1;
  color: #1b6b38;
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
}

.stat {
  margin: 6px 0;
  font-size: 14px;
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .site-nav a {
    margin-left: 0;
    margin-right: 12px;
  }
}
