/* =============================================================
   共通の見た目（色・文字・ポップアップ・入力欄）
   スタッフ用画面と管理画面で共通。
   ============================================================= */

:root {
  /* 端末がダークモードでも、いつも白背景（社長指定 2026-10-31）。ブラウザの自動の色反転も止める */
  color-scheme: only light;
  --bg: #f3f5f8; --surface: #ffffff; --line: #dfe3ea; --ink: #18202c; --muted: #5d6878;
  --accent: #2445c9; --accent-soft: #e6ebfb;
  --ok: #1d7f4e; --ok-soft: #e3f3ea;          /* 完了・貸渡可 */
  --crit: #c2312b; --crit-soft: #fbe5e3;      /* 未完了・期限が近い */
  --over: #c45a00; --over-soft: #fdebd8;      /* 返却・戻り予定日の超過 */
  --idle: #8a94a3; --idle-soft: #eceff3;      /* 貸渡中・整備中・押せない */
  --m1: #5a83ee;                              /* 1ヶ月点検ボタン */
  --soon-bg: #fffbfb; --shaken-bg: #ffb8b8;   /* 期限が近い／車検超過の車の背景 */
  --f-display: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
}
button { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sample { font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 0; }


/* ---- ポップアップ ---- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 20; background: rgba(10, 14, 20, .55);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.dlg {
  background: var(--surface); color: var(--ink); border-radius: 14px; padding: 20px; width: 100%; max-width: 360px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.dlg.wide { max-width: 440px; }
.dlg h2 { font-family: var(--f-display); font-size: 18px; margin: 0; }
.dlg p { margin: 0; color: var(--muted); font-size: 13px; }
.dlg button { font-weight: 700; border-radius: 8px; padding: 11px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.dlg button.ok { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.dlg button.ok:disabled { opacity: .4; cursor: not-allowed; }
.dlg .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dlg .scroll { overflow-y: auto; min-height: 0; flex: 1; }
.car-n { font-weight: 700; }
.car-p { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

/* 文字だけのリンク風ボタン */
.dlg .link, .link { padding: 0; border: 0; border-radius: 0; background: none; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---- 入力欄 ---- */
.fields { display: flex; flex-direction: column; gap: 10px; }
.fields[hidden] { display: none; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.fields input, .fields select {
  font: inherit; font-size: 16px; font-weight: 500; padding: 9px 10px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.fields input[type="date"] { border: 2px solid var(--ink); }
.req { color: var(--crit); margin-left: 4px; }
.err { color: var(--crit); font-size: 13px; font-weight: 700; margin: 0; }

/* ---- 項目名と値の表 ---- */
.dl-sec { display: flex; flex-direction: column; gap: 6px; }
.dl-sec h3 { font-size: 13px; margin: 0; color: var(--muted); letter-spacing: .04em; }
.dl-sec dl { margin: 0; display: grid; grid-template-columns: 8.5em 1fr; gap: 6px 10px; font-size: 14px; }
.dl-sec dt { color: var(--muted); }
.dl-sec dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.dl-sec dd small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.dl-sec dd small.over { color: var(--over); }
