/* dars/public/assets/dars.css
 * DARS 共通のCSS（外部の部品・Webフォントは使わない）
 * 文字：Windows 標準の BIZ UDPゴシック（帳票・業務向けのUDフォント）。数字は等幅で桁を揃える
 * 色：紺（見出し・枠）、印の朱（承認の状態）、罫線のグレー
 */
:root {
  --ink: #1f2a44;        /* 紺：ヘッダー・見出し */
  --ink-soft: #4a5672;
  --paper: #f5f7fa;      /* 背景 */
  --sheet: #ffffff;      /* 表・欄の地 */
  --rule: #c9d1dc;       /* 罫線 */
  --rule-soft: #e4e8ee;
  --seal: #b7282e;       /* 朱：承認の印・差戻し */
  --ok: #2e7d4f;
  --wait: #9a6700;
  --focus: #2f6fd6;
  font-size: 15px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: #222;
  font-family: "BIZ UDPGothic", "BIZ UDPゴシック", "Meiryo", "Hiragino Sans", sans-serif;
  line-height: 1.6;
}
a { color: var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- ヘッダーとメニュー ---- */
.site-head { background: var(--ink); color: #fff; }
.site-head .inner { max-width: 1280px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-name { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.05em; color: #fff; text-decoration: none; }
.site-name small { font-weight: 400; font-size: 0.8rem; margin-left: 0.5em; opacity: 0.8; }
.who { margin-left: auto; font-size: 0.9rem; opacity: 0.9; }
.site-head form { margin: 0; }
.site-head button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 3px; padding: 2px 10px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.menu { background: #fff; border-bottom: 1px solid var(--rule); }
.menu ul { max-width: 1280px; margin: 0 auto; padding: 0 16px; list-style: none; display: flex; flex-wrap: wrap; }
.menu a { display: block; padding: 10px 16px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.menu a:hover { background: var(--paper); }
.menu a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.4rem; color: var(--ink); margin: 0.4em 0 0.6em; }
h2 { font-size: 1.1rem; color: var(--ink); margin: 1.2em 0 0.5em; padding-left: 8px; border-left: 4px solid var(--ink); }

/* ---- 表 ---- */
table.grid { border-collapse: collapse; background: var(--sheet); margin-bottom: 1em; }
table.grid th, table.grid td { border: 1px solid var(--rule); padding: 4px 10px; text-align: left; vertical-align: top; }
table.grid thead th { background: var(--rule-soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
table.grid tbody th { background: #fafbfc; font-weight: 400; white-space: nowrap; }
table.grid.wide { width: 100%; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* ---- 横並び ---- */
.cols { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }

/* ---- 状態の表示（承認済みは印の形） ---- */
.status { display: inline-block; font-size: 0.85rem; padding: 0 8px; border-radius: 3px; border: 1px solid var(--rule); background: #fff; white-space: nowrap; }
.status.draft { color: var(--ink-soft); }
.status.submitted, .status.branch_approved, .status.hq_approved { color: var(--wait); border-color: #e2c27a; background: #fffaf0; }
.status.returned { color: #fff; background: var(--seal); border-color: var(--seal); }
.status.confirmed { color: var(--ok); border-color: #9cc9ad; background: #f2faf5; }
.seal { display: inline-flex; align-items: center; justify-content: center; width: 2.2em; height: 2.2em; border: 2px solid var(--seal); border-radius: 50%; color: var(--seal); font-size: 0.75rem; font-weight: 700; line-height: 1; transform: rotate(-8deg); }
.seal.none { border-style: dotted; color: var(--rule); border-color: var(--rule); transform: none; }

/* ---- 数値の入力欄 ---- */
input[type="text"], textarea, select { font: inherit; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; }
input[data-num], input[data-denom] { width: 9em; text-align: right; font-variant-numeric: tabular-nums; }
input[readonly] { background: var(--rule-soft); border-color: transparent; }
button.primary, a.button { display: inline-block; background: var(--ink); color: #fff; border: 0; border-radius: 3px; padding: 6px 18px; font: inherit; cursor: pointer; text-decoration: none; }
button.primary:disabled { opacity: 0.5; cursor: default; }
button.danger { background: #fff; color: var(--seal); border: 1px solid var(--seal); border-radius: 3px; padding: 6px 18px; font: inherit; cursor: pointer; }

/* ---- お知らせ ---- */
.flash { color: var(--ok); border-left: 4px solid var(--ok); background: #fff; padding: 6px 12px; }
.errors { color: var(--seal); border-left: 4px solid var(--seal); background: #fff; padding: 6px 12px 6px 28px; }
.note { font-size: 0.88rem; color: var(--ink-soft); }
.calc { margin-left: 0.5em; font-size: 0.88rem; }
.calc.ok { color: var(--ok); }
.calc.ng { color: var(--seal); }

/* ---- ダッシュボード ---- */
.todo { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--rule); }
.todo li { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--rule-soft); }
.todo li:first-child { border-top: 0; }
.todo .count { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; color: var(--ink); }
.todo li.alert .count { color: var(--seal); }
.todo .label { flex: 1; }

@media (max-width: 640px) {
  .who { margin-left: 0; width: 100%; }
  input[data-num], input[data-denom] { width: 7em; }
}
@media print {
  .site-head, .menu, button { display: none; }
  body { background: #fff; }
}

/* ---- 閲覧 ---- */
.crumbs { margin: 0 0 12px; font-size: 0.95rem; }
.crumbs span { color: var(--ink); font-weight: 700; }
.month-nav { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.month-nav button { font: inherit; padding: 3px 12px; }
table.month tr.off td { background: #f3f4f6; color: var(--ink-soft); }
table.month tfoot th, table.month tfoot td { background: var(--rule-soft); font-weight: 700; }
td.alert { color: var(--seal); font-weight: 700; }
tr.selected td { background: #eef3fb; }
tr.changed th, tr.changed td { background: #fff4d6; }
.changed-text { background: #fff4d6; }
.was { display: block; font-size: 0.8rem; color: var(--ink-soft); }
.reason { color: var(--seal); font-size: 0.9em; }

/* ---- 入力画面 ---- */
table.report-head th { background: var(--rule-soft); }
.note-input { width: 12em; }
.submit-area { background: var(--sheet); border: 1px solid var(--rule); padding: 8px 16px; margin-top: 8px; }

/* ---- ログイン ---- */
main.login { max-width: 420px; }
main.login form { background: var(--sheet); border: 1px solid var(--rule); padding: 8px 20px; }
main.login input[type="text"], main.login input[type="password"] { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 3px; }
table.total tfoot th, table.total tfoot td { background: var(--rule-soft); font-weight: 700; border-top: 2px solid var(--ink); }

/* ---- 日ごと・月ごとの切り替え、一括確認 ---- */
.view-switch { display: flex; gap: 0; margin: 0 0 12px; }
.view-switch a, .view-switch span { padding: 4px 16px; border: 1px solid var(--ink); text-decoration: none; }
.view-switch a { color: var(--ink); background: #fff; }
.view-switch span { color: #fff; background: var(--ink); font-weight: 700; }
.view-switch :first-child { border-radius: 3px 0 0 3px; }
.view-switch :last-child { border-radius: 0 3px 3px 0; border-left: 0; }
details.hq-group { background: var(--sheet); border: 1px solid var(--rule); margin-bottom: 8px; padding: 4px 12px; }
details.hq-group summary { cursor: pointer; color: var(--ink); font-weight: 700; padding: 4px 0; }
details.hq-group table { margin-top: 8px; }
/* ---- 画面下部（クレジット・バージョン番号） ---- */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
.site-foot { background: var(--ink); color: #fff; font-size: 0.8rem; }
.site-foot .inner { max-width: 1280px; margin: 0 auto; padding: 6px 16px; display: flex; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
