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

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

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

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

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

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

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

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

.required {
  color: #e74c3c;
}

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

input[type="text"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: #4a90d9;
  background: #fff;
}

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

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

/* 一覧セクション */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.count-badge {
  font-size: 0.8rem;
  background: #eef3fb;
  color: #4a90d9;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}

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

/* 資格カード */
.license-card {
  border-left: 4px solid #ccc;
  background: #fafafa;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.license-card.status-ok {
  border-left-color: #27ae60;
}

.license-card.status-warn {
  border-left-color: #f39c12;
}

.license-card.status-danger {
  border-left-color: #e74c3c;
}

.license-card.status-expired {
  border-left-color: #999;
  background: #f0f0f0;
}

.license-card.status-permanent {
  border-left-color: #4a90d9;
}

.license-info {
  flex: 1;
  min-width: 0;
}

.license-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-all;
}

.license-dates {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 4px;
}

.license-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-ok .license-status {
  background: #eafaf1;
  color: #27ae60;
}

.status-warn .license-status {
  background: #fef9e7;
  color: #e67e22;
}

.status-danger .license-status {
  background: #fdedec;
  color: #e74c3c;
}

.status-expired .license-status {
  background: #ececec;
  color: #999;
}

.status-permanent .license-status {
  background: #eef3fb;
  color: #4a90d9;
}

.btn-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.2s;
}

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

@media (max-width: 375px) {
  .container {
    padding: 12px;
  }
  h1 {
    font-size: 1.2rem;
  }
}
