* {
  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;
}

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

/* ヘッダー */
.header {
  background: #3b82f6;
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 700;
}

/* セクション */
.section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

/* 生徒登録フォーム */
.student-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.student-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.student-form input:focus {
  border-color: #3b82f6;
}

/* 生徒タブリスト */
.student-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #bae6fd;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.student-tag:hover {
  background: #bae6fd;
}

.student-tag.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.student-tag .delete-student {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  opacity: 0.7;
}

.student-tag .delete-student:hover {
  opacity: 1;
}

/* 授業記録ヘッダー */
.record-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 14px;
}

.record-header h2 {
  margin-bottom: 0;
  color: #3b82f6;
}

.student-label {
  font-size: 1rem;
  color: #64748b;
}

/* フォーム */
.record-form {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

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

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

.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-group input[type="date"]:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
}

/* ボタン */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}

.btn-full {
  width: 100%;
  padding: 10px;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.8rem;
  padding: 4px 10px;
}

/* 授業履歴 */
.history-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 12px;
}

.record-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.record-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.record-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: #3b82f6;
}

.record-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-field {
  font-size: 0.88rem;
  line-height: 1.5;
}

.record-field .field-label {
  font-weight: 700;
  color: #475569;
  margin-right: 4px;
}

.record-field .field-value {
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-record {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 20px 0;
}

/* 空メッセージ */
.empty-msg {
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
  padding: 24px 0;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .app {
    padding: 12px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .student-form {
    flex-direction: column;
  }
}
