/* 勤務時間・残業代の計算（ZQT Lab.） 色と部品はシフト表ツールに合わせる */
:root {
  --ink: #1d2733;
  --ink-soft: #4a5866;
  --navy: #1e3a5c;
  --navy-deep: #132a45;
  --gold: #b9893f;
  --gold-pale: #f6ecda;
  --bg: #faf8f4;
  --tint: #eef2f6;
  --line: #d9dfe6;
  --white: #ffffff;
  --red: #b23b3b;
  --red-pale: #fbe6e4;
  --green: #2f7d5b;
  --hol: #fdf1ef;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.75; font-size: 15px; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.print-only { display: none; }
[hidden] { display: none !important; }

/* 見出し */
.top { padding: 36px 0 18px; }
.kicker { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .12em; margin: 0 0 2px; }
.top h1 { font-family: var(--serif); font-size: 26px; line-height: 1.4; margin: 0 0 12px; color: var(--navy-deep); word-break: auto-phrase; }
.h1-sub { display: block; font-size: 16px; color: var(--ink-soft); font-family: var(--font); font-weight: 700; margin-top: 4px; }
.lead { color: var(--ink-soft); max-width: 52em; }
.lead strong { color: var(--ink); background: linear-gradient(transparent 62%, var(--gold-pale) 62%); }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: st; }
.steps li { counter-increment: st; }
.steps a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 4px; color: var(--ink); transition: border-color .2s, transform .2s; }
.steps a::before { content: counter(st); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; }
.steps a:hover { border-color: var(--navy); transform: translateY(-1px); }

/* 見本の帯 */
.sample-bar { display: flex; flex-direction: column; gap: 10px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; }
.sample-bar.is-sample { border-left-color: var(--gold); background: #fffaf1; }
.sample-bar p { margin: 0; font-size: 14px; }
.sample-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* カード */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; margin: 0 0 18px; min-width: 0; scroll-margin-top: 12px; }
.card h2 { font-size: 19px; color: var(--navy-deep); display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.card h2 .no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; flex: none; }
.h3 { font-size: 16px; color: var(--navy-deep); margin: 22px 0 6px; }
.h3.first { margin-top: 4px; }
.h3.red { color: var(--red); }
.lead-s { color: var(--ink-soft); font-size: 14px; }
.note { color: var(--ink-soft); font-size: 13px; margin: 6px 0 8px; }
.note.warn { color: #7a5212; background: var(--gold-pale); border-radius: 8px; padding: 6px 10px; }
.caution { font-size: 13px; color: #7a5212; background: var(--gold-pale); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }

/* 入力欄 */
.form-row { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 12px 0; }
.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld > span { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.fld-wide { flex: 1 1 260px; max-width: 460px; }
.f-sel { flex: 0 1 230px; }
input[type="text"], input[type="number"], input[type="month"], select, textarea {
  width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #c6ced8; border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 8px 10px; font-family: ui-monospace, Consolas, "Meiryo", monospace; font-size: 13px; resize: vertical; tab-size: 6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 92, .18); }
.month-pick { display: flex; align-items: center; gap: 6px; }
.month-pick input { width: 170px; }
.btn-icon { width: 40px; height: 40px; border-radius: 8px; border: 1px solid #c6ced8; background: #fff; cursor: pointer; color: var(--navy); flex: none; }
.btn-icon:hover { background: var(--tint); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid #c6ced8; border-radius: 999px; background: #fff; cursor: pointer; font-size: 14px; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(30, 58, 92, .25); }

.rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfb; min-width: 0; animation: rowIn .3s ease; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.f-name { flex: 1 1 160px; }
.f-wage { width: 130px; }
.row .mini { font-size: 13px; color: var(--ink-soft); height: 40px; display: inline-flex; align-items: center; }
.btn-del { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #e0c4c1; background: #fff; color: var(--red); cursor: pointer; font-size: 13px; margin-left: auto; }
.btn-del:hover { background: var(--red-pale); }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; cursor: pointer; border: 2px solid var(--navy); transition: background .2s, color .2s, transform .15s, box-shadow .2s; text-align: center; line-height: 1.3; }
.btn:active { transform: scale(.97); }
.btn-main { background: var(--navy); color: #fff; }
.btn-main:hover { background: var(--navy-deep); }
.btn-sub { background: #fff; color: var(--navy); }
.btn-sub:hover { background: var(--tint); }
.btn-s { min-height: 36px; font-size: 13px; padding: 0 14px; }
.btn-warn { border-color: #d8b2ae; color: var(--red); }
.btn-warn:hover { background: var(--red-pale); }
.card-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* スタッフの切り替え */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tab { display: inline-flex; flex-direction: column; align-items: flex-start; min-height: 44px; padding: 4px 14px; border: 1px solid #c6ced8; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; line-height: 1.3; transition: background .15s, border-color .15s, transform .15s; }
.tab:hover { border-color: var(--navy); transform: translateY(-1px); }
.tab b { font-size: 14px; }
.tab small { font-size: 11px; color: var(--ink-soft); }
.tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab.on small { color: #d6e0ec; }

/* 表 */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
.tbl { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th, .tbl td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; text-align: center; white-space: nowrap; }
.tbl tr > *:last-child { border-right: none; }
.tbl tbody tr:last-child > *, .tbl tfoot tr:last-child > * { border-bottom: none; }
.tbl thead th { background: var(--tint); font-weight: 700; color: var(--navy-deep); padding: 4px 8px; line-height: 1.3; }
.tbl thead th small { display: block; font-size: 10px; font-weight: 400; }
.tbl th.name { position: sticky; left: 0; z-index: 2; background: #f6f7f8; text-align: left; padding: 4px 10px; min-width: 104px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; box-shadow: 1px 0 0 var(--line); }
.tbl thead th.name { background: var(--tint); }
.w0 .dn, .w0 .dw { color: #b13d3d; }
.w6 .dn, .w6 .dw { color: #2a5d9a; }

/* 日ごとの表 */
.days { width: 100%; }
.days th.name { min-width: 56px; padding: 2px 8px; }
.days th.name b { font-size: 14px; }
.days th.name small { font-size: 11px; font-weight: 400; margin-left: 4px; }
.days tr.hol > * { background: var(--hol); }
.days tr.hol th.name { background: #f9e4e0; }
.days tr.wk > * { border-top: 2px solid #b9c3ce; }
.days tbody tr:first-child > * { border-top: none; }
.days td.in { position: relative; padding: 2px; }
.days input.t { width: 70px; height: 32px; padding: 0 4px; text-align: center; border-color: transparent; background: transparent; border-radius: 6px; }
.days input.t.b { width: 56px; }
.days input.t:hover { border-color: #c6ced8; background: #fff; }
.days input.t:focus { background: #fff; }
.days td.bad input.t { box-shadow: inset 0 0 0 2px var(--red); background: var(--red-pale); }
.days .next { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); font-size: 11px; line-height: 1; padding: 2px 3px; border-radius: 4px; font-weight: 700; color: #fff; background: var(--gold); pointer-events: none; }
.days td.c { min-width: 58px; padding: 0 8px; color: #9aa3ad; font-variant-numeric: tabular-nums; }
.days td.c.v { color: var(--ink); }
.days td.c.ot.v { color: #8a5a12; font-weight: 700; }
.days td.c.nt.v { color: #4b3a8a; font-weight: 700; }
.days td.c.hd.v { color: var(--red); font-weight: 700; }
.days td.c.upd { animation: upd .5s ease; }
@keyframes upd { 0% { background: var(--gold-pale); } 100% { background: transparent; } }
.days td.plan { font-size: 12px; color: var(--ink-soft); padding: 0 8px; min-width: 96px; }
.days.no-plan .col-plan { display: none; }
.days tfoot th, .days tfoot td { background: #fafbfc; font-weight: 700; border-top: 2px solid #c6ced8; padding: 6px 8px; }
.days tfoot td.c { color: var(--ink); }

/* 取り込み */
.imp { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 8px; }
.imp summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 6px 0; }

/* 集計 */
.sum { width: 100%; }
.sum th, .sum td { padding: 6px 10px; font-variant-numeric: tabular-nums; }
.sum td.num { text-align: right; }
.sum td.ot { color: #8a5a12; font-weight: 700; }
.sum td.over60 { background: var(--red-pale); color: var(--red); }
.sum td.zero { color: #b3bac1; }
.sum tfoot tr > * { border-top: 2px solid #c6ced8; font-weight: 700; background: #fafbfc; }
.sum td.tot { font-weight: 700; color: var(--navy-deep); }
.sum.pop tbody tr { animation: rowPop .4s ease both; }
.sum.pop tbody tr:nth-child(2) { animation-delay: .05s; }
.sum.pop tbody tr:nth-child(3) { animation-delay: .1s; }
.sum.pop tbody tr:nth-child(n+4) { animation-delay: .15s; }
@keyframes rowPop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty-row td { padding: 18px 10px; color: var(--ink-soft); }
.out-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--navy); }
.warn-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.warn-list li { font-size: 14px; border-left: 3px solid var(--red); padding: 2px 10px; }
.warn-list li.info { border-left-color: var(--gold); }

/* 使い方・よくある質問 */
.how { margin: 0; padding-left: 1.4em; color: var(--ink-soft); font-size: 14px; }
.how li { margin: 4px 0; }
.faq dl { margin: 0; }
.faq dt { font-weight: 700; margin-top: 12px; color: var(--navy-deep); }
.faq dt::before { content: "Q. "; color: var(--gold); }
.faq dd { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }

/* 下の導線（控えめ） */
.foot { padding: 18px 0 28px; font-size: 12px; color: var(--ink-soft); text-align: center; }
.foot p { margin: 0; }

/* 確認と通知 */
.dlg { border: none; border-radius: 14px; padding: 22px 20px 18px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(19, 42, 69, .3); color: var(--ink); }
.dlg::backdrop { background: rgba(19, 42, 69, .45); }
.dlg[open] { animation: dlgIn .2s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); max-width: calc(100vw - 32px); background: var(--navy-deep); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .wrap { padding: 0 24px; }
  .top { padding: 52px 0 24px; }
  .top h1 { font-size: 34px; }
  .h1-sub { display: inline; font-size: 20px; margin-left: 6px; }
  .card { padding: 24px; }
  .sample-bar { flex-direction: row; align-items: center; justify-content: space-between; }
  .sample-btns { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-delay: 0s !important; }
}

/* 印刷: 1枚目に集計、日ごとの表は1人1枚（A4 縦） */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { background: #fff; font-size: 9pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print, .toast, .dlg { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .card { border: none; padding: 0; margin: 0; border-radius: 0; }
  .print-head h1, .pday h2 { font-size: 14pt; margin: 0 0 1mm; font-family: var(--serif); color: #000; }
  .print-head p, .pday p { font-size: 8pt; margin: 0 0 3mm; color: #333; }
  .h3 { font-size: 10pt; margin: 4mm 0 1.5mm; }
  .scroll { overflow: visible; border: 1px solid #999; border-radius: 0; margin: 0 0 2mm; }
  .tbl { width: 100%; font-size: 8pt; }
  .tbl th, .tbl td { border-color: #aaa; }
  .tbl th.name { position: static; box-shadow: none; max-width: none; }
  .sum th, .sum td { padding: 1mm 2mm; }
  .sum.pop tbody tr { animation: none; }
  .caution { font-size: 7.5pt; padding: 1.5mm 2.5mm; margin: 2mm 0; }
  .warn-list { gap: .6mm; }
  .warn-list li { font-size: 7.5pt; padding: 0 2mm; }
  .pday { break-before: page; }
  .pday .tbl { font-size: 8pt; }
  .pday th, .pday td { padding: .7mm 1.5mm; height: 6.4mm; }
  .pday tr.hol > * { background: #fbeeee; }
  .pday tr.wk > * { border-top: 1.5px solid #777; }
  .pday tfoot td, .pday tfoot th { font-weight: 700; border-top: 1.5px solid #777; }
  tr { break-inside: avoid; }
}
