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

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

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

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

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

.form-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 16px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.required {
  color: #ef4444;
}

input[type="text"],
input[type="date"],
textarea,
select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: #1e293b;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.85;
}

#save-btn {
  background: #2563eb;
  color: #fff;
  flex: 1;
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

/* フィルター */
.filter-section {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-section input {
  flex: 1;
}

.filter-section select {
  width: 110px;
  flex-shrink: 0;
}

/* カウント */
.count-label {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* カード一覧 */
.candidate-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.candidate-card:hover {
  box-shadow: 0 3px 10px rgba(37,99,235,0.12);
}

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

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pass   { background: #dcfce7; color: #15803d; }
.badge-fail   { background: #fee2e2; color: #b91c1c; }
.badge-hold   { background: #fef9c3; color: #854d0e; }
.badge-none   { background: #f1f5f9; color: #64748b; }

.empty-state {
  text-align: center;
  color: #94a3b8;
  padding: 40px 0;
  font-size: 0.95rem;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  justify-content: center;
  align-items: flex-end;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #f1f5f9;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
}

.modal-section {
  margin-bottom: 14px;
}

.modal-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-section-body {
  font-size: 0.95rem;
  color: #1e293b;
  white-space: pre-wrap;
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.btn-edit {
  background: #eff6ff;
  color: #2563eb;
  flex: 1;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  flex: 1;
}

@media (min-width: 600px) {
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .form-row:nth-child(4),
  .form-row:nth-child(5),
  .form-row:nth-child(6) {
    grid-column: 1 / -1;
  }
  .modal {
    align-items: center;
  }
  .modal-content {
    border-radius: 16px;
    max-height: 90vh;
  }
}
