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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

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

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: #1a1a2e;
}

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

/* フォームカード */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 10px;
}

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

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #4a90d9;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 11px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #357abd;
}

/* サマリー */
.summary {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.summary-badge {
  flex: 1;
  min-width: 80px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.summary-badge .count {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.summary-badge .label {
  font-size: 0.75rem;
  color: #666;
  margin-top: 3px;
}

.badge-expired .count { color: #e53935; }
.badge-soon .count { color: #f57c00; }
.badge-ok .count { color: #43a047; }
.badge-total .count { color: #4a90d9; }

/* フィルター */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: #4a90d9;
  color: #4a90d9;
}

.filter-btn.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
}

/* 資格カード */
.cert-card {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cert-card.status-expired {
  background: #ffebee;
  border-left: 4px solid #e53935;
}

.cert-card.status-soon {
  background: #fff8e1;
  border-left: 4px solid #f57c00;
}

.cert-card.status-ok {
  background: #e8f5e9;
  border-left: 4px solid #43a047;
}

.cert-info {
  flex: 1;
}

.cert-staff {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 2px;
}

.cert-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.cert-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cert-date {
  font-size: 0.85rem;
  color: #555;
}

.cert-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-expired .cert-badge {
  background: #e53935;
  color: #fff;
}

.status-soon .cert-badge {
  background: #f57c00;
  color: #fff;
}

.status-ok .cert-badge {
  background: #43a047;
  color: #fff;
}

.cert-days {
  font-size: 0.78rem;
  color: #888;
}

.delete-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}

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

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 20px 0;
}

@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  .summary-badge { min-width: 70px; }
  .cert-name { font-size: 0.9rem; }
}
