/* 備品管理の見た目。手本は社内の請求システム(system.y-cs.biz): 左に濃紺のメニュー(区分見出しつき)、上に白い帯、
   中身は丸い白い箱。主ボタンは大きな青。一覧は行ごとに アイコン・番号/日付・名前・担当・状態のピル。印に絵文字は使わない */
:root {
  /* 色は請求システム(Tailwind slate / blue-600)に合わせる */
  --bg: #f4f6fa; --panel: #fff; --line: #e2e8f0; --line2: #cbd5e1; --text: #0f172a; --muted: #64748b;
  --accent: #2563eb; --accent-h: #1d4fd8; --accent-bg: #e8effd; --accent-bg2: #dbe6fc;
  --ok: #15803d; --ok-bg: #e7f6ec; --ng: #c2410c; --ng-bg: #fdeee6; --red: #b91c1c; --warn: #b45309; --warn-bg: #fef3dd;
  --side: 232px; --side-bg: #0f172a; --side-fg: #cbd5e1; --side-on: #2563eb; --r: 8px; --rr: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 14.5px; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 入力欄 ---------- */
input, select, textarea { border: 1px solid var(--line2); border-radius: var(--r); padding: 9px 12px; background: #fff; min-height: 42px; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #b4bdcc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input::placeholder, textarea::placeholder { color: #9aa3b1; }
input:disabled, select:disabled, textarea:disabled { background: #f4f6fa; color: var(--muted); }
input[type=number] { width: 7em; text-align: right; font-variant-numeric: tabular-nums; }
input[type=date] { width: 11em; }
input[type=search] { padding-left: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b1' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 11px center / 16px; }
textarea { min-height: 88px; width: 100%; resize: vertical; line-height: 1.6; }
select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7686' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; margin: 0 8px 0 0; padding: 0; accent-color: var(--accent); vertical-align: -4px; box-shadow: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; user-select: none; color: var(--text); font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch .knob { width: 40px; height: 22px; border-radius: 11px; background: #cdd3dc; position: relative; flex: none; transition: background .15s; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { left: 20px; }
.switch input:focus-visible + .knob { box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.switch input:disabled + .knob { opacity: .5; }
.ig { display: inline-flex; align-items: stretch; }
.ig > span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line2); background: #f4f6fa; color: var(--muted); font-size: 14px; white-space: nowrap; }
.ig > span:first-child { border-right: 0; border-radius: var(--r) 0 0 var(--r); }
.ig > span:last-child { border-left: 0; border-radius: 0 var(--r) var(--r) 0; }
.ig > input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ig > input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ig > input:focus { position: relative; z-index: 1; }

/* ---------- ボタン ---------- */
button { border: 1px solid var(--line2); background: #fff; border-radius: var(--r); padding: 0 16px; min-height: 42px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; transition: background .12s, border-color .12s; }
button:hover { background: #f4f6fa; border-color: #b4bdcc; }
button.pri { background: var(--accent); color: #fff; border-color: var(--accent); }
button.pri:hover { background: var(--accent-h); border-color: var(--accent-h); }
button.danger { background: var(--red); color: #fff; border-color: var(--red); }
button.ghost { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
button.big { min-height: 48px; padding: 0 22px; font-size: 15.5px; font-weight: 600; border-radius: 10px; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
button.link { border: 0; background: none; color: var(--accent); padding: 0 6px; min-height: 36px; box-shadow: none; }
button.link:hover { text-decoration: underline; background: none; }
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
a > button { pointer-events: auto; }

/* ---------- 左のメニュー ---------- */
.side { width: var(--side); flex: none; background: var(--side-bg); color: var(--side-fg); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 12px 12px; }
.side .brand { padding: 22px 12px 18px; font-weight: 700; color: #fff; font-size: 17px; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.side .brand .i { width: 22px; height: 22px; color: #7fa3ff; }
.side .sec { font-size: 11.5px; color: #7c889e; letter-spacing: .08em; padding: 14px 12px 6px; }
.side a { display: flex; align-items: center; gap: 12px; color: var(--side-fg); padding: 0 12px; min-height: 44px; border-radius: 10px; margin-bottom: 2px; font-weight: 500; }
.side a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.side a.on { background: var(--side-on); color: #fff; }
.side a .i { width: 19px; height: 19px; }
.side a .badge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.side .bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side button.out { width: 100%; justify-content: flex-start; gap: 12px; background: none; border: 0; color: var(--side-fg); padding: 0 12px; min-height: 44px; border-radius: 10px; }
.side button.out:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side button.out .i { width: 19px; height: 19px; }

/* ---------- 上の帯と中身 ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; gap: 10px; position: sticky; top: 0; z-index: 10; }
.top .where { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #2b3445; letter-spacing: .04em; font-size: 14px; }
.top .where .i { color: var(--muted); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; text-align: right; }
.top .who .nm { font-weight: 600; font-size: 14px; line-height: 1.2; }
.top .who .rl { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
.top .av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
main { padding: 26px 28px 60px; flex: 1; }

/* 見出しの帯: アイコン・大きい見出し・1行の説明。右に主ボタン */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.head h1 .i { width: 24px; height: 24px; color: var(--accent); }
.head .sub { font-size: 13.5px; color: var(--muted); margin: 6px 0 0 34px; }
.head .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.saved { font-size: 13px; font-weight: 400; color: var(--ok); }
.saved.ng { color: var(--ng); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.hold { color: var(--warn); white-space: nowrap; } .hold svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.small { font-size: 12.5px; }
.lbl { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 8px; line-height: 1.5; }
.muted { color: var(--muted); } .r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; }
.ng { color: var(--ng); } .ok { color: var(--ok); } .warn { color: var(--warn); }
.empty { color: var(--muted); padding: 10px 0; }
.empty.big { padding: 32px 12px; text-align: center; font-size: 15px; }

/* 箱 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rr); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .sp, .sp { flex: 1; }
.bar.box { background: #fff; border: 1px solid var(--line); border-radius: var(--rr); padding: 12px 14px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 表 ---------- */
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; font-size: 12.5px; color: var(--muted); background: #fafbfd; white-space: nowrap; }
td.r, th.r { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fd; }
tr.dim td { color: var(--muted); }
tr.late td { background: #fff8f4; }
table input, table select { min-height: 36px; padding: 4px 8px; }
table select { padding-right: 28px; background-position: right 6px center; }
table input[type=number] { width: 5.5em; }
.tbl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rr); overflow: auto; margin-bottom: 16px; box-shadow: var(--shadow); }
.tbl table { border: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.small { margin-bottom: 14px; } .tbl.small td, .tbl.small th { padding: 6px 10px; font-size: 14px; }
tr.cat td { background: #f1f4f9; font-weight: 600; font-size: 13px; color: #3b4556; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; background: #eef1f5; margin-left: 6px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.ext { margin-top: 4px; font-size: 12.5px; }
.ext a { display: inline-flex; align-items: center; gap: 4px; }

/* 一覧の行(手本: 種別アイコン・番号/日付・名前・担当・状態) */
.lrows { background: #fff; border: 1px solid var(--line); border-radius: var(--rr); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.lrow { display: grid; grid-template-columns: 56px 150px 1fr 150px 160px auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lrow .c5 input[type=date] { width: 100%; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: #f7f9fd; }
.lrow.hd { background: #fafbfd; cursor: default; padding: 10px 20px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lrow.hd:hover { background: #fafbfd; }
.lgroup { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #f3f6fb; border-bottom: 1px solid var(--line); font-size: 14px; }
.lgroup a { color: inherit; } .lgroup .sp { flex: 1; }
.tile { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile .i { width: 20px; height: 20px; }
.tile.ok { background: var(--ok-bg); color: var(--ok); } .tile.warn { background: var(--warn-bg); color: var(--warn); } .tile.ng { background: var(--ng-bg); color: var(--ng); } .tile.mute { background: #eef1f5; color: var(--muted); }
.lrow .no { font-weight: 700; font-variant-numeric: tabular-nums; }
.lrow .dt { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.lrow .dt .i { width: 13px; height: 13px; }
.lrow .nm { font-weight: 700; font-size: 15px; }
.lrow .nm2 { color: var(--muted); font-size: 13px; margin-top: 3px; }
.lrow .who { display: flex; align-items: center; gap: 6px; color: #3b4556; }
.lrow .who .i { color: var(--muted); }
.lrow .amt { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.lrow .acts { display: flex; gap: 6px; justify-content: flex-end; }

/* 状態のピル(同じ並び・同じ幅)。select のときは押して変えられる */
.st { display: inline-flex; align-items: center; justify-content: center; min-width: 5.5em; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
select.st { appearance: none; min-height: 32px; padding-right: 26px; cursor: pointer; background-position: right 8px center; background-size: 14px; }
.st-問い合わせ { background: #fff; border-color: var(--line2); color: var(--muted); }
.st-見積中 { background: #eef1f5; color: #3b4556; }
.st-受注 { background: var(--accent-bg); color: var(--accent); }
.st-貸出中 { background: var(--warn-bg); color: var(--warn); }
.st-返却済 { background: var(--ok-bg); color: var(--ok); }
.st-請求済 { background: #efe9fb; color: #5b3fa3; }
.st-入金済 { background: #e5e7eb; color: #374151; }
.st-キャンセル { background: #fff; color: var(--muted); text-decoration: line-through; border-color: var(--line2); }
.st-発行 { background: var(--warn-bg); color: var(--warn); }
.st-取消 { background: #fff; color: var(--muted); text-decoration: line-through; border-color: var(--line2); }

/* 項目名と欄 */
.form { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px 14px; align-items: start; }
.form > label { color: var(--muted); font-size: 13px; padding-top: 12px; line-height: 1.3; }
.form input:not([type=number]):not([type=date]):not([type=checkbox]), .form select { width: 100%; }
.form .ig input { width: auto; }
.form .full { grid-column: 1 / -1; }
.form .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 42px; }

/* 段階の表示(読むだけ) */
.steps { list-style: none; display: flex; padding: 14px 18px; margin: 0 0 16px; flex-wrap: wrap; gap: 4px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--rr); box-shadow: var(--shadow); }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 4px 18px 4px 6px; position: relative; }
.steps li + li::before { content: ''; position: absolute; left: -12px; top: 50%; width: 18px; height: 2px; background: var(--line); }
.steps li i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line2); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; background: #fff; font-weight: 600; }
.steps li i .i { width: 13px; height: 13px; stroke-width: 2.5; }
.steps li.done { color: var(--text); }
.steps li.done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done + li::before { background: var(--accent); }
.steps li.now { color: var(--accent); font-weight: 700; }
.steps li.now i { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.steps.canceled li.now:not(.cancel) { color: var(--muted); font-weight: 400; } .steps.canceled li.now:not(.cancel) i { box-shadow: none; color: var(--muted); border-color: var(--line2); }
.steps li.cancel.now { color: var(--red); } .steps li.cancel.now i { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 0 16px; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 600; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { background: #e5e7eb; color: var(--text); border-radius: 10px; padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center; }
.tabs .n.warn { background: var(--warn-bg); color: var(--warn); }

/* 絞り込みの粒 */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; background: #fff; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 数の帯(明細の下) */
.foot { position: sticky; bottom: 0; background: #fafbfd; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 28px; justify-content: flex-end; font-size: 14px; margin: 0 -20px -18px; border-radius: 0 0 var(--rr) var(--rr); }
.foot b { font-size: 17px; }
.kpi { display: flex; gap: 28px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.kpi b { color: var(--text); font-size: 18px; margin: 0 2px; }

/* ホームの並び */
.rows .rw { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.rows .rw:last-child { border-bottom: 0; }
.rw-main { flex: 1; min-width: 0; color: inherit; padding: 6px 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.rw-main:hover { text-decoration: none; color: var(--accent); }
.rw-main .l2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; min-height: 44px; }
.list a:last-child { border-bottom: 0; }
.list a:hover { text-decoration: none; color: var(--accent); }
.list .l2 { font-size: 13px; color: var(--muted); }

/* ダイアログ */
.modal { position: fixed; inset: 0; background: rgba(15, 26, 51, .5); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.dlg { background: #fff; border-radius: 14px; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px 18px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); }
.dlg.wide { max-width: 760px; }
.dlg h2 { font-size: 18px; margin-bottom: 16px; }
.dlg .dform { grid-template-columns: 9.5em 1fr; }
.dlg .dform label em { color: var(--red); font-style: normal; margin-left: 2px; }
.dlg .static { padding-top: 10px; }
.dlg .err { color: var(--red); background: var(--ng-bg); padding: 8px 12px; border-radius: var(--r); margin-top: 12px; font-size: 14px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 20px; }
.dlg-links { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.dlg-links a.off { color: var(--muted); pointer-events: none; }

/* 備品を選ぶ */
.picker { max-width: 840px; display: flex; flex-direction: column; }
.plist { overflow: auto; flex: 1; min-height: 200px; max-height: 60vh; border: 1px solid var(--line); border-radius: var(--rr); }
.pcat { background: #f1f4f9; font-weight: 600; font-size: 13px; padding: 6px 14px; position: sticky; top: 0; color: #3b4556; }
.prow { display: grid; grid-template-columns: 1fr 9em 8em auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow .pname { font-weight: 600; }
.prow .pav b { font-size: 16px; }
.prow .pprice { text-align: right; white-space: nowrap; font-weight: 600; }
.prow .padd { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.prow .padd input { width: 4.5em; min-height: 36px; padding: 4px 6px; }

/* 稼働表 */
.sched { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--rr); box-shadow: var(--shadow); }
.sched table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sched th, .sched td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid #f0f2f6; height: 40px; }
.sched th.name, .sched td.name { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 260px; max-width: 320px; padding: 4px 12px; white-space: normal; border-right: 1px solid var(--line); font-weight: 500; font-size: 13px; }
.sched th.day { min-width: 34px; width: 34px; text-align: center; font-size: 11px; font-weight: 500; position: sticky; top: 0; background: #fafbfd; z-index: 2; }
.sched th.day.sat { color: var(--accent); } .sched th.day.sun { color: var(--red); } .sched th.day.today { background: var(--accent-bg); }
.sched th.name { z-index: 3; top: 0; }
.sched td.day { text-align: center; font-size: 12px; cursor: default; }
.sched td.day.today { background: #f3f7fe; }
.sched td.cat { background: #f1f4f9; font-weight: 600; font-size: 13px; padding: 4px 12px; position: sticky; left: 0; }
.sched td.day.u1 { background: #dbe7f9; color: #1f3f7a; cursor: pointer; }
.sched td.day.u2 { background: #b9cff2; color: #14305f; cursor: pointer; }
.sched td.day.full { background: #f7d7b4; color: #6b3f00; font-weight: 600; cursor: pointer; }
.sched td.day.over { background: #f3b3ab; color: #7a1d14; font-weight: 700; cursor: pointer; }
.sched td.day.tent { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(0,0,0,.08) 4px 6px); cursor: pointer; }
.legend { gap: 16px; font-size: 13px; color: var(--muted); }
.legend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 3px; vertical-align: -3px; margin-right: 5px; border: 1px solid #eef0f3; }
.legend .sw.u1 { background: #dbe7f9; } .legend .sw.u2 { background: #b9cff2; } .legend .sw.full { background: #f7d7b4; } .legend .sw.over { background: #f3b3ab; }
.legend .sw.tent { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(0,0,0,.12) 4px 6px); }

/* 通知 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b2432; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: 80vw; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.ng { background: var(--red); }
.desc { white-space: pre-line; line-height: 1.6; }

/* ---------- スマホ: 左のメニューを上の帯に(横に流れる) ---------- */
@media (max-width: 800px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; align-items: center; padding: 0 6px; gap: 2px; }
  .side .brand { padding: 10px 10px; font-size: 14px; white-space: nowrap; }
  .side .sec { display: none; }
  .side a { flex: none; flex-direction: column; gap: 3px; font-size: 11px; min-height: 54px; padding: 6px 10px; margin: 0; border-radius: 8px; }
  .side a .badge { margin: 0; position: absolute; }
  .side a.on { background: none; color: #fff; box-shadow: inset 0 -3px 0 #7fa3ff; border-radius: 0; }
  .side .bottom { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side button.out { min-height: 54px; flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 10px; }
  .top { height: 48px; padding: 0 14px; }
  .top .who .nm, .top .who .rl { display: none; } .top .av { width: 32px; height: 32px; font-size: 13px; }
  main { padding: 14px 12px 40px; }
  .head h1 { font-size: 20px; }
  .head .acts { width: 100%; } .head .acts .pri { flex: 1; }
  .form, .dlg .dform { grid-template-columns: 1fr; gap: 4px 0; }
  .form > label, .dlg .dform > label { padding-top: 8px; }
  .form > div, .form > input, .form > select, .form > textarea { margin-bottom: 6px; }
  .modal { align-items: flex-end; padding: 0; }
  .dlg { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .prow { grid-template-columns: 1fr auto; } .prow .pprice { grid-column: 1; text-align: left; } .prow .padd { grid-column: 2; grid-row: 1 / span 3; }
  .lrow { grid-template-columns: 44px 1fr auto; gap: 8px 12px; padding: 12px 14px; }
  .lrow .tile { width: 36px; height: 36px; }
  .lrow .c2 { grid-column: 2; } .lrow .c3 { grid-column: 2; } .lrow .c4, .lrow .c5 { grid-column: 2; } .lrow .c6 { grid-column: 3; grid-row: 1; }
  .lrow.hd { display: none; }
  .steps { padding: 10px 12px; } .steps li { padding: 4px 12px 4px 4px; font-size: 12px; }
  .grid2 { gap: 12px; }
  .foot { gap: 14px; font-size: 13px; margin: 0 -14px -14px; padding: 10px 14px; }
  .panel { padding: 14px; }
}
@media print { .side, .top, .toast { display: none; } main { padding: 0; } }

/* ---------- 協力金の請求(taisha-bus)で足したもの ---------- */
/* バスの状態 */
.st-予定 { background: #fff; border-color: var(--line2); color: var(--muted); }
.st-来なかった { background: var(--warn-bg); color: var(--warn); }
/* 請求書の渡し方 */
.st-未渡し { background: #fff; border-color: var(--line2); color: var(--muted); }
.st-手渡し { background: var(--ok-bg); color: var(--ok); }
.st-郵送, .st-メール, .st-FAX { background: var(--accent-bg); color: var(--accent); }
/* 期間の段階 */
.st-予約の取り込み { background: #fff; border-color: var(--line2); color: var(--muted); }
.st-請求書の発行 { background: var(--accent-bg); color: var(--accent); }
.st-入金 { background: var(--warn-bg); color: var(--warn); }
.st-完了 { background: #e5e7eb; color: #374151; }
.st-一部入金 { background: var(--warn-bg); color: var(--warn); }
/* ログインの箱(メニューなし) */
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { font-size: 22px; margin-bottom: 18px; }
.login .form { grid-template-columns: 1fr; gap: 6px 0; }
.login .form > label { padding-top: 6px; }
.login button.pri { width: 100%; margin-top: 14px; }
.login .err { color: var(--red); background: var(--ng-bg); padding: 8px 12px; border-radius: var(--r); margin-top: 12px; font-size: 14px; }
.login .dev { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.login .dev button { margin: 4px 4px 0 0; }
/* 気になることの箱 */
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.alert:last-child { border-bottom: 0; }
.alert .i { color: var(--warn); }
.alert .sp { flex: 1; }
/* 一覧の中の日付の見出し行(その日の操作つき) */
.dayhd { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #f3f6fb; border-bottom: 1px solid var(--line); font-weight: 600; }
.dayhd .sp { flex: 1; }
.dayhd .n { color: var(--muted); font-weight: 400; font-size: 13px; }
table select.st { min-width: 7em; }
/* 請求先を選ぶ(ダイアログの中の検索つきの一覧) */
.pick input[type=search] { width: 100%; margin-bottom: 8px; }
.pick .plist { max-height: 40vh; }
.pick .prow { grid-template-columns: 1fr auto; cursor: pointer; min-height: 44px; }
.pick .prow:hover, .pick .prow.on { background: var(--accent-bg); }
.pick .prow .sub { color: var(--muted); font-size: 12.5px; }
.pick .chosen { margin-top: 8px; font-weight: 600; }
/* 結果の表(取り込みの結果など) */
.kv2 { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv2 b { font-size: 16px; }
.temp { font-family: Consolas, "Courier New", monospace; font-size: 22px; letter-spacing: .06em; background: #f4f6fa; padding: 10px 14px; border-radius: var(--r); display: inline-block; margin: 6px 0; }
[hidden] { display: none !important; }
/* 中くらいの幅(タブレット・狭い窓): 行カードの列を詰める */
@media (min-width: 801px) and (max-width: 1180px) {
  .lrow { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .lrow .tile { width: 36px; height: 36px; grid-row: 1 / span 3; }
  .lrow .c2 { grid-column: 2; } .lrow .c3 { grid-column: 2; } .lrow .c4, .lrow .c5 { grid-column: 2; text-align: left; } .lrow .c6 { grid-column: 3; grid-row: 1; }
  .lrow.hd { display: none; }
}
