/* Peach Style GYM 加盟店ポータル
   ブランド：#FC9484（サーモンピンク）。グラデーション禁止・Material Pink系禁止（§8-A）。
   モバイル優先（アプリのように使える＝下部タブ＋1画面1目的）。 */
:root {
  --peach: #FC9484;
  --peach-dark: #F47A6A;
  --peach-soft: #ffe7e1;
  --peach-softer: #fff4f1;
  --ink: #333333;
  --muted: #8a817c;
  --line: #f0dcd6;
  --ok: #2e9e6b;
  --warn: #d67a12;
  --danger: #d64545;
  --bg: #fffaf8;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(244,122,106,.10);
  --tabbar: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
button { cursor: pointer; }
a { color: var(--peach-dark); }
h2 { font-size: 19px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 18px 0 8px; }

/* ヘッダー */
.top {
  background: var(--peach); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow);
}
.top h1 { font-size: 16px; margin: 0; font-weight: 700; white-space: nowrap; }
@media (max-width: 420px) { .top h1 { font-size: 14px; } .top { padding: 12px 12px; gap: 8px; } }
#store-switch { flex: 1; min-width: 0; max-width: 280px; }
#store-switch input { padding: 8px 12px; border-radius: 999px; border-width: 0; font-size: 14px; }
.top .spacer { flex: 1; }
.top .who { font-size: 12px; background: rgba(255,255,255,.22); padding: 5px 10px; border-radius: 999px; }
.top .icon-btn { background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }

.wrap { max-width: 940px; margin: 0 auto; padding: 14px 14px 30px; }

/* カード */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card.tight { padding: 12px 14px; }
.card h3 { margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-r { flex-wrap: wrap; }
.spacer { flex: 1; }
.right { margin-left: auto; }

/* ボタン */
.btn {
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 700; color: var(--ink);
}
.btn:hover { border-color: var(--peach); }
.btn-primary { background: var(--peach); border-color: var(--peach); color: #fff; }
.btn-primary:hover { background: var(--peach-dark); border-color: var(--peach-dark); }
.btn-primary:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #f3d3d3; }

/* 入力 */
label.f { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: #5b524e; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 11px 13px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--peach); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 検索バー（全データ画面に必須） */
.searchbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.searchbar input[type=text] { flex: 1; min-width: 180px; border-radius: 999px; }
.searchbar select { width: auto; min-width: 150px; border-radius: 999px; padding: 9px 12px; }

/* コンボボックス（選択＋打ち込み絞り込み） */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 2px solid var(--line); border-radius: 12px;
  max-height: 260px; overflow: auto; box-shadow: var(--shadow);
}
.combo-list div { padding: 10px 13px; font-size: 14px; border-bottom: 1px solid var(--peach-softer); }
.combo-list div:last-child { border-bottom: 0; }
.combo-list div:hover, .combo-list div.on { background: var(--peach-softer); }

/* バッジ・チップ */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--peach-soft); color: var(--peach-dark); }
.badge.ok { background: #e3f5eb; color: var(--ok); }
.badge.warn { background: #fdf0e0; color: var(--warn); }
.badge.danger { background: #fbe4e4; color: var(--danger); }
.badge.gray { background: #eee9e7; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; }
.chip.active { background: var(--peach); border-color: var(--peach); color: #fff; }

/* 進捗バー */
.bar { height: 10px; background: var(--peach-softer); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--peach); }

/* 一覧 */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.item .t { font-weight: 700; font-size: 15px; }
.item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item.done { opacity: .6; }
.item.locked { background: #faf7f6; }
.check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  background: #fff; flex: 0 0 auto; display: grid; place-items: center; font-size: 15px; color: #fff;
}
.check.on { background: var(--ok); border-color: var(--ok); }
.check.lock { background: #eee9e7; border-color: #e2dbd8; color: var(--muted); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 21px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .n { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* テーブル（横スクロール可） */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; }
th.sorted::after { content: ' ▾'; color: var(--peach); }
th.sorted.asc::after { content: ' ▴'; }

/* 下部タブ（アプリUX） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  background: none; border: 0; padding: 8px 2px 10px; font-size: 10.5px; color: var(--muted); font-weight: 700;
}
.tabbar button .i { display: block; font-size: 19px; line-height: 1.25; }
.tabbar button.on { color: var(--peach-dark); }

/* モーダル */
.modal-bg { position: fixed; inset: 0; background: rgba(51,48,46,.45); z-index: 40; display: grid; place-items: end center; }
.modal {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .modal-bg { place-items: center; }
  .modal { border-radius: 18px; }
}
.modal h3 { margin-top: 0; font-size: 17px; }

/* 通知バナー */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 14px);
  background: #333; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 50;
  max-width: 90vw; text-align: center;
}
.toast.err { background: var(--danger); }

.notice { background: var(--peach-softer); border: 1px solid var(--peach-soft); border-radius: 12px; padding: 11px 13px; font-size: 13px; }
.notice.warn { background: #fdf6ec; border-color: #f6e0c0; }
.notice.danger { background: #fdeeee; border-color: #f6cccc; }

.sig-pad { width: 100%; height: 170px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; }
img.evi { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.md { font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.md h1, .md h2 { font-size: 17px; margin: 12px 0 6px; }
