* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 20px;
  text-align: center;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 12px;
}

section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* 次回メンテ */
.next-maintenance {
  background: #eef6ff;
  border: 1px solid #b3d5f7;
}

.next-maintenance h2 {
  color: #1565c0;
}

.next-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.next-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #2196f3;
}

.next-card.warning {
  border-left-color: #ff9800;
}

.next-card.danger {
  border-left-color: #f44336;
  background: #fff3f3;
}

.next-card .type {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 4px;
}

.next-card .date {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.next-card .days {
  font-size: 0.8rem;
  margin-top: 4px;
}

.next-card.warning .days { color: #e65100; }
.next-card.danger .days { color: #c62828; }

/* フォーム */
.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.required {
  color: #f44336;
  font-size: 0.8rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #333;
  background: #fafafa;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2196f3;
  background: #fff;
}

textarea {
  resize: vertical;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #1565c0;
}

/* 履歴一覧 */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.count {
  font-size: 0.85rem;
  color: #888;
  background: #eee;
  padding: 2px 10px;
  border-radius: 20px;
}

.record-item {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  position: relative;
}

.record-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.badge-点検 { background: #4caf50; }
.badge-オイル { background: #ff9800; }
.badge-タイヤ { background: #9c27b0; }
.badge-車検 { background: #1565c0; }
.badge-その他 { background: #78909c; }

.record-date {
  font-size: 0.88rem;
  color: #777;
}

.record-mileage {
  font-size: 0.88rem;
  color: #555;
  font-weight: 600;
}

.record-vehicle {
  font-size: 0.82rem;
  color: #aaa;
}

.record-details {
  font-size: 0.88rem;
  color: #555;
  white-space: pre-wrap;
}

.btn-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.btn-delete:hover {
  color: #f44336;
}

.no-data {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

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