/* 予約システム — 画面の見た目（利用する側・職員の共通） */
:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2433; --sub: #5b6475; --line: #dde1e8;
  --main: #1f6feb; --main-ink: #fff; --ok: #1a7f37; --warn: #b35900; --ng: #c62828;
  --req: #fff4d6; --conf: #dff3e4; --wait: #e8e4fb; --can: #f1f2f4; --dec: #fde7e7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif; }
header.bar { background: var(--main); color: var(--main-ink); padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.bar h1 { font-size: 1.05rem; margin: 0; flex: 1; }
header.bar button { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 560px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
p.sub, .sub { color: var(--sub); font-size: .9rem; }
label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: .92rem; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; margin: 4px 12px 4px 0; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time], input[type=number], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; }
input[type=number] { width: 6em; }
input[type=time] { width: 8em; }
input[type=checkbox] { width: 1.2em; height: 1.2em; }
button { font: inherit; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
button.primary { background: var(--main); color: var(--main-ink); border-color: var(--main); }
button.danger { color: var(--ng); border-color: var(--ng); }
button.small { padding: 4px 10px; font-size: .88rem; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.msg { padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.msg.info { background: #e8f1ff; }
.msg.warn { background: #fff4e0; color: #7a3e00; }
.msg.err { background: #fdecec; color: var(--ng); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button.on { background: var(--main); color: #fff; border-color: var(--main); }
.hidden { display: none !important; }

/* 利用する側の月のカレンダー */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: .8rem; color: var(--sub); }
.cal .wd.sat { color: #1f5fbf; } .cal .wd.sun { color: var(--ng); }
.cal .day { min-height: 64px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; text-align: left; font-size: .8rem; display: flex; flex-direction: column; gap: 2px; }
.cal .day .n { font-weight: 700; font-size: .95rem; }
.cal .day.closed { background: #eceef1; color: #9aa1ad; }
.cal .day.past { opacity: .55; }
.cal .day.blank { visibility: hidden; }
.cal .day.st-request { background: var(--req); }
.cal .day.st-confirmed { background: var(--conf); }
.cal .day.st-waiting { background: var(--wait); }
.cal .day.st-cancelled { background: var(--can); }
.cal .day.st-declined, .cal .day.st-askother { background: var(--dec); }
.cal .day.can { border-color: var(--main); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--sub); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: .9em; height: .9em; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .l-request::before { background: var(--req); } .legend .l-confirmed::before { background: var(--conf); }
.legend .l-waiting::before { background: var(--wait); } .legend .l-cancelled::before { background: var(--can); }
.legend .l-declined::before { background: var(--dec); }

/* 職員の月の予約表 */
.grid-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
table.grid th, table.grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 4px; text-align: center; white-space: nowrap; }
table.grid thead th { position: sticky; top: 0; background: #f0f3f8; z-index: 2; cursor: pointer; }
table.grid thead tr:nth-child(2) th { top: 44px; }
table.grid th.name { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; min-width: 8em; }
table.grid thead th.name { z-index: 3; background: #f0f3f8; }
table.grid td.c { min-width: 2.4em; cursor: pointer; }
table.grid td.closed, table.grid th.closed { background: #eceef1; color: #9aa1ad; }
table.grid td.st-request { background: var(--req); }
table.grid td.st-confirmed { background: var(--conf); }
table.grid td.st-waiting { background: var(--wait); }
table.grid td.st-cancelled { background: var(--can); color: var(--sub); }
table.grid td.st-declined, table.grid td.st-askother { background: var(--dec); }
table.grid td.mv::before { content: "変"; font-size: .6rem; color: #7a3e00; vertical-align: super; }
table.grid td.late::after { content: "後"; font-size: .65rem; color: var(--warn); vertical-align: super; }
table.grid .sat { color: #1f5fbf; } table.grid .sun { color: var(--ng); }
table.grid .over { color: var(--ng); font-weight: 700; }
table.grid tr.cnt th { font-weight: normal; font-size: .76rem; }
table.list { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.list th { background: #f0f3f8; }

/* 下から出る窓 */
.modal-back { position: fixed; inset: 0; background: rgba(20,24,33,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 14px 14px 0 0; padding: 16px; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 14px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.err { background: var(--ng); }
.tag { display: inline-block; font-size: .72rem; padding: 0 6px; border-radius: 6px; background: #e8f1ff; color: #1f4fa0; vertical-align: 1px; }
.ok { color: var(--ok); } .ng { color: var(--ng); }
tr.muted td { color: var(--sub); background: #fafbfc; }
.pre { white-space: pre-wrap; }
.card.inner { margin: 10px 0; padding: 10px 12px; background: #fafbfc; }
textarea { font: inherit; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 10px; background: var(--ng); color: #fff; font-size: .75rem; text-align: center; margin-left: 4px; }
.notice { border-left: 4px solid var(--main); padding: 8px 12px; margin: 10px 0; background: #f6f9ff; border-radius: 6px; }
.notice h3 { margin: 0 0 4px; }
.cal .day .vac { font-weight: 700; }
.cal .day.v-full .vac { color: var(--ng); } .cal .day.v-few .vac { color: var(--warn); } .cal .day.v-open .vac { color: var(--ok); }
table.vac td, table.vac th { text-align: center; padding: 2px 4px; font-size: .82rem; }
table.vac td.v-full { color: var(--ng); font-weight: 700; } table.vac td.v-few { color: var(--warn); font-weight: 700; } table.vac td.v-open { color: var(--ok); }
table.vac td.v-closed { background: #eceef1; color: #9aa1ad; }
@media print {
  header.bar, .tabs, .noprint, .toast { display: none !important; }
  body { background: #fff; font-size: 12px; }
  main { max-width: none; padding: 0; }
  .card { border: none; padding: 4px 0; margin: 0 0 8px; break-inside: avoid; }
  .list-step { break-inside: auto; }
  input[type=checkbox] { width: 1em; height: 1em; }
}
.moved { display: block; font-size: .7rem; color: #7a3e00; font-weight: 600; line-height: 1.2; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { padding: 8px 10px; }
.contact { border-top: 1px solid var(--line); padding: 10px 0; }
.contact:first-of-type { border-top: none; }
.contact .cname { font-weight: 700; }
a.btn { display: inline-block; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; margin: 6px 6px 0 0; }
a.btn.call { background: var(--main); color: #fff; }
a.btn.line { background: #06c755; color: #fff; }
.qrbox { margin-top: 8px; }
.qrbox summary { cursor: pointer; color: var(--main); font-size: .9rem; }
.qrbox img { display: block; width: 160px; height: 160px; object-fit: contain; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.qr-edit img { width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.code-big { font-size: 2rem; font-weight: 700; letter-spacing: .15em; text-align: center; padding: 12px; border: 2px dashed var(--main); border-radius: 10px; margin: 12px 0; font-family: Consolas, monospace; }
