/* ===== モーダル全体 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(30, 32, 48, 0.35);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  overflow-y: auto;
}

.modal-content.business-hours-modal-content {
  background: #fff;
  border-radius: 18px;
  max-width: 600px;
  width: 95vw;
  margin: 30px auto;
  padding: 32px 24px 28px 24px;
  box-shadow: 0 10px 32px rgba(16, 18, 36, 0.16);
  position: relative;
  animation: modalFadeIn 0.4s;
}

.business-hours-modal-content h2 {
  margin: 0 0 24px 0;
  font-size: 1.35rem;
  text-align: center;
  color: #25336a;
  letter-spacing: 0.06em;
}

@keyframes modalFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}



.settings-modal-content {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e4d9f5;
  box-shadow: 0 8px 30px rgba(127, 63, 152, .08);
  max-width: 540px;
  width: 96vw;
  padding: 32px 26px 30px 26px;
  margin: 6vh auto;
  position: relative;
}

.settings-modal-content h2 {
  text-align: center;
  font-size: 18px;
  color: #7f3f98;
  margin-bottom: 22px;
  font-weight: bold;
  letter-spacing: .04em;
}


.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-row label {
  flex: 1 1 220px;
  min-width: 180px;
  background: #f5f2fa;
  border: 1px solid #e8e3f3;
  border-radius: 10px;
  padding: 16px 12px 10px;
  margin-bottom: 4px;
  box-sizing: border-box;
  font-size: 14px;
  color: #7f3f98;
  font-weight: 500;
  transition: box-shadow .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-row label:focus-within {
  border-color: #b39ddb;
  box-shadow: 0 2px 12px rgba(127, 63, 152, .08);
}

.settings-row input[type="number"] {
  width: 90px;
  margin-top: 4px;
  font-size: 16px;
  border: 1px solid #dad7f5;
  border-radius: 6px;
  background: #fcfaff;
  color: #333;
  padding: 5px 10px;
  box-sizing: border-box;
  font-weight: bold;
  transition: border-color .16s, box-shadow .16s;
}

.settings-row input[type="number"]:focus {
  border-color: #b39ddb;
  outline: none;
}



.notice-modal-content {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e4d9f5;
  box-shadow: 0 8px 30px rgba(127, 63, 152, .08);
  max-width: 460px;
  width: 96vw;
  padding: 32px 26px 30px 26px;
  margin: 6vh auto;
  position: relative;
}

.notice-modal-content h2 {
  text-align: center;
  font-size: 18px;
  color: #7f3f98;
  margin-bottom: 22px;
  font-weight: bold;
  letter-spacing: .04em;
}

.notice-modal-content label {
  display: block;
  margin-bottom: 24px;
  font-weight: 500;
  color: #7f3f98;
  font-size: 15px;
}

.notice-modal-content textarea {
  width: 100%;
  font-size: 15px;
  border: 1px solid #dad7f5;
  border-radius: 8px;
  background: #fcfaff;
  color: #333;
  padding: 10px 12px;
  box-sizing: border-box;
  margin-top: 7px;
  resize: vertical;
  min-height: 60px;
  max-height: 160px;
  transition: border-color .18s, box-shadow .18s;
}

.notice-modal-content textarea:focus {
  border-color: #b39ddb;
  box-shadow: 0 2px 12px rgba(127, 63, 152, .09);
  outline: none;
}

.char-count {
  float: right;
  font-size: 12px;
  color: #999;
  margin-top: 2px;
  margin-right: 3px;
  letter-spacing: .03em;
}

.form-error {
  min-height: 1.4em;
  font-size: 13px;
  color: #d44c8d;
  margin-top: 2px;
  margin-left: 2px;
  font-weight: 500;
  transition: color .2s;
}

.form-success {
  text-align: center;
  min-height: 2em;
  margin-top: 12px;
  font-weight: bold;
  margin-top: 15px;
  color: #14b05e;
  font-size: 1em;
}




/* ===== 閉じるボタン ===== */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #ffe066 70%, #fffbe7 100%);
  border: 3px solid #ffd600;
  border-radius: 50%;
  font-size: 2.2rem;
  color: #a05e00;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(220, 180, 20, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    border-color 0.18s,
    transform 0.13s;
  z-index: 2;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  background: linear-gradient(135deg, #ffd600 80%, #fffde0 100%);
  color: #fff;
  border-color: #ffa800;
  box-shadow: 0 4px 20px rgba(220, 180, 20, 0.22);
  transform: scale(1.07);
}


/* ===== 保存ボタン ===== */
.save-btn {
  display: block;
  margin: 20px auto 0 auto;
  padding: 9px 32px;
  font-size: 1.12em;
  background: linear-gradient(90deg, #6074ea, #81b7e5);
  color: #fff;
  border: none;
  border-radius: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 9px rgba(90, 110, 200, 0.12);
  letter-spacing: 0.1em;
  transition: background 0.2s;
}

.save-btn:hover {
  background: linear-gradient(90deg, #4259c9, #57b2d9);
}


/* ===== 店舗情報設定モーダル ===== */
#shopInfoModal .modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 36px rgba(127, 63, 152, 0.11), 0 1.5px 0 #e8d6f8 inset;
  max-width: 480px;
  width: 95vw;
  padding: 36px 30px 28px 30px;
  position: relative;
  border: 1.2px solid #ecd9f6;
  font-family: "Segoe UI", "ヒラギノ角ゴ ProN", "Meiryo", sans-serif;
  color: #4e345c;
  letter-spacing: 0.02em;
  transition: box-shadow .15s;
}

#shopInfoModal h2 {
  font-size: 1.4rem;
  text-align: left;
  color: #653b96;
  margin: 0 0 18px 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1.2px solid #e7e0f1;
  padding-bottom: 7px;
}

#shopInfoModal label {
  display: block;
  margin-bottom: 17px;
  font-size: 15px;
  color: #6a5495;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#shopInfoModal input[type="text"],
#shopInfoModal input[type="email"],
#shopInfoModal input[type="tel"],
#shopInfoModal input[type="url"],
#shopInfoModal textarea {
  width: 100%;
  padding: 10px 13px;
  font-size: 15px;
  border: 1.1px solid #ecd9f6;
  border-radius: 8px;
  background: #f8f7fc;
  margin-top: 6px;
  margin-bottom: 2px;
  box-sizing: border-box;
  color: #4e345c;
  transition: border-color 0.15s, background 0.12s;
}

#shopInfoModal input:focus,
#shopInfoModal textarea:focus {
  border-color: #b39ddb;
  background: #f3edfc;
  outline: none;
}

#shopInfoModal .form-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 2px;
  min-height: 1.2em;
  font-weight: 500;
}


/* ===== 営業時間設定モーダル用 ===== */
.business-hours-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px #0001;
  font-size: 1rem;
  margin-bottom: 12px;
}

.business-hours-table th,
.business-hours-table td {
  text-align: center;
  padding: 0.6em 0.4em;
  border-bottom: 1px solid #e6e6e6;
}

.business-hours-table th {
  background: #f4f6fa;
  color: #2a387a;
  font-weight: bold;
  font-size: 1.1em;
}

.business-hours-table thead th {
  background: #f3f5f8;
  font-weight: bold;
  color: #4460b2;
  border-bottom: 1.5px solid #dee2ef;
  font-size: 0.96em;
}

.business-hours-table tbody td {
  background: #f9fafc;
  border-radius: 12px;
  font-size: 1em;
}

/* ===== インプット & セル ===== */
.slot-cell {
  position: relative;
  white-space: nowrap;
  min-width: 120px;
}

.slot-cell input[type="time"] {
  width: 68px;
  font-size: 0.99em;
  padding: 4px 8px;
  border: 1px solid #ccd2e2;
  border-radius: 7px;
  margin: 0 1px;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.slot-cell input[type="time"]:focus {
  border-color: #4460b2;
  outline: none;
}

/* ===== クリア（×）ボタン ===== */
.slot-clear-btn {
  position: absolute;
  transform: translateY(-50%);
  top: 2px;
  right: -4px;
  /* 右に少しはみ出させると押しやすい */
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #bdb5d2;
  color: #fff;
  font-size: 0.9em;
  line-height: 18px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}

.slot-clear-btn:hover {
  background: #9575cd;
}

.slot-clear-btn:active {
  transform: scale(0.9);
}


/* ===== 定休日モーダル用 holiday-table ===== */
.holiday-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  margin: 0 auto 16px auto;
  box-shadow: 0 3px 14px #eee3;
  font-size: 1rem;
}

.holiday-table th,
.holiday-table td {
  text-align: center;
  padding: 10px 6px;
  border-bottom: 1px solid #f2eaff;
}

.holiday-table th {
  background: #f5f1fb;
  color: #7f3f98;
  font-weight: bold;
  font-size: 1.07em;
  letter-spacing: 0.08em;
  border-bottom: 2px solid #e1d4f6;
}

.holiday-table tr:last-child td {
  border-bottom: none;
}

.holiday-table td {
  background: #faf9fc;
  font-size: 1.05em;
  vertical-align: middle;
}

/* チェックボックス */
.holiday-table input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: #8361d1;
  cursor: pointer;
  margin: 0 auto;
  display: inline-block;
  vertical-align: middle;
  border-radius: 5px;
  box-shadow: 0 1px 3px #eee7;
  background: #fff;
}

/* PC/スマホ対応 */
@media (max-width: 600px) {

  .holiday-table th,
  .holiday-table td {
    font-size: 0.95em;
    padding: 7px 2px;
  }

  .holiday-table input[type="checkbox"] {
    width: 19px;
    height: 19px;
  }
}

/* モーダル枠 */
.holiday-settings-modal-content {
  background: #fff;
  border-radius: 15px;
  border: 1.5px solid #e6d7fa;
  box-shadow: 0 8px 32px rgba(127, 63, 152, .08);
  max-width: 410px;
  width: 95vw;
  padding: 30px 18px 28px 18px;
  margin: 7vh auto;
  position: relative;
  animation: modalFadeIn 0.32s;
}

.holiday-settings-modal-content h2 {
  text-align: center;
  font-size: 1.15em;
  color: #7259a7;
  margin-bottom: 18px;
  font-weight: bold;
  letter-spacing: .03em;
}

.modal-content,
.business-hours-modal-content,
.settings-modal-content,
.notice-modal-content,
.holiday-settings-modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.csv-download-section {
  border-top: 1px solid #eee;
  margin-top: 20px;
  padding-top: 16px;
}

.csv-download-btn {
  background: #7f3f98;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 15px;
  cursor: pointer;
  margin: 4px 0;
  transition: background 0.2s;
}

.csv-download-btn:hover {
  background: #632f77;
}

#csvPeriodForm {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  /* 開始日と終了日の間隔 */
  margin-bottom: 20px;
  margin-top: 6px;
}

#csvPeriodForm label {
  display: flex;
  align-items: center;
  font-size: 15px;
  gap: 6px;
}

#csvPeriodForm input[type="date"] {
  width: 140px;
  font-size: 15px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

@media (max-width: 600px) {
  #csvPeriodForm {
    flex-direction: column;
    align-items: center;
  }

  #csvPeriodForm label {
    width: 100%;
    justify-content: center;
    margin-bottom: 1px;
  }

  #csvPeriodForm label:last-child {
    margin-bottom: 0;
    /* 最後だけ余白なし */
  }

  #csvPeriodForm input[type="date"] {
    width: 95%;
    min-width: 0;
  }
}

/* モーダル表示中は body を固定（スクロール不可＆位置維持） */
body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  /* 念のため */
}