/* 社員ページ：スマホ優先。管理画面と月の表（印刷）もここ */
:root {
  --bg: #eef3f8; --card: #fff; --text: #1c2430; --muted: #5b6676; --line: #d5dde7;
  --accent: #2f6fd6; --head: #1f2a3a;
  --a: #1f8a4c; --a-bg: #e3f4ea; --b: #9a6a00; --b-bg: #fff3d6; --c: #c2410c; --c-bg: #ffe6d9;
  --d: #b42318; --d-bg: #fde3e1; --e: #8f1239; --e-bg: #fbdbe6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; background: var(--head); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.top h1 { margin: 0; font-size: 18px; text-align: center; }
.top a, .top .who { color: #fff; text-decoration: none; font-size: 14px; }
.top .who { text-align: right; opacity: .85; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 8px; }
.lead { font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.muted, .small { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.date { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=time], select {
  font: inherit; font-size: 17px; color: var(--text); width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.btn { font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.big { font-size: 18px; padding: 14px; width: 100%; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; padding: 16px; cursor: pointer; }
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--a-bg); color: var(--a); font-weight: 700; }
.flash.ng { background: var(--d-bg); color: var(--d); }
.flash.pin { background: #fff3d6; color: #5c4100; font-weight: 400; }
.flash.pin b { font-size: 32px; letter-spacing: .15em; margin-left: 6px; }
code.key { font-size: 14px; background: #f1f4f8; padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* メニュー */
.tile { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; color: var(--text); text-decoration: none; }
.tile .ti-icon { font-size: 28px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #e8eef7; }
.tile .ti-body { display: grid; }
.tile b { font-size: 18px; }
.tile small { color: var(--muted); font-size: 14px; }
.tile.todo { border: 2px solid var(--d); }
.tile.todo small { color: var(--d); font-weight: 700; }
.tile.done .ti-icon { background: var(--a-bg); color: var(--a); }
.tile.disabled { opacity: .5; border-style: dashed; }
.tile.small { padding: 12px 16px; }
.tile.small b { font-size: 16px; }

/* 体調チェック */
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 700; margin-bottom: 8px; }
.rate, .sym { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 2px solid transparent; color: var(--text); cursor: pointer; font-size: 15px; }
.rate input, .sym input { position: absolute; opacity: 0; pointer-events: none; }
.rate b { font-size: 26px; width: 30px; text-align: center; }
.rA { background: var(--a-bg); } .rA b { color: var(--a); }
.rB { background: var(--b-bg); } .rB b { color: var(--b); }
.rC { background: var(--c-bg); } .rC b { color: var(--c); }
.rD { background: var(--d-bg); } .rD b { color: var(--d); }
.rE { background: var(--e-bg); } .rE b { color: var(--e); }
.rate:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.rate:has(input:checked)::after, .sym:has(input:checked)::after { content: "✓"; margin-left: auto; font-weight: 700; font-size: 20px; }
.sym { background: #fff; border: 1px solid var(--line); padding: 10px 14px; }
.sym b { width: 26px; height: 26px; border-radius: 50%; background: #e8eef7; display: grid; place-items: center; font-size: 14px; flex: none; }
.sym:has(input:checked) { border: 2px solid var(--accent); background: #eaf1fd; }
.sym:has(input:checked) b { background: var(--accent); color: #fff; }
.rate:has(input:focus-visible), .sym:has(input:focus-visible) { outline: 3px solid var(--accent); }
[hidden] { display: none !important; }

/* 管理 */
.adminnav { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.adminnav a { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; white-space: nowrap; font-size: 14px; }
.adminnav a.on { background: var(--head); color: #fff; border-color: var(--head); }
.daynav { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 18px; flex-wrap: wrap; }
.daynav a:not(.btn) { text-decoration: none; color: var(--accent); padding: 0 6px; font-size: 22px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 14px; }
table.list th, table.list td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { background: #f4f6fa; font-weight: 700; white-space: nowrap; }
table.list tr.warn td { background: #fffaf0; }
table.list tr.bad td { background: #fff1ec; }
table.list tr.miss td { background: #fff5f5; }
table.list tr.rest td { color: var(--muted); }
.lab { font-size: 18px; }
.miss-txt { color: var(--d); font-weight: 700; margin-right: 6px; }
form.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
form.inline input { font-size: 14px; padding: 6px 8px; min-width: 120px; flex: 1; }
@media (max-width: 600px) {
  table.list thead { display: none; }
  table.list tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); }
  table.list td { border: 0; padding: 4px 8px; }
  table.list td:nth-child(5) { grid-column: 1 / -1; }
}

/* 月の表（紙の様式に合わせる） */
.sheet { background: #fff; padding: 12px; overflow-x: auto; }
main:has(.sheet) { max-width: 1400px; }
.sh-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 8px; }
.sh-title { font-size: 22px; font-weight: 700; border: 2px double #333; padding: 6px 16px; }
.sh-co { font-size: 18px; border-bottom: 1px solid #333; padding: 0 24px; }
.sh-stamp { margin-left: auto; border-collapse: collapse; }
.sh-stamp th, .sh-stamp td { border: 1px solid #333; width: 64px; font-size: 12px; text-align: center; }
.sh-stamp td { height: 56px; }
.sh-grid { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
.sh-grid th, .sh-grid td { border: 1px solid #444; text-align: center; padding: 0; height: 24px; }
.sh-grid .nm { width: 84px; font-weight: 400; white-space: nowrap; }
.sh-grid .off { background: #bbb; }
.sh-grid td { white-space: nowrap; overflow: hidden; }
.sh-grid td.ng { font-weight: 700; color: #b42318; }
.sh-grid td.long { font-size: 8px; letter-spacing: -.05em; }
.sh-grid .rest { color: #888; font-size: 10px; }
.sh-foot { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; margin-top: 6px; }
.sh-legend { border-collapse: collapse; font-size: 11px; width: 100%; }
.sh-legend th, .sh-legend td { border: 1px solid #444; padding: 1px 4px; text-align: left; }
.sh-legend .v { writing-mode: vertical-rl; width: 22px; text-align: center; font-weight: 400; }
.sh-legend .n { width: 22px; text-align: center; }
.sh-act td { vertical-align: top; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .top, .noprint, .adminnav { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { padding: 0; overflow: visible; }
  .sh-grid .off { background: #bbb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
