:root {
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --bg: #f5f7fb;
  --text: #1f2937;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.app-header h1 { margin: 0; color: var(--blue); }
.subtitle { margin: 0.3rem 0 0; opacity: 0.7; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

label { font-weight: 600; font-size: 0.9rem; }

#trip-date {
  display: block;
  width: 100%;
  margin: 0.4rem 0 1rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.button-grid {
  display: grid;
  gap: 0.6rem;
}

.trip-btn {
  border: none;
  background: var(--blue);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.trip-btn:hover { opacity: 0.9; }
.trip-btn:active { transform: scale(0.98); }
.trip-btn:disabled { opacity: 0.6; cursor: default; }

.status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--blue);
}

.table-wrap { overflow-x: auto; }

#stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#stats-table th, #stats-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

#stats-table th:first-child, #stats-table td:first-child {
  text-align: left;
  white-space: normal;
}

#stats-table tbody tr:last-child {
  font-weight: 700;
  background: var(--blue-light);
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.recent-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.recent-list .recent-text { flex: 1; }
.recent-list .recent-date { opacity: 0.6; font-size: 0.8rem; }

.delete-btn {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
}
