/* 代車・レンタカー管理 — 共通CSS
   方針: モバイルファースト / 大きいタップ領域 / アニメーション全廃（即応性優先）。 */

*, *::before, *::after { box-sizing: border-box; }
:root {
  --fg: #1c1c1e;
  --muted: #6b7280;
  --line: #d8dbe0;
  --bg: #f3f4f6;
  --card: #ffffff;
  --accent: #1565c0;
  --accent-d: #0d47a1;
  --ok: #137333;
  --okbg: #e6f4ea;
  --warn: #b26a00;
  --warnbg: #fff4e0;
  --err: #b00020;
  --errbg: #fde7ea;
  --tap: 48px;
}

/* アニメーション・トランジションを明示的に無効化 */
* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ---- トップバー ---- */
.topbar {
  background: var(--accent-d);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.who { font-size: .82rem; color: #dbe7f6; }
.who a { color: #fff; }
.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 6px 6px;
}
.mainnav a {
  color: #eaf1fb;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .92rem;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}
.mainnav a.active { background: #fff; color: var(--accent-d); font-weight: 700; }

/* ---- コンテナ ---- */
.container { max-width: 960px; margin: 0 auto; padding: 14px 12px 60px; }
.page-title { font-size: 1.25rem; margin: 6px 0 14px; }
a { color: var(--accent); }

/* ---- フラッシュ ---- */
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.flash-ok   { background: var(--okbg);   color: var(--ok);   }
.flash-warn { background: var(--warnbg); color: var(--warn); }
.flash-err  { background: var(--errbg);  color: var(--err);  }

/* ---- カード ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---- ボタン ---- */
.btn, button, input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-block { width: 100%; }
.btn-lg { font-size: 1.15rem; min-height: 60px; }
.btn-ghost { background: #fff; color: var(--accent); }
.btn-muted { background: #fff; color: var(--fg); border-color: var(--line); }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- フォーム ---- */
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .92rem; }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px; /* iOS zoom防止 */
  background: #fff;
  color: var(--fg);
}
textarea { min-height: 80px; }
.field-row { display: grid; gap: 10px; }
@media (min-width: 560px) { .field-row.cols-2 { grid-template-columns: 1fr 1fr; } .field-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; } }
.hint { color: var(--muted); font-size: .82rem; margin-top: 3px; }

/* ---- テーブル ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.list th { background: #eef1f5; font-size: .85rem; color: #374151; position: sticky; top: 0; }
table.list tr:last-child td { border-bottom: none; }

/* ---- ステータスバッジ ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.b-available { background: var(--okbg);   color: var(--ok); }
.b-rented    { background: #e3effb;       color: var(--accent-d); }
.b-reserved  { background: var(--warnbg); color: var(--warn); }
.b-maintenance { background: #efe6fb;     color: #6a1b9a; }
.b-retired   { background: #eceff1;       color: #546e7a; }
.b-returned  { background: #eceff1;       color: #546e7a; }
.b-active    { background: #e3effb;       color: var(--accent-d); }
.b-canceled  { background: var(--errbg);  color: var(--err); }
.shaken-warn { color: var(--err); font-weight: 700; }

.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }

/* ---- ホームの大ボタン ---- */
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 12px; text-align: center; text-decoration: none; color: var(--fg);
  font-weight: 700; font-size: 1.05rem; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.tile .big { font-size: 1.6rem; }
.tile.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- 写真 ---- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo-thumb { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; text-decoration: none; color: var(--fg); }
.photo-thumb img { display: block; width: 100%; height: 110px; object-fit: cover; background: #eee; }
.photo-thumb .cap { display: block; font-size: .78rem; text-align: center; padding: 4px 2px; color: #555; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }

/* ログイン */
.login-wrap { max-width: 360px; margin: 8vh auto 0; }
