/* 業務日報 — 見本 design/mock/nippo-mock-01-input.png（/）・nippo-mock-02-admin.png（/admin）を再現する。
   区切りごとに全幅の色の帯（紺・山吹・空色・若葉・藤）。スマホで押しやすく、文字は大きめ。 */
:root {
  --navy: #1f4e79;
  --navy-deep: #17324d;
  --navy-ink: #0f2a44;
  --yellow: #ffe08a;
  --yellow-ink: #4a3200;
  --sky: #cfe3f5;
  --green: #cfe8c9;
  --green-deep: #3f7a3a;
  --lilac: #ddd6f3;
  --red: #b3261e;
  --red-soft: #fde4e1;
  --orange-soft: #fff1d6;
  --orange-ink: #6b4100;
  --line: #8fa9c2;
  --white: #ffffff;
  --zebra: #eef1f5;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--navy-deep);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "YuGothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* 全幅の帯: 中身は中央の列のまま、色だけ画面の端まで伸ばす */
.notice,
.band,
.actions,
.filters,
.stats-band,
.table-band {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}

/* ── top: 紺の帯 ── */
header.top {
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, calc((100% - 720px) / 2)) 14px;
}
header.top h1 {
  margin: 0 auto 0 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
header.top span { font-size: 0.95rem; font-weight: 700; }
header.top form { margin: 0; }
header.top .btn {
  min-height: 44px;
  padding: 4px 6px;
  font-size: 0.95rem;
  background: transparent;
  color: var(--white);
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

main.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ── notice: 山吹の帯 ── */
.notice {
  --band: var(--yellow);
  color: var(--yellow-ink);
  margin: 0;
  padding: 14px 0;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.55;
}

/* ページの行き先（今日の日報・一覧など） */
main.page > nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 0;
}
main.page > nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}
main.page > nav a[aria-current="page"] { background: var(--navy); color: var(--white); }

main.page > h2 {
  margin: 14px 0 12px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy-ink);
  letter-spacing: 0.04em;
  line-height: 1.35;
}

h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; color: var(--navy-ink); }
a { color: var(--navy); }

/* ── カード ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border-left: 8px solid var(--navy);
  padding: 16px 18px;
  margin: 0 0 16px;
}
.card p { margin: 4px 0; }
form.card .btn-primary { width: 100%; margin-top: 4px; }
form.pick-date .btn-primary { margin-top: 12px; }
form.pick-date .hint { background: transparent; padding: 8px 0 0; }

/* ── report: 業務日・記録先（空色の帯） ── */
.report-meta { --band: var(--sky); padding: 0 0 18px; }
.meta-row {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.meta-row .label { margin: 0; font-size: 1.1rem; }
.meta-value {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-ink);
}
.report-meta input[type="date"],
.report-meta select { border-color: var(--navy); }

/* ── items: 業務の明細（若葉の帯） ── */
.items { --band: var(--green); padding: 22px 0 10px; }
.item {
  background: var(--white);
  border-radius: var(--radius);
  border-left: 10px solid var(--navy);
  padding: 14px 16px 10px;
  margin: 0 0 18px;
}
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.item-head h3 { margin: 0; font-size: 1.4rem; }
.item-foot { display: flex; justify-content: flex-end; }
.btn.btn-link {
  min-height: 44px;
  padding: 4px 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--navy);
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.item-pair { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.item-tips { margin: 4px 0 8px; }
.item-tips .hint { background: rgba(255, 255, 255, 0.6); }

/* ── 入力欄 ── */
.field { margin: 0 0 14px; }
label.label,
.label {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--navy-ink);
}
input[type="text"],
input[type="password"],
input[type="date"],
input:not([type]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  font-size: 18px; /* 16px 以上で iPhone が拡大しない */
  color: var(--navy-ink);
  background-color: var(--white);
  border: 2px solid var(--line);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 23px) 52%, calc(100% - 16px) 52%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
textarea[name^="supplement"] { min-height: 72px; }
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #f2b705;
  outline-offset: 1px;
  border-color: var(--navy);
}

/* 例・注意・エラー */
.hint {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-deep);
  font-size: 0.95rem;
  line-height: 1.6;
}
.sub { margin: 4px 0 0; font-size: 0.9rem; color: var(--navy-deep); }
.error {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  border-left: 6px solid var(--red);
  font-weight: 700;
}
.warn {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange-ink);
  border-left: 6px solid #e0a100;
  font-weight: 700;
}
.flash {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--white);
  border-left: 6px solid var(--green-deep);
  color: var(--navy-ink);
  font-weight: 700;
}

/* 確認画面の明細の中身 */
.detail-text { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; color: var(--navy-ink); }
.detail-row { display: grid; grid-template-columns: 8.4em 1fr; gap: 8px; margin: 2px 0; font-size: 0.95rem; }
.detail-row b { color: var(--navy); font-size: 0.9rem; line-height: 1.9; }

/* ── actions: ボタンの帯（藤） ── */
.actions {
  --band: var(--lilac);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 0 22px;
  margin: 0 0 18px;
}
.actions > * { flex: 1 1 140px; }
.actions > .btn-primary,
.actions > form { flex-basis: 100%; }
.actions > form { margin: 0; }
.actions > form .btn { width: 100%; }
.actions-q { flex-basis: 100%; margin: 0; font-weight: 800; color: var(--navy-ink); font-size: 1.05rem; }

/* ── ボタン ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--navy);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--navy); color: var(--white); font-size: 1.25rem; }
.btn-secondary { background: var(--white); color: var(--navy); }
.btn-danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn:active { transform: translateY(2px); }

/* ── バッジ ── */
.badge {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge-draft { background: var(--yellow); color: var(--yellow-ink); }
.badge-submitted { background: var(--green); color: #1d4a1a; border: 1px solid var(--green-deep); }

/* ── 表 ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
table.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.95rem;
}
table.table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}
table.table td {
  padding: 10px 12px;
  border-right: 1px solid #d6dee8;
  vertical-align: top;
}
table.table tbody tr:nth-child(even) td { background: var(--zebra); }
table.table td:first-child { white-space: nowrap; }
table.table td.num,
table.table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── 管理者: 絞り込み（藤）・数字（空色）・表（若葉） ── */
body.admin main.page { max-width: 1100px; }
body.admin header.top { padding-left: max(16px, calc((100% - 1100px) / 2)); padding-right: max(16px, calc((100% - 1100px) / 2)); }
body.admin header.top h1 { font-size: 1.9rem; }

.filters {
  --band: var(--lilac);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 4px 16px;
  align-items: end;
  padding: 18px 0 22px;
  margin: 0;
}
.filters .label { margin: 6px 0 2px; font-size: 0.95rem; }
.filters input,
.filters select { border-color: transparent; padding-left: 10px; }
.filters .btn { grid-column: -2 / -1; margin-top: 10px; }
.filter-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 0; font-weight: 700; }
.actions-center { display: flex; justify-content: center; padding: 8px 0 18px; }
.actions-center .btn { min-width: min(320px, 100%); }

.stats-band { --band: var(--sky); padding: 24px 0 26px; }
.stats-band > h3 { margin: 0 0 6px; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  margin: 0;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-left: 2px solid var(--navy);
}
.stat:first-child { border-left: 0; }
.stat-num {
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--navy-ink);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 1.05rem; font-weight: 800; color: var(--navy-ink); }

.table-band { --band: var(--green); padding: 22px 0 8px; }
.table-band > h3 { font-size: 1.5rem; margin: 0 0 12px; }
.table-band .card { border-left-color: var(--green-deep); }

/* ── ホーム画面に置く（PWA） ── */
.install-hint {
  margin: 20px 0 8px;
  text-align: center;
  font-size: 0.95rem;
}
.install-hint a {
  display: inline-block;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-weight: 700;
  text-decoration: none;
}
.install-steps { border-left-color: var(--green-deep); }
.install-steps ol { margin: 0; padding-left: 1.6em; }
.install-steps li { margin: 6px 0; font-size: 1.05rem; }
.page > .btn-primary { display: flex; width: 100%; margin: 16px 0; }

/* ホーム画面の「日報」から開いている時は、置き方の案内を出さない */
@media (display-mode: standalone) {
  .install-hint { display: none; }
}

@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input[type="date"] { font-size: 16px; padding-right: 6px; }
}
@media (max-width: 420px) {
  header.top h1 { font-size: 1.4rem; }
  body.admin header.top h1 { font-size: 1.4rem; }
  .stat-label { font-size: 0.9rem; }
  .filters .btn { grid-column: 1 / -1; }
}
@media (min-width: 560px) {
  .item-pair { grid-template-columns: 3fr 2fr; }
}
