/* スマホ優先・大きめタップ（高齢従業員も迷わない UX）。SPEC設計原則 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: #f4f5f7;
  color: #1f2329;
  font-size: 18px;
  line-height: 1.6;
}
.appbar {
  background: #d7382c;
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
}
.appbar-title { font-size: 20px; font-weight: 700; }
.container { max-width: 640px; margin: 0 auto; padding: 16px; }
/* 管理画面は画面幅を広く使う */
body.admin .container { max-width: 1120px; padding: 20px 28px; }
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 4px 0 10px; }
h3 { font-size: 17px; margin: 14px 0 6px; color: #444; }
.muted { color: #6b7280; font-size: 15px; }
.notice { background: #fff7e6; border: 1px solid #ffe2a8; border-radius: 8px; padding: 8px 10px; }
.greet .who { font-size: 22px; font-weight: 700; }

/* 注文枠 */
.slot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 10px; margin-bottom: 8px;
  border: 2px solid #e5e7eb;
}
.slot.open { border-color: #34a853; background: #f0fbf3; }
.slot.closed { border-color: #d1d5db; background: #f3f4f6; color: #9ca3af; }
.slot-label { font-weight: 700; flex: 1; }
.slot-time { font-size: 15px; }
.badge { font-size: 13px; padding: 3px 8px; border-radius: 999px; background: #e5e7eb; }
.slot.open .badge { background: #34a853; color: #fff; }

/* メニュー */
.menu { list-style: none; padding: 0; margin: 0; }
.menu li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; border-bottom: 1px solid #eef0f2;
}
.item-name { flex: 1; font-weight: 600; }
.item-price { font-weight: 700; }
.tag { font-size: 13px; color: #6b7280; background: #eef0f2; border-radius: 6px; padding: 2px 6px; }

/* 履歴テーブル */
table.history { width: 100%; border-collapse: collapse; font-size: 15px; }
table.history th, table.history td { padding: 8px 6px; border-bottom: 1px solid #eef0f2; text-align: left; }
table.history th { color: #6b7280; font-weight: 600; }
table.history td.num { text-align: right; white-space: nowrap; }

/* カテゴリタブ（JS不要・本家と同じ区分/並び）＋ 写真カードのグリッド */
.tabs { margin-top: 6px; }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tab-label {
  display: inline-block; padding: 8px 12px; margin: 0 6px 6px 0;
  border: 1px solid #e5e7eb; border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tab-panel { display: none; }
/* チェックされたタブのパネルを表示・ラベルを強調（カテゴリ最大12まで） */
#htab-1:checked ~ #hpanel-1, #htab-2:checked ~ #hpanel-2, #htab-3:checked ~ #hpanel-3,
#htab-4:checked ~ #hpanel-4, #htab-5:checked ~ #hpanel-5, #htab-6:checked ~ #hpanel-6,
#htab-7:checked ~ #hpanel-7, #htab-8:checked ~ #hpanel-8, #htab-9:checked ~ #hpanel-9,
#htab-10:checked ~ #hpanel-10, #htab-11:checked ~ #hpanel-11, #htab-12:checked ~ #hpanel-12 {
  display: block;
}
#htab-1:checked ~ label[for="htab-1"], #htab-2:checked ~ label[for="htab-2"],
#htab-3:checked ~ label[for="htab-3"], #htab-4:checked ~ label[for="htab-4"],
#htab-5:checked ~ label[for="htab-5"], #htab-6:checked ~ label[for="htab-6"],
#htab-7:checked ~ label[for="htab-7"], #htab-8:checked ~ label[for="htab-8"],
#htab-9:checked ~ label[for="htab-9"], #htab-10:checked ~ label[for="htab-10"],
#htab-11:checked ~ label[for="htab-11"], #htab-12:checked ~ label[for="htab-12"] {
  background: #d7382c; color: #fff; border-color: #d7382c;
}

/* 店の選択タブ（最上位・大きめ）。初期は未選択（どのパネルも非表示） */
#stab-1:checked ~ #spanel-1, #stab-2:checked ~ #spanel-2 { display: block; }
/* ほっともっと＝赤 / 松美屋＝やや暗めの緑 */
#stab-1:checked ~ label[for="stab-1"] { background: #d7382c; color: #fff; border-color: #d7382c; }
#stab-2:checked ~ label[for="stab-2"] { background: #2f6b4f; color: #fff; border-color: #2f6b4f; }
.shoptabs > .tab-label { font-size: 17px; padding: 14px 22px; border-width: 2px; }
.shoptabs > .tab-label.sl-hotto { color: #d7382c; border-color: #d7382c; }
.shoptabs > .tab-label.sl-matsu { color: #2f6b4f; border-color: #2f6b4f; }
/* 店タブとカテゴリ/中身の間を空ける */
.shoptabs > .tab-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
/* 松美屋パネルのアクセント */
#spanel-2 .item-link .chev { color: #2f6b4f; }
#spanel-2 .item-link .item-price { color: #2f6b4f; }

.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px;
}
.prod {
  border: 1px solid #eef0f2; border-radius: 12px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.prod-img { position: relative; aspect-ratio: 1 / 1; background: #f3f4f6; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-img .badge.soldout { position: absolute; top: 8px; left: 8px; }
.prod-name { font-size: 14px; font-weight: 600; padding: 8px 10px 0; line-height: 1.35; }
.prod-price { font-size: 16px; font-weight: 700; padding: 4px 10px 0; }
.prod .opts { padding: 2px 10px 10px; font-size: 12px; }
.prod.is-soldout { opacity: .55; }
.badge.soldout { background: #d7382c; color: #fff; }
.badge.warn { background: #ffe2a8; color: #7a5b00; }
.opts { font-size: 13px; margin-top: 2px; color: #6b7280; }

/* 商品カードをリンクにしたとき */
a.prod { text-decoration: none; color: inherit; }
a.prod:active { transform: scale(.99); }

/* あなたの注文 */
.myorder { list-style: none; padding: 0; margin: 0; }
.myorder li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef0f2; }
.mo-name { flex: 1; font-weight: 600; }
.mo-qty { color: #6b7280; }
.mo-amt { font-weight: 700; white-space: nowrap; }
.inline { display: inline; margin: 0; }
.btn-del { border: 1px solid #e5e7eb; background: #fff; color: #d7382c; border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.total-row { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; font-size: 18px; }

/* 松美屋 本日のメニュー */
.matsu-today { border: 1px solid #cfe8d8; background: #f3fbf6; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.matsu-today-head { font-weight: 700; color: #2f6b4f; margin-bottom: 6px; }
.matsu-items { font-size: 16px; margin-bottom: 8px; }
.matsu-img { width: 100%; max-width: 360px; border-radius: 10px; display: block; }

/* 松美屋リンク行 */
.item-link { display: flex; align-items: center; gap: 8px; width: 100%; text-decoration: none; color: inherit; }
.item-link .chev { margin-left: auto; color: #9ca3af; font-size: 22px; }

/* 商品ページ */
.item-photo { width: 100%; max-width: 360px; border-radius: 12px; display: block; margin: 0 auto 12px; }
.field { margin: 16px 0; padding-top: 12px; border-top: 1px solid #eef0f2; }
.field-label { font-weight: 700; margin-bottom: 8px; }
.req { font-size: 12px; background: #d7382c; color: #fff; border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
.opt-tag { font-size: 12px; background: #eef0f2; color: #6b7280; border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
.radio, .chk { display: flex; align-items: center; gap: 8px; padding: 12px; margin: 0 0 8px 0;
  border: 1px solid #e5e7eb; border-radius: 10px; font-size: 16px; }
.radio.disabled, .chk.disabled { opacity: .5; }
.radio input, .chk input { width: 20px; height: 20px; }

/* 受付時間外の案内 */
.closed-notice {
  background: #fff7e6; border: 2px solid #ffd591; border-radius: 12px;
  padding: 16px; text-align: center;
}
.closed-notice .closed-big { font-size: 20px; font-weight: 700; color: #ad6800; margin-bottom: 6px; }
.closed-notice p { margin: 6px 0; }

/* ご注文ありがとう画面 */
.thanks-card { text-align: center; border: 2px solid #34a853; }
.thanks-big { font-size: 24px; font-weight: 800; color: #166534; margin-bottom: 10px; }
.thanks-card .myorder { text-align: left; margin-top: 12px; }
.thanks-card .btn-primary { margin-top: 16px; }
body.tablet .thanks-big { font-size: 30px; }

/* 注文エラー画面（上限超過・売切等） */
.error-card { text-align: center; border: 2px solid #d7382c; }
.error-big { font-size: 22px; font-weight: 800; color: #b91c1c; margin-bottom: 10px; }
.error-card p { font-size: 17px; margin: 8px 0 4px; }

/* カート / 確定 */
.cart-card { border: 2px solid #d7382c; }
.done-banner { background: #f0fbf3; border: 2px solid #34a853; color: #166534; text-align: center; }
.qty { font-size: 18px; padding: 10px; border-radius: 10px; border: 1px solid #e5e7eb; min-width: 90px; }
.btn-primary { display: block; width: 100%; margin-top: 10px; padding: 16px; border: none;
  border-radius: 12px; background: #d7382c; color: #fff; font-size: 18px; font-weight: 700; }

/* 共有タブレット 名前選択 */
.name-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.name-btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 110px; padding: 16px; border-radius: 16px;
  background: #fff; border: 3px solid #d7382c; color: #d7382c;
  font-size: 30px; font-weight: 700; text-decoration: none; text-align: center;
}
.name-btn:active { background: #fff0ef; }
.name-btn.sub { flex-direction: column; gap: 4px; min-height: 92px; font-size: 24px;
  border-color: #6b7280; color: #374151; }
.name-btn.sub .loc { font-size: 14px; font-weight: 500; color: #9ca3af; }
/* タブレットの緊急用（折りたたみ） */
details.emergency > summary { cursor: pointer; font-size: 22px; font-weight: 700;
  color: #1f57c3; padding: 10px 4px; list-style: revert; }
details.emergency[open] > summary { margin-bottom: 8px; }

/* タブレット向けレイアウト（高齢者想定：大きめ文字・広い余白・視認性UP） */
body.tablet { font-size: 22px; }
body.tablet .container { max-width: 900px; padding: 28px 36px; }
body.tablet .appbar { padding: 20px 28px; }
body.tablet .appbar-title { font-size: 26px; }
body.tablet .card { padding: 28px 32px; margin-bottom: 22px; border-radius: 16px; }
body.tablet h1 { font-size: 32px; line-height: 1.4; margin-bottom: 16px; }
body.tablet .muted { font-size: 18px; }
body.tablet .who { font-size: 30px; }
body.tablet .btn-primary { font-size: 24px; padding: 22px; }
body.tablet .btn-secondary { font-size: 20px; padding: 16px 22px; }

/* 管理画面 集計 */
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.stat { flex: 1 1 110px; background: #f8f9fb; border: 1px solid #eef0f2; border-radius: 10px; padding: 12px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: #1f2329; }
.stat-lbl { font-size: 13px; color: #6b7280; margin-top: 2px; }
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 4px; }
table.adm th, table.adm td { padding: 7px 8px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; }
table.adm thead th { color: #6b7280; background: #f8f9fb; }
table.adm td.num, table.adm th.num { text-align: right; white-space: nowrap; }
.ym-form { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn-primary { flex: 1 1 160px; text-align: center; }
.shop-sec { font-weight: 700; color: #2f6b4f; margin: 12px 0 2px; border-left: 4px solid #2f6b4f; padding-left: 8px; }
.shop-sec:first-child { margin-top: 4px; }
.vlist { list-style: none; padding: 0; margin: 6px 0; }
.vlist li { padding: 7px 4px; border-bottom: 1px solid #eef0f2; }
.vlist a { color: #1f57c3; text-decoration: none; }
.vlist.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }

/* 当日ダッシュボードの拠点タブ */
#dtab-1:checked ~ #dpanel-1, #dtab-2:checked ~ #dpanel-2, #dtab-3:checked ~ #dpanel-3,
#dtab-4:checked ~ #dpanel-4, #dtab-5:checked ~ #dpanel-5, #dtab-6:checked ~ #dpanel-6 { display: block; }
#dtab-1:checked ~ label[for="dtab-1"], #dtab-2:checked ~ label[for="dtab-2"],
#dtab-3:checked ~ label[for="dtab-3"], #dtab-4:checked ~ label[for="dtab-4"],
#dtab-5:checked ~ label[for="dtab-5"], #dtab-6:checked ~ label[for="dtab-6"] {
  background: #1f2329; color: #fff; border-color: #1f2329;
}
.dtabs > .tab-panel { margin-top: 12px; }
/* 集計マトリクス */
table.matrix { margin: 6px 0 4px; }
table.matrix th { background: #f8f9fb; }
table.matrix tbody th { text-align: left; font-weight: 700; }
table.matrix td.num { font-weight: 700; font-size: 16px; }
table.matrix tr.total th, table.matrix tr.total td { background: #eef2ff; }
/* 品目別の注文者名 */
.orderers { font-size: 12px; color: #6b7280; margin-top: 2px; }
/* 注文調整フォーム */
.adjust-form { display: flex; flex-direction: column; gap: 12px; }
.adjust-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.adjust-form select, .adjust-form input { font-size: 16px; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
.adjust-form .btn-primary { align-self: flex-start; }
.adjust-form .row2 { display: flex; gap: 16px; flex-wrap: wrap; }
.ord-badge { float: right; font-size: 13px; color: #166534; background: #f0fbf3; border-radius: 999px; padding: 2px 10px; }
.ord-badge.none { color: #9ca3af; background: #f3f4f6; }
.adjust-list { list-style: none; padding: 0; margin: 0; }
.adjust-list li { padding: 10px 0; border-bottom: 1px solid #eef0f2; }
.al-name { font-weight: 600; margin-bottom: 6px; }
.al-ctrl { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.al-ctrl .inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.btn-mini { border: 1px solid #1f57c3; color: #1f57c3; background: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; display: inline-block; text-decoration: none; }
.btn-mini.warn { border-color: #c0392b; color: #c0392b; background: #fdecea; }
.btn-mini.warn:hover { background: #f9d7d2; }
.adjust-form label.chk { flex-direction: row; align-items: center; gap: 8px; }
.emp-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.emp-ops .inline { margin: 0; }
tr.retired { color: #9ca3af; background: #fafafa; }
.adminbadge { font-size: 11px; background: #1f2329; color: #fff; border-radius: 6px; padding: 1px 6px; }
/* 従業員一覧フィルタ */
.emp-filter { margin-bottom: 10px; }
.emp-filter input[type="search"] { width: 100%; max-width: 360px; font-size: 15px;
  padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 8px; }
.emp-filter .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.emp-filter .chip { border: 1px solid #cbd5e1; background: #fff; color: #334155;
  border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.emp-filter .chip:hover { background: #f1f5f9; }
.emp-count { margin-left: 8px; font-size: 13px; }
/* 同じ拠点の注文（スマホ向け：店でグループ化・店列なし） */
.loc-shop { font-weight: 700; font-size: 16px; margin: 14px 0 6px; padding: 4px 10px;
  border-radius: 8px; color: #fff; }
.loc-shop:first-child { margin-top: 0; }
.loc-shop.sh-matsu { background: #2f6b4f; }
.loc-shop.sh-hotto { background: #d7382c; }
.loc-list { list-style: none; padding: 0; margin: 0; }
.loc-list li { padding: 8px 2px; border-bottom: 1px solid #eef0f2; }
.loc-r1 { display: flex; justify-content: space-between; align-items: baseline; }
.loc-name { font-weight: 700; }
.loc-qty { color: #6b7280; font-weight: 700; white-space: nowrap; margin-left: 8px; }
.loc-item { color: #444; font-size: 14px; margin-top: 1px; }
/* 営業日カレンダー */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.cal-title { font-size: 18px; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th { padding: 6px; font-size: 13px; color: #6b7280; }
table.cal th.sun { color: #d7382c; } table.cal th.sat { color: #1f57c3; }
table.cal td { border: 1px solid #eef0f2; padding: 0; height: 64px; vertical-align: top; }
table.cal td.out { background: #fafafa; }
.cal-day { width: 100%; height: 64px; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.cal-day.is-biz { background: #f0fbf3; }
.cal-day.is-holi { background: #f3f4f6; color: #9ca3af; }
.cal-day .cal-d { font-size: 16px; font-weight: 700; }
.cal-day .cal-s { font-size: 11px; }
.cal-day .cal-ov { font-size: 10px; background: #ffe2a8; color: #7a5b00; border-radius: 6px; padding: 0 4px; }
.cal-day .cal-hd { font-size: 9px; color: #d7382c; line-height: 1.1; text-align: center; }
table.cal td { height: 72px; }
td .cal-d.muted { display: block; text-align: center; padding-top: 8px; }

/* ボタン */
.btn-secondary {
  display: inline-block; margin-top: 10px;
  padding: 12px 16px; border-radius: 10px;
  background: #eef0f2; color: #1f2329; text-decoration: none; font-weight: 600;
}
