/* 日本語フォントは要件により Meiryo / Yu Gothic / MS 系に限定
   (Noto Sans CJK / Source Han Sans 系は使用禁止) */
:root {
  --accent: #1f6feb;
  --warn-bg: #fff8db;
  --warn-border: #e6c200;
  --reject-bg: #ffe9e9;
  --reject-border: #d33;
  --line: #ddd;
  --text: #1a1a1a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Meiryo", "Yu Gothic", "Yu Gothic UI", "MS PGothic",
               "MS Gothic", sans-serif;
  color: var(--text);
  background: #f5f6f8;
  -webkit-text-size-adjust: 100%;
}

.appbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--accent);
  color: #fff;
  font-weight: bold;
}
.appbar-title { font-size: 1.05rem; }
.appbar-link { color: #fff; text-decoration: underline; font-size: .9rem; }

.container { max-width: 720px; margin: 0 auto; padding: 12px; }

/* 全画面共通フッタ(バージョン・作成元マーキング) */
.appfoot {
  text-align: center; color: #9aa3ad; font-size: .72rem;
  letter-spacing: .02em; padding: 18px 12px 26px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; margin-top: 0; }
.greeting { font-size: 1.1rem; font-weight: bold; margin: 0 0 4px; }
.hint { color: #555; font-size: .88rem; }

.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: .85rem; color: #444; margin-bottom: 4px; }
.field input, input[type=text], input[type=number], input[type=date],
input[type=month] {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-big { width: 100%; padding: 18px; font-size: 1.2rem; margin: 8px 0; }
.btn-small { padding: 6px 10px; font-size: .85rem; }

.toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }

.status { margin-top: 12px; padding: 10px; border-radius: 8px; background: #eef; }
.status.error { background: var(--reject-bg); }

/* 撮影結果・一覧カード */
.expense.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.expense.reject { background: var(--reject-bg); border-color: var(--reject-border); }
.expense-row { display: flex; gap: 12px; }
.thumb {
  width: 96px; height: 96px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 6px; background: #fafafa;
}
.expense-fields { flex: 1; }
.expense-fields label { display: block; font-size: .8rem; color: #444; margin-bottom: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .8rem; margin: 6px 0; }
.badge-warn { background: var(--warn-border); color: #4a3b00; }
.badge-reject { background: var(--reject-border); color: #fff; }
.badge-approve { background: #1a7f37; color: #fff; }
.expense.approved { background: #eefaf0; border-color: #1a7f37; }

.saved-msg { color: #1a7f37; font-size: .85rem; margin-left: 8px; }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.total { font-weight: bold; font-size: 1.1rem; }

.file-list { list-style: none; padding: 0; }
.file-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.user-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.user-table th, .user-table td { border: 1px solid var(--line); padding: 6px; text-align: left; }
.user-table tr.inactive { color: #999; }
.url-cell { word-break: break-all; font-size: .78rem; }

/* ===== 立替払精算書プレビュー ===== */
.sheet-title {
  text-align: center; font-size: 1.3rem; font-weight: bold;
  letter-spacing: .3em; margin-bottom: 12px;
}
.sheet-header { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: .85rem; }
.sheet-header th, .sheet-header td { border: 1px solid #999; padding: 5px 8px; }
.sheet-header th { background: #f0f0f0; text-align: center; white-space: nowrap; width: 22%; }
.sheet-header td { width: 28%; }

.sheet-scroll { overflow-x: auto; }
.sheet-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .85rem; }
.sheet-table th, .sheet-table td { border: 1px solid #999; padding: 6px 8px; vertical-align: top; }
.sheet-table thead th { background: #f0f0f0; text-align: center; white-space: nowrap; }
.sheet-table .c-no { width: 38px; text-align: center; }
.sheet-table .c-date { width: 92px; white-space: nowrap; }
.sheet-table .c-payee { width: 26%; }
.sheet-table .c-amt { width: 110px; text-align: right; white-space: nowrap; }
.sheet-table tr.warn { background: var(--warn-bg); }
.sheet-table tr.reject { background: var(--reject-bg); }
.sheet-table tr.approved { background: #eefaf0; }
.sheet-table .empty { text-align: center; color: #999; }
.sheet-table .c-total-label { text-align: right; background: #f0f0f0; }
.sheet-table .total { font-weight: bold; }

.tag { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: .72rem; margin-left: 6px; }
.tag-warn { background: var(--warn-border); color: #4a3b00; }
.tag-reject { background: var(--reject-border); color: #fff; }
.tag-approve { background: #1a7f37; color: #fff; }

/* 印刷: ナビ・ヘッダを隠し、表だけきれいに */
@media print {
  .appbar, .no-print { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .card { border: none; margin: 0; padding: 0; }
  .sheet-scroll { overflow: visible; }
  .sheet-table { min-width: 0; font-size: 11px; }
}

/* ===== 操作マニュアル(ユーザー / 管理者 共通) ===== */
.manual { line-height: 1.75; }
.manual .manual-title { font-size: 1.35rem; margin: 2px 0 4px; }
.manual .lead { color: #555; font-size: .92rem; margin: 0 0 4px; }

/* 先頭のジャンプ目次 */
.toc { margin: 4px 0 0; padding: 0; list-style: none; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 11px 12px; border-bottom: 1px solid var(--line);
  color: var(--accent); text-decoration: none; font-size: .98rem;
}
.toc li:last-child a { border-bottom: none; }
.toc a::after { content: "›"; float: right; color: #aaa; }

/* セクション見出し */
.manual h2 {
  font-size: 1.08rem; border-left: 5px solid var(--accent);
  padding-left: 10px; margin: 26px 0 10px; scroll-margin-top: 60px;
}

/* 番号付きステップ */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li {
  position: relative; padding: 2px 0 14px 44px; margin: 0;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: bold;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.steps > li strong { display: block; }
.steps > li .sub { color: #555; font-size: .9rem; }

/* 注記カラム(青=PC補足 / 黄=注意 / 赤=差戻し) */
.callout { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: .92rem; }
.callout .callout-h { font-weight: bold; display: block; margin-bottom: 4px; }
.callout-pc   { background: #eef4ff; border-left: 4px solid var(--accent); }
.callout-warn { background: var(--warn-bg); border-left: 4px solid var(--warn-border); }
.callout-reject { background: var(--reject-bg); border-left: 4px solid var(--reject-border); }

/* FAQ */
.faq { margin: 0; }
.faq dt { font-weight: bold; margin-top: 14px; }
.faq dt::before { content: "Q. "; color: var(--accent); }
.faq dd { margin: 4px 0 0; color: #444; }
.faq dd::before { content: "A. "; font-weight: bold; color: #777; }

/* 状態の見本チップ(本文中で色の意味を示す) */
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .82rem; font-weight: bold; }
.chip-warn { background: var(--warn-border); color: #4a3b00; }
.chip-reject { background: var(--reject-border); color: #fff; }
.chip-approve { background: #1a7f37; color: #fff; }
.chip-reg { background: #e6e6e6; color: #444; }

/* 先頭へ戻るリンク */
.back-top { display: inline-block; margin-top: 6px; font-size: .85rem; color: #888; text-decoration: none; }

/* ===== 総務 明細チェック(承認/差戻し)画面 ===== */
.review-summary { display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline; }
.review-summary .num { font-size: 1.2rem; font-weight: bold; }
.review-summary .num.pending { color: var(--reject-border); }

.user-block { margin-bottom: 12px; }
.user-block-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-bottom: 8px; margin-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.user-block-head .uname { font-weight: bold; font-size: 1.05rem; }
.user-block-head .umeta { color: #666; font-size: .85rem; }
.user-block-head .usub { margin-left: auto; font-weight: bold; }

.review-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.review-table th, .review-table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; }
.review-table thead th { background: #f0f0f0; white-space: nowrap; }
.review-table .c-thumb { width: 56px; text-align: center; }
.review-table .c-thumb img { width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.review-table .c-date { white-space: nowrap; width: 92px; }
.review-table .c-amt { text-align: right; white-space: nowrap; width: 96px; }
.review-table .c-state { width: 78px; text-align: center; white-space: nowrap; }
.review-table .c-act { width: 168px; white-space: nowrap; }
.review-table tr.is-approved { background: #eefaf0; }
.review-table tr.is-rejected { background: var(--reject-bg); }
.review-table .reject-note { color: var(--reject-border); font-size: .78rem; display: block; margin-top: 2px; }
.btn-approve { background: #1a7f37; color: #fff; border-color: #1a7f37; }
.btn-reject  { background: #fff; color: var(--reject-border); border-color: var(--reject-border); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.review-table .c-amt .missing { color: var(--reject-border); font-weight: bold; font-size: .8rem; }
.user-block-head form.gen-one { margin: 0; }
.user-block-head .ucount { color: #444; font-size: .85rem; }

@media (max-width: 640px) {
  .review-table .c-thumb, .review-table .c-state { display: none; }
  .review-table, .review-table .c-act { font-size: .8rem; }
}

/* アプリ内「使い方」ボタン */
.help-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); text-decoration: none; margin-top: 4px;
}
.help-entry .help-ic { font-size: 1.3rem; }
.help-entry .help-tx { flex: 1; }
.help-entry .help-tx b { display: block; }
.help-entry .help-tx span { font-size: .82rem; color: #666; }
.help-entry::after { content: "›"; color: #aaa; font-size: 1.2rem; }
