/* 空き状況(2026-09-09にご指示)。着信ダッシュボード(staff/index.html)と
   フロント画面(front.html、2026-10-05にご指示)の両方で使う。
   中身は /staff/js/availability.js が描く。色の名前(--gold など)は style.css のもの。 */

/* ---------- 空き状況カレンダー(2026-09-09にご指示) ----------
   見た目の骨格(全画面パネル・戻るボタン等)は忘れ物画面と共通の
   .view-lost-items を流用し、ここでは中身(タブ・マス目)だけを作る。 */
.avail-message { margin: 8px 0; font-size: 0.88rem; color: var(--cream-alt); flex-shrink: 0; }
.avail-message.is-error { color: #ffb4a3; }

.avail-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.avail-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(251, 246, 238, 0.8);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.avail-tab.is-active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* 表の形(2026-10-06に作り直し)。
   フロントのiPadで、部屋名が消えてマス目の色がにじむ表示崩れが出た(2026-10-06にご指摘)。
   それまでは1つの表の中で「横にずらしても部屋名の列だけ止まって見える(sticky)」と
   「行を縦に引き伸ばして余白を使い切る(flex:1)」を組み合わせていたが、iPadによっては
   これを正しく描けないため、どちらも使わない形にした。見た目は前と同じ。
   ・左の部屋名の列(.avail-side)と、右の日にちの部分(.avail-days、ここだけ横に動く)を並べて置く
   ・行の高さは、全部屋が1画面に収まるよう availability.js の fitRows が計算して入れる
     (下の余白を使い切ってマス目を大きく見せる。2026-09-09のご指摘) */
.avail-grid-wrap { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.avail-grid { display: flex; align-items: flex-start; --avail-head-h: 48px; --avail-sum-h: 34px; --avail-row-h: 40px; }
.avail-side { flex: 0 0 96px; background: #14100c; }
.avail-days { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
/* 日にちの列。右端にあった「空き日数」の列は削除した(2026-09-11にご指示)。 */
.avail-row { display: grid; grid-template-columns: repeat(var(--avail-days), 40px); height: var(--avail-row-h); }
.avail-row--head { height: var(--avail-head-h); }
.avail-row--summary { height: var(--avail-sum-h); }
.avail-side .avail-cell { height: var(--avail-row-h); }
.avail-side .avail-cell--corner { height: var(--avail-head-h); }
.avail-side .avail-cell--summary-label { height: var(--avail-sum-h); }
.avail-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 2px;
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--cream);
  /* 縦横の線が薄くて見にくいというご指摘(2026-09-09)を受けて、はっきり見える
     白に変更。 */
  border-style: solid;
  border-width: 0 1px 1px 0;
  border-color: rgba(255, 255, 255, 0.55);
  border-radius: 0;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}
/* 空いているマス目は<button>にして押せるようにしてある(2026-09-09にご指示。
   料金計算のポップアップを開く入り口)。 */
.avail-cell--clickable {
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.avail-cell--clickable:active { box-shadow: inset 0 0 0 2px var(--gold-light); }
.avail-cell--room {
  justify-content: flex-start;
  padding-left: 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  background: #14100c;
}
.avail-row--head .avail-cell { color: rgba(251, 246, 238, 0.6); font-weight: 700; background: #14100c; line-height: 1.2; }
.avail-row--head .avail-cell--head.is-today { color: var(--gold-light); }

/* 1階(5部屋)と2階の間だけ太い線で区切る(2026-09-09にご指示)。
   部屋名の列と日にちの部分は別々なので、両方のマス目に同じ線を付ける。 */
.avail-row--floor-break .avail-cell,
.avail-cell--floor-break { border-top: 3px solid var(--gold); }

.avail-cell.is-occupied { background: rgba(179, 67, 43, 0.55); }
/* 休館日(2026-09-09にご指示。フロントの「休館日を選ぶ」と同じデータ)。
   埋まっている/空いているとは別の色にして、はっきり区別できるようにしてある。 */
.avail-cell.is-closed-day {
  background: repeating-linear-gradient(
    45deg,
    rgba(120, 120, 135, 0.35),
    rgba(120, 120, 135, 0.35) 5px,
    rgba(80, 80, 92, 0.35) 5px,
    rgba(80, 80, 92, 0.35) 10px
  );
  color: rgba(251, 246, 238, 0.5);
}
.avail-cell.is-free { background: rgba(74, 122, 74, 0.28); }
.avail-cell.is-today { box-shadow: inset 0 0 0 1px var(--gold-light); }

/* 空室数の行(2026-09-09にご指示。色分けだけでなく数字でも一目で分かるように)。 */
.avail-row--summary .avail-cell { background: rgba(255, 255, 255, 0.05); font-weight: 700; }
.avail-cell--summary-label { color: rgba(251, 246, 238, 0.6); font-weight: 600; }
.avail-row--summary .avail-cell--summary.is-full { color: #ffb4a3; }
/* 過ぎた日。もう売れないので薄く見せ、押しても料金計算は出さない(2026-09-10の総点検)。 */
.avail-cell.is-past { opacity: 0.3; }
.avail-row--summary .avail-cell.is-closed-day {
  background: repeating-linear-gradient(
    45deg,
    rgba(120, 120, 135, 0.35),
    rgba(120, 120, 135, 0.35) 5px,
    rgba(80, 80, 92, 0.35) 5px,
    rgba(80, 80, 92, 0.35) 10px
  );
  color: rgba(251, 246, 238, 0.5);
}

/* 宿泊料金計算のポップアップ(2026-09-09にご指示)。空き状況の空いているマス目
   を押すと、別サイト(ryokan-price-calc)をこの中に表示する。 */
.price-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(14, 11, 8, 0.85);
}
.price-popup-overlay[hidden] { display: none; }
.price-popup-card {
  width: 100%;
  height: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 8px;
}
.price-popup-close {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.price-popup-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #f6f1e7;
}

/* ---------- その日のお客様一覧(2026-09-29にご指示) ----------
   電話で「予約が入っていますか」と聞かれた時に使う。75歳のスタッフでも迷わないよう、
   明るい紙の上に大きな黒い文字、1部屋1枚のカード、戻るボタンは1つだけ。 */
.avail-hint { margin: 4px 0 6px; font-size: 1rem; font-weight: 700; color: var(--cream); flex-shrink: 0; }
.avail-hint__day { display: inline-block; padding: 0 8px; margin: 0 2px; border-radius: 6px; background: var(--gold); color: #fff; }
/* 日にち・空室数は押せるボタン(見た目はマス目のまま、日にちだけ金色の下線で押せると分かるように) */
.avail-cell--day { cursor: pointer; touch-action: manipulation; }
.avail-row--head .avail-cell--day { color: var(--cream); text-decoration: underline; text-decoration-color: var(--gold-light); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.avail-row--head .avail-cell--day:active { background: var(--gold); color: #fff; }
.day-card__plan { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.day-card__plan-label { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; background: #efe4d2; color: #7a4a2f; font-size: 0.95rem; vertical-align: 2px; }

.day-overlay { position: fixed; inset: 0; z-index: 40; display: flex; background: rgba(14, 11, 8, 0.85); padding: 12px; }
.day-overlay[hidden] { display: none; }
.day-sheet { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fbf6ee; color: #2a1d14; border-radius: 16px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; background: #efe4d2; border-bottom: 2px solid #d9c3a3; flex-shrink: 0; }
.day-back { padding: 14px 22px; min-height: 56px; border: none; border-radius: 12px; background: var(--gold); color: #fff; font-family: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.day-back:active { background: #a8622c; }
.day-title { margin: 0; font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.day-title__count { font-size: 1.3rem; font-weight: 700; color: #7a4a2f; }
.day-status { margin: 0; padding: 10px 16px; font-size: 1.15rem; font-weight: 700; background: #fff6d8; color: #5a3d00; flex-shrink: 0; }
.day-status.is-error { background: #fde2e0; color: #8a1f14; }
.day-status[hidden] { display: none; }
.day-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-content: start; }
.day-empty { grid-column: 1 / -1; margin: 40px 0; text-align: center; font-size: 1.7rem; font-weight: 700; color: #7a4a2f; }
.day-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: #fff; border: 2px solid #d9c3a3; border-radius: 14px; }
.day-card__room { margin: 0; align-self: flex-start; padding: 4px 12px; border-radius: 8px; background: #7a4a2f; color: #fff; font-size: 1.15rem; font-weight: 700; }
.day-card__name { margin: 2px 0 0; font-size: 2rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.day-card__sama { font-size: 1.3rem; font-weight: 700; }
.day-card__kana { margin: 0; font-size: 1.15rem; color: #5b4a3c; }
.day-card__sub { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 1.35rem; font-weight: 700; }
.day-card__badges { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.day-badge { padding: 4px 12px; border-radius: 999px; font-size: 1.1rem; font-weight: 800; }
.day-badge--allergy { background: #c0392b; color: #fff; }
.day-badge--celebrate { background: #f3c64b; color: #3d2a00; }
.day-note { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: #f6efe2; border: 2px solid #e2d3bb; }
.day-note.is-allergy { background: #fdeceb; border-color: #c0392b; }
.day-note__label { margin: 0 0 2px; font-size: 1rem; font-weight: 700; color: #7a4a2f; }
.day-note__text { margin: 0; font-size: 1.3rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.day-note--none, .day-note--loading { font-size: 1.1rem; color: #8a7a6a; background: none; border-style: dashed; }

/* 1人の料金と合計金額(2026-09-29にご指示) */
.day-price { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.day-price__item { display: inline-flex; align-items: baseline; gap: 6px; }
.day-price__label { padding: 1px 8px; border-radius: 6px; background: #efe4d2; color: #7a4a2f; font-size: 0.95rem; font-weight: 700; }
.day-tel { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.day-tel.is-none { color: #8a7a6a; }
/* 休館日のマス目の「休」は、お部屋の枠でもはっきり読めるように(2026-09-29にご指示) */
.avail-cell.is-closed-day { color: rgba(251, 246, 238, 0.85); font-weight: 700; }
/* 日にちの下に曜日(2026-09-29にご指示)。下線は数字だけに付ける */
.avail-row--head .avail-cell--day { flex-direction: column; gap: 2px; padding: 4px 0; text-decoration: none; }
.avail-day__num { text-decoration: underline; text-decoration-color: var(--gold-light); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.avail-day__dow { font-size: 0.78rem; font-weight: 700; color: rgba(251, 246, 238, 0.8); }
.avail-cell--day.is-sat .avail-day__dow { color: #8fb8ff; }
.avail-cell--day.is-sun .avail-day__dow { color: #ff9c8a; }
.avail-row--head .avail-cell--day { gap: 5px; padding: 6px 0 5px; }
.avail-day__num { text-underline-offset: 3px; line-height: 1.1; }
.avail-day__dow { font-size: 0.9rem; line-height: 1; color: var(--cream); }
.avail-cell--day.is-sat .avail-day__dow { color: #9ec3ff; }
.avail-cell--day.is-sun .avail-day__dow { color: #ffa08f; }

/* チェックアウト時間カレンダー */
.co-cal__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; }
.co-cal__title { font-size: 1.3rem; font-weight: 700; }
.co-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.co-cal__dow { text-align: center; font-weight: 700; padding: 4px 0; opacity: .85; }
.co-cal__cell { min-height: 74px; border: 1px solid rgba(201,169,110,.3); border-radius: 8px; padding: 4px 3px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255,255,255,.04); }
.co-cal__cell--blank { border: 0; background: none; }
.co-cal__cell.is-ten { background: rgba(255,160,60,.28); border-color: #ffa08f; }
.co-cal__day { font-size: 1.05rem; font-weight: 700; }
.co-cal__time { font-size: 1.25rem; font-weight: 800; }
.co-cal__cell.is-ten .co-cal__time { color: #ffd28a; }
.co-cal__why { font-size: .72rem; opacity: .85; text-align: center; line-height: 1.2; }
.co-cal__dow.is-sun, .co-cal__day.is-sun { color: #ff8f8f; }
.co-cal__dow.is-sat, .co-cal__day.is-sat { color: #8fc4ff; }
.co-cal__legend { display: inline-block; padding: 0 8px; border-radius: 6px; font-weight: 700; }
.co-cal__legend.is-ten { background: rgba(255,160,60,.28); border: 1px solid #ffa08f; }
.co-room { display: grid; grid-template-columns: 9em 7em 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 8px; border: 1px solid rgba(201,169,110,.3); border-radius: 12px; background: rgba(255,255,255,.04); }
.co-room__name { font-weight: 700; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-room__date { font-weight: 700; color: #b9e8c2; white-space: nowrap; }
.co-room__why { opacity: .8; font-size: .95rem; }
.co-room__time { display: flex; align-items: center; gap: 10px; }
.co-room { display: grid; grid-template-columns: 9em 7em 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 8px; border: 1px solid rgba(201,169,110,.3); border-radius: 12px; background: rgba(255,255,255,.04); }
.co-room__name { font-weight: 700; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-room__date { font-weight: 700; color: #b9e8c2; white-space: nowrap; }
.co-room__why { opacity: .8; font-size: .95rem; }
.co-room__time { display: flex; align-items: center; gap: 10px; }

/* 食事処・チェックアウトの画面は横いっぱいに使う(2026-10-12ご指示) */
#view-seats.view, #view-checkout.view { max-width: min(1500px, 96vw); }
.co-room { grid-template-columns: 11em 8em 1fr auto; padding: 16px 22px; }
.co-room__why { font-size: 1.05rem; }
.co-cal__cell { min-height: 96px; }
.co-cal__day { font-size: 1.2rem; }
.co-cal__time { font-size: 1.5rem; }
.co-cal__why { font-size: .85rem; }

/* 10時・11時の2択 */
.co-pick { font: inherit; font-size: 1.4rem; font-weight: 800; min-width: 96px; padding: 12px 22px; border-radius: 12px; border: 1px solid rgba(201,169,110,.4); background: rgba(255,255,255,.05); color: inherit; cursor: pointer; }
.co-pick.is-on { background: #c47b3e; border-color: #ffd28a; color: #fff; }
.co-manual { font-size: .9rem; color: #ffd28a; white-space: nowrap; }
button.co-cal__cell { font: inherit; color: inherit; cursor: pointer; width: 100%; }
button.co-cal__cell:active { transform: scale(.97); }
.co-cal__hol { font-size: .8rem; color: #ff8f8f; min-height: 1.05em; line-height: 1.05; text-align: center; font-weight: 700; }
.co-cal__cell { min-height: 110px; }
.co-del { position: relative; overflow: hidden; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.co-del__cap { position: relative; pointer-events: none; }
.co-del__fill { position: absolute; inset: 0; background: rgba(196, 70, 62, .75); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.co-del.is-holding .co-del__fill { transition: transform 1.5s linear; transform: scaleX(1); }

/* お支払い・割引(2026-10-27にご指示): ポイント・クーポンと、事前決済を色で分けて見せる */
.day-pay { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: #f7f2ea; }
.day-pay__label { margin: 0 0 4px; font-size: 0.95rem; color: #7a4a2f; font-weight: 700; }
.day-pay__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.day-pay__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 1.1rem; line-height: 1.4; }
.day-pay__kind { font-size: 0.85rem; padding: 1px 8px; border-radius: 6px; color: #fff; white-space: nowrap; }
.day-pay__item--discount .day-pay__kind { background: #2f7d4a; }
.day-pay__item--prepaid .day-pay__kind { background: #2f5f9e; }
.day-pay__item--onsite .day-pay__kind { background: #8a7a68; }
.day-pay__item--unknown .day-pay__kind { background: #b5532f; }
.day-pay__name { font-weight: 700; color: #2b2622; }
.day-pay__amount { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: #2b2622; }

/* グループと思われるお客様(2026-10-27にご指示)。同じグループは同じ色。色は厨房モニターと同じ並び */
.day-card--group { border-left: 10px solid var(--grp, #999); background: color-mix(in srgb, var(--grp, #999) 16%, #fff); }
.day-card--g0 { --grp: #6f9fdc; } .day-card--g1 { --grp: #e47fa3; } .day-card--g2 { --grp: #6cbf6c; }
.day-card--g3 { --grp: #a585e6; } .day-card--g4 { --grp: #ef9a55; } .day-card--g5 { --grp: #4fbcc4; }
.day-card--g6 { --grp: #e5746a; } .day-card--g7 { --grp: #d6bd3c; } .day-card--g8 { --grp: #cf72cf; } .day-card--g9 { --grp: #8d9a5b; }
.day-badge--group { background: var(--grp, #999); color: #fff; }

/* ===== 食事処の4人席が4つ埋まった日(2026-11-16 オーナー指示) =====
   お問い合わせの時に「この日はもう3名・4名様は取れません」を大きな赤字で。
   カレンダーの日付の見出しは赤く塗る */
.avail-row--head .avail-cell--day.is-seat-full { background: #c62828; color: #fff; }
.avail-row--head .avail-cell--day.is-seat-full .avail-day__dow { color: #fff; }
.seat-full-warn {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 0 4px; padding: 14px 18px;
  background: #fff1f1; border: 4px solid #d32f2f; border-radius: 12px;
  color: #c62828; text-align: center;
}
.seat-full-warn strong { font-size: 30px; font-weight: 900; line-height: 1.3; }
.seat-full-warn span { font-size: 16px; font-weight: 700; color: #b71c1c; }
.price-popup-card .seat-full-warn { margin: 8px 12px; flex: 0 0 auto; }
