/* 日本語フォントは要件により 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;
  z-index: 10;
}
.appbar-title { font-size: 1.05rem; }
.appbar-actions { display: flex; gap: 12px; }
.appbar-link { color: #fff; text-decoration: underline; font-size: .9rem; white-space: nowrap; }

.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: 4px 2px 8px; }
.greeting-row { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; }
.dept-pick { margin: 0; }
.dept-pick label { font-size: .82rem; color: #444; display: flex; align-items: center; gap: 6px; }
.dept-pick select { width: auto; min-width: 200px; padding: 8px 10px; }
.hint { color: #555; font-size: .88rem; }
.muted { color: #888; font-weight: normal; }

.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: .85rem; color: #444; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=month], select {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
}

.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: 16px; font-size: 1.15rem; margin: 8px 0 0; }
.btn-small { padding: 6px 10px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.status { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #eef; }
.status.ok { background: #eafaf0; border-left: 4px solid #1a7f37; color: #14532d; }
.status.error { background: var(--reject-bg); border-left: 4px solid var(--reject-border); }

/* ---- 日付の前後ボタン(‹ ›) ---- */
.date-row { display: flex; align-items: stretch; gap: 8px; }
.date-row #dateInput { flex: 1 1 auto; min-width: 0; }
.btn-step {
  flex: 0 0 auto; width: 48px; padding: 0; font-size: 1.5rem; line-height: 1;
  font-weight: bold; color: var(--accent); background: #fff;
}
.btn-step:active { background: #eef3fc; }

/* ---- 時刻欄(時:分プルダウン) ---- */
.time-field { margin: 12px 0; }
.time-field > span { display: block; font-size: .85rem; color: #444; margin-bottom: 4px; }
.time-row { display: flex; align-items: center; gap: 8px; }
.time-sel { width: auto; min-width: 84px; }
.time-row .colon { font-weight: bold; }
.req-mark { color: var(--reject-border); font-style: normal; font-size: .75rem;
  border: 1px solid var(--reject-border); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.time-note { color: #777; font-size: .82rem; margin: 6px 0 0; }

/* ---- 「この日の登録」リスト ---- */
.day-list { list-style: none; padding: 0; margin: 8px 0 0; }
.day-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.day-item .di-cat { font-weight: bold; }
.day-item .di-time { color: #444; }
.day-item .di-content { color: #555; }
.day-item .btn-delete { margin-left: auto; }

/* ---- 一覧の明細カード ---- */
.dl-row { margin-top: 12px; text-align: right; }
.entry.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.entry.reject { background: var(--reject-bg); border-color: var(--reject-border); }
.entry.approved { background: #eefaf0; border-color: #1a7f37; }
.entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.entry-date { font-weight: bold; font-size: 1.05rem; }
.entry-fields label { display: block; font-size: .8rem; color: #444; margin-bottom: 8px; }
.entry-fields .time-field { margin: 8px 0; }

.card-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.btn-delete { background: #fff; color: var(--reject-border); border-color: var(--reject-border); }
.saved-msg { color: #1a7f37; font-size: .85rem; margin-left: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .8rem; }
.badge-warn { background: var(--warn-border); color: #4a3b00; }
.badge-reject { background: var(--reject-border); color: #fff; }
.badge-approve { background: #1a7f37; color: #fff; }

/* ---- 月ナビ・月セレクタ ---- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.total { font-weight: bold; font-size: 1.05rem; }
.month-pick-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; }
.month-picker { font-size: 1rem; padding: 8px 12px; border: 1px solid #ccc;
  border-radius: 8px; background: #fff; width: 190px; max-width: 60%; }
.btn-today { white-space: nowrap; flex-shrink: 0; }

/* ---- テーブル(管理画面) ---- */
.file-list { list-style: none; padding: 0; }
.file-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.file-list li.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-list li.file-row a { word-break: break-all; }
.file-list li.file-row form { margin: 0; flex: none; }

.user-table, .summary-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.user-table th, .user-table td, .summary-table th, .summary-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; }
.summary-table thead th { background: #f0f0f0; white-space: nowrap; }
.summary-table .num { text-align: right; white-space: nowrap; width: 76px; }

/* ---- 総務 明細チェック ---- */
.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-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 .ucount { color: #444; font-size: .85rem; }
.user-block-head form.gen-one { margin: 0; }

.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-date { white-space: nowrap; width: 92px; }
.review-table .c-time { white-space: nowrap; width: 120px; }
.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); }

.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; }

@media (max-width: 640px) {
  .review-table .c-state { display: none; }
  .review-table, .review-table .c-act { font-size: .8rem; }
}

/* ---- 明細チェック 一覧の行アクション ---- */
.user-block-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.user-block-actions form.gen-one { margin: 0; }

/* ---- Excel風 簡易プレビュー(社内業務報告) ---- */
.sheet-card { padding: 16px; }
.sheet-title { font-size: 1.2rem; font-weight: bold; text-align: center; margin-bottom: 10px; }
.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: 18%; }

.sheet-scroll { overflow-x: auto; }
.sheet-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: .85rem; }
.sheet-table th, .sheet-table td { border: 1px solid #999; padding: 5px 8px; vertical-align: top; }
.sheet-table thead th { background: #f0f0f0; text-align: center; white-space: nowrap; }
.sheet-table .c-day { width: 34px; text-align: center; white-space: nowrap; }
.sheet-table .c-wd { width: 32px; text-align: center; white-space: nowrap; }
.sheet-table .c-cat { width: 96px; white-space: nowrap; }
.sheet-table .c-time { width: 116px; text-align: center; white-space: nowrap; }
.sheet-table .c-desc { word-break: break-word; }
.sheet-table tr.we { background: #f7f8fa; }
.sheet-table tr.rej { background: var(--reject-bg); }
.sheet-table tr.empty-day td { color: #bbb; }
.sheet-table .c-day.sat, .sheet-table .c-wd.sat { color: #1f6feb; }
.sheet-table .c-day.sun, .sheet-table .c-wd.sun { color: var(--reject-border); }

/* ---- ファイル単位の承認アクション ---- */
.file-actions { margin: 12px 0 6px; }
.file-actions form { margin: 0; }
.file-actions .btn-big { width: 100%; }
.file-actions-sub { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.file-actions-sub form { flex: 1 1 auto; }
.file-actions-sub .btn { width: 100%; }

.tag { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: .72rem; margin-left: 6px; }
.tag-reject { background: var(--reject-border); color: #fff; }

/* ---- 使い方ボタン / マニュアル ---- */
.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; }

.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; }
.manual h2 {
  font-size: 1.08rem; border-left: 5px solid var(--accent);
  padding-left: 10px; margin: 26px 0 10px;
}
.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; }
.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); }
.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; }
