* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #333;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
}

/* PCレイアウト：左カレンダー / 右コマ */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: flex-start;
}

/* カレンダー */
.calendar-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#calendar-title {
  font-weight: 600;
}

.icon-button {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  font-size: 14px;
}

.weekday {
  text-align: center;
  padding: 4px 0;
  font-weight: 600;
  color: #777;
}

#calendar-days {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

.calendar-day.disabled {
  color: #ccc;
  cursor: default;
}

.calendar-day.has-class {
  border: 1px solid #39c65a;
  color: #39c65a;
}

.calendar-day.selected {
  background: #ff4b6b;
  color: #fff;
}

/* カレンダーの特別授業日（受講者） */
.calendar-day.special-day {
  border: 2px solid #ff9800;
  color: #ff9800;
  font-weight: bold;
}

/* カレンダー下の注釈 */
.calendar-legend {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}
.calendar-legend span.badge-special-day {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ff9800;
  color: #ff9800;
  font-size: 15px;
  margin-right: 4px;
}

/* コマ一覧 */
.slots-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.slots-section h2 {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 12px;
}

.slots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 10px 12px;
}

.slot-time {
  font-weight: 600;
}

.slot-capacity {
  font-size: 15px;
  color: #39c65a;
  line-height: 1.6;
}

.btn-primary {
  background: #39c65a;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: default;
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  max-width: 90vw;
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.modal-message {
  margin-top: 8px;
  font-size: 13px;
  color: #555;
}

/* スマホ対応：カレンダー→コマの縦並び */
@media (max-width: 768px) {
  .app {
    padding: 16px 8px 24px;
    max-width: 100%;
  }

  .layout {
    display: block;
  }

  .calendar-section {
    width: 100%;
    margin-bottom: 12px;
  }

  .slots-section {
    width: 100%;
  }

  /* 管理画面用: admin-layout 内のセクションを縦並び＆余白調整 */
  .admin-layout .slots-section,
  .admin-layout .calendar-section {
    width: 100%;
    margin-bottom: 12px;
  }
}

/* 特別クラス用スタイル */
.slot-card.special {
  border-left: 4px solid #ff9800;
  background-color: #fffbf5;
}

.badge-special {
  display: inline-block;
  padding: 2px 10px;
  background-color: #ff9800;
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.special-notice {
  background-color: #fff8e1;
  border: 1px solid #ffcc02;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #7a5c00;
  margin-bottom: 16px;
  line-height: 1.6;
}


/* ---- PC環境のみ1.5倍にスケール ---- */
@media (min-width: 769px) {
  body {
    font-size: 24px;
  }
  .app {
    max-width:  1440px;
    padding:  36px 24px 60px;
  }
  .app-header {
    margin-bottom:  36px;
  }
  .app-header h1 {
    font-size:  36px;
  }
  .layout {
    grid-template-columns:  480px 1fr;
    gap:  36px;
  }
  .calendar-section {
    border-radius:  18px;
    padding:  24px;
    box-shadow:  0 3px 9px rgba(0,0,0,0.06);
  }
  .calendar-header {
    margin-bottom:  12px;
  }
  #calendar-title {
    font-size: 24px;
  }
  .icon-button {
    font-size:  27px;
    padding:  6px 12px;
  }
  .calendar-grid {
    row-gap:  6px;
    font-size:  21px;
  }
  .weekday {
    padding:  6px 0;
  }
  #calendar-days {
    gap:  6px;
  }
  .calendar-day {
    height:  48px;
    border-radius:  1498px;
    font-size:  22.5px;
  }
  .calendar-day.special-day {
    border:  3px solid #ff9800;
  }
  .calendar-legend {
    margin-top:  12px;
    font-size:  22.5px;
  }
  .calendar-legend span.badge-special-day {
    padding:  3px 9px;
    border-radius:  6px;
    font-size:  22.5px;
    margin-right:  6px;
  }
  .slots-section {
    border-radius:  18px;
    padding:  24px;
    box-shadow:  0 3px 9px rgba(0,0,0,0.06);
  }
  .slots-section h2 {
    font-size:  27px;
    margin-bottom:  18px;
  }
  .slots-list {
    gap:  15px;
  }
  .slot-card {
    border-radius:  12px;
    padding:  15px 18px;
  }
  .slot-time {
    font-size: 24px;
  }
  .slot-capacity {
    font-size:  22.5px;
  }
  .btn-primary {
    border-radius:  1498px;
    padding:  9px 24px;
    font-size:  24px;
  }
  .btn-secondary {
    border-radius:  1498px;
    padding:  9px 24px;
    font-size:  21px;
  }
  .modal {
    border-radius:  18px;
    padding:  30px;
    width:  480px;
  }
  .modal h3 {
    margin-bottom:  18px;
  }
  .form-group {
    margin-bottom:  15px;
  }
  .form-group label {
    font-size:  19.5px;
    margin-bottom:  6px;
  }
  .form-group input {
    padding:  9px 12px;
    border-radius:  9px;
    font-size:  21px;
  }
  .modal-actions {
    gap:  12px;
    margin-top:  12px;
  }
  .modal-message {
    margin-top:  12px;
    font-size:  19.5px;
  }
  .slot-card.special {
    border-left:  6px solid #ff9800;
  }
  .badge-special {
    padding:  3px 15px;
    border-radius:  1498px;
    font-size:  1.125rem;
    margin-bottom:  6px;
  }
  .special-notice {
    border-radius:  9px;
    padding:  15px 21px;
    font-size:  1.275rem;
    margin-bottom:  24px;
  }
}
