* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #f4f5f7;
  color: #1b222c;
}

.view { display: none; min-height: 100%; }
.view.active { display: block; }

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c2541;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.login-box h1 {
  margin: 0 0 24px;
  font-size: 20px;
  text-align: center;
  color: #1c2541;
}

.field-label {
  display: block;
  font-size: 13px;
  color: #5b6472;
  margin: 14px 0 4px;
}
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadfe6;
  border-radius: 8px;
  font-size: 15px;
}
input:focus { outline: 2px solid #3d5a80; outline-offset: 1px; }

.error-text {
  color: #b3261e;
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0 0;
}

.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #1c2541;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.primary-btn:active:not(:disabled) { opacity: 0.85; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #dadfe6;
}
.app-header h1 { font-size: 17px; margin: 0; color: #1c2541; }
.header-btn {
  border: none;
  background: none;
  color: #3d5a80;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
}

main { padding: 20px; max-width: 480px; margin: 0 auto; }

.info-card {
  background: #fff;
  border: 1px solid #dadfe6;
  border-radius: 10px;
  padding: 16px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid #ececec;
  font-size: 14px;
}
.info-row:first-child { border-top: none; }
.info-label { color: #5b6472; }
.info-value { font-weight: 600; }

.placeholder-note {
  color: #5b6472;
  font-size: 14px;
  line-height: 1.7;
  margin: 20px 0;
}

.ping-result {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

.inline-retry-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
}

.hidden { display: none !important; }

.header-spacer { width: 56px; } /* 戻るボタンと横幅を揃え、タイトルを中央寄せに見せるための空スペーサー */

/* ホーム画面のメニュー */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.menu-btn {
  padding: 18px 12px;
  border: 1px solid #dadfe6;
  border-radius: 10px;
  background: #fff;
  color: #1c2541;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.menu-btn:active { background: #f4f5f7; }

/* 店舗名表示・停止/稼働再開トグル・アカウント管理はmaster専用の機能のため、店舗スタッフには表示しない */
.role-store #homeStoreNameRow,
.role-store #homeStatusToggleBtn,
.role-store #homeStatusToggleResult,
.role-store #menuAccountManageBtn {
  display: none;
}
/* 店舗設定・応答メッセージ等の4メニューはスタッフ専用の機能のため、masterには表示しない(store_idを持たないため使えない) */
.role-master .menu-grid { display: none; }

.info-value-input {
  width: 55%;
  padding: 4px 8px;
  border: 1px solid #dadfe6;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.section-subtitle {
  font-size: 15px;
  color: #1c2541;
  margin: 24px 0 4px;
}
.section-subtitle:first-child { margin-top: 0; }

/* 編集フォーム共通 */
.edit-form { display: flex; flex-direction: column; }
.field-error {
  color: #b3261e;
  font-size: 12px;
  min-height: 16px;
  margin: 4px 0 0;
}

/* 受付開始/終了・当日予約復帰の時刻プルダウン */
.time-picker { display: flex; align-items: center; gap: 8px; }
.time-picker select {
  padding: 10px 8px;
  border: 1px solid #dadfe6;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
.time-picker-separator { font-size: 15px; color: #5b6472; }

/* 行の追加/削除ができるリスト入力(StoreConfigのエリア・コース等) */
.dynamic-list-rows { display: flex; flex-direction: column; gap: 8px; }
.dynamic-list-row { display: flex; gap: 8px; align-items: center; }
.dynamic-list-row input { flex: 1; }
.row-remove-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #dadfe6;
  border-radius: 8px;
  background: #fff;
  color: #b3261e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.list-add-btn {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px dashed #9aa3b2;
  border-radius: 8px;
  background: none;
  color: #3d5a80;
  font-size: 13px;
  cursor: pointer;
  align-self: flex-start;
}

/* 名称+金額のペア入力行(コース一覧・指名料一覧) */
.name-price-row .name-price-name { flex: 2; min-width: 0; }
.name-price-row .name-price-price { flex: 1; min-width: 72px; }

.field-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 8px;
}

/* Messageアコーディオン */
.accordion-section {
  border: 1px solid #dadfe6;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}
.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: none;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #1c2541;
  cursor: pointer;
  text-align: left;
}
.accordion-header .accordion-caret {
  transition: transform 0.15s ease;
  color: #5b6472;
}
.accordion-section.open .accordion-header .accordion-caret { transform: rotate(90deg); }
.accordion-body {
  display: none;
  padding: 0 16px 16px;
  flex-direction: column;
  gap: 14px;
}
.accordion-section.open .accordion-body { display: flex; }
.message-item-label {
  font-size: 12px;
  color: #5b6472;
  margin: 0 0 4px;
}
.message-item textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #dadfe6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.message-item textarea.dirty { border-color: #3d5a80; background: #f0f4fa; }
.message-item-note { font-size: 11px; color: #9aa3b2; margin: 4px 0 0; }

/* NGList */
.ng-add-form {
  background: #fff;
  border: 1px solid #dadfe6;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.ng-entry-card {
  background: #fff;
  border: 1px solid #dadfe6;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ng-entry-body { flex: 1; min-width: 0; } /* 長い備考がボタンを押し出さず折り返すようにする */
.ng-entry-body p { margin: 0; } /* <p>のブラウザ既定マージン(1em)を打ち消す */
.ng-entry-body p + p { margin-top: 4px; } /* 2行目以降だけ4pxの行間 */
.ng-entry-phone { font-size: 15px; font-weight: 600; color: #1c2541; }
.ng-entry-note { font-size: 13px; color: #5b6472; }
.ng-entry-meta { font-size: 11px; color: #9aa3b2; }
.ng-entry-delete-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid #b3261e;
  border-radius: 8px;
  background: #fff;
  color: #b3261e;
  font-size: 13px;
  cursor: pointer;
}
.empty-note { color: #9aa3b2; font-size: 14px; text-align: center; padding: 24px 0; }

/* ReservationLog */
.log-card {
  background: #fff;
  border: 1px solid #dadfe6;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.log-card-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #5b6472;
  margin-bottom: 6px;
}
.log-card-main { font-size: 15px; font-weight: 600; color: #1c2541; }
.log-card-row { font-size: 13px; color: #333; margin-top: 4px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #dadfe6;
  border-radius: 8px;
  background: #fff;
  color: #1c2541;
  font-size: 13px;
  cursor: pointer;
}
.page-btn.active {
  background: #1c2541;
  color: #fff;
  border-color: #1c2541;
}
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-ellipsis { color: #9aa3b2; padding: 0 4px; }

/* PWAインストール導線バナー(ログイン画面) */
.install-banner {
  background: #eef2f8;
  border: 1px solid #c7d2e0;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 20px;
}
.install-banner-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: #3d5a80;
  line-height: 1.6;
}
.install-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.install-banner-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #1c2541;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.install-banner-close {
  padding: 6px 10px;
  border: none;
  background: none;
  color: #5b6472;
  font-size: 13px;
  cursor: pointer;
}
