/* リース管理ポータル 共通スタイル */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a3a5c;
  --navy-dark: #122a44;
  --accent: #2e6da4;
  --bg: #f2f4f7;
  --card: #ffffff;
  --border: #d9dee5;
  --text: #24303c;
  --muted: #6b7684;
  --danger: #b8342e;
  --ok: #1e7e46;
  --warn: #b07816;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); }

/* ヘッダー */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  min-height: 52px;
}
.site-header .brand { font-weight: bold; font-size: 16px; padding: 10px 0; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 2px; }
.site-header nav a {
  color: #cfd9e4; text-decoration: none; padding: 14px 12px; font-size: 14px;
}
.site-header nav a:hover { color: #fff; }
.site-header nav a.active { color: #fff; border-bottom: 3px solid #fff; }
.site-header .user-box { margin-left: auto; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.site-header .user-box button {
  background: transparent; border: 1px solid #7a8ea3; color: #cfd9e4;
  padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.site-header .user-box button:hover { background: var(--navy-dark); color: #fff; }

/* レイアウト */
main { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 20px; margin-bottom: 16px; }
h2 { font-size: 16px; margin-bottom: 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* テーブル */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; white-space: nowrap; }
th { background: #eef1f5; font-weight: 600; }
td.num, th.num { text-align: right; }
tr:hover td { background: #f8fafc; }

/* フォーム */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 3px; }
input[type="text"], input[type="password"], input[type="date"], input[type="month"],
input[type="number"], select, textarea {
  width: 100%; max-width: 420px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 14px; font-family: inherit; background: #fff;
}
textarea { max-width: 640px; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ec3e6; }

button, .btn {
  display: inline-block;
  background: var(--accent); color: #fff; border: none; border-radius: 5px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
button:hover, .btn:hover { background: #275d8c; }
button:disabled { background: #a8b4c0; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.secondary:hover { background: #eef4fa; }
button.danger { background: var(--danger); }
button.danger:hover { background: #96271f; }
button.small { padding: 4px 10px; font-size: 12px; }

/* バッジ */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.unpaid { background: #fbeaea; color: var(--danger); }
.badge.waiting { background: #fdf3df; color: var(--warn); }
.badge.completed { background: #e5f4ea; color: var(--ok); }
.badge.scheduled { background: #e8f0f9; color: var(--accent); }
.badge.done { background: #e5f4ea; color: var(--ok); }
.badge.cancelled { background: #eceff2; color: var(--muted); }
.badge.overdue { background: #fbeaea; color: var(--danger); }

.stamp-mark { font-size: 13px; }
.stamp-mark.on { color: var(--ok); font-weight: bold; }
.stamp-mark.off { color: var(--muted); }

/* 通知/アラート */
.alert { border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.alert.info { background: #e8f0f9; border: 1px solid #b9d2ea; color: #1f4d79; }
.alert.warn { background: #fdf3df; border: 1px solid #ecd9a8; color: #7a5310; }
.alert.error { background: #fbeaea; border: 1px solid #eec3c1; color: var(--danger); }

.task-list { list-style: none; }
.task-list li {
  padding: 10px 4px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.task-list li:last-child { border-bottom: none; }
.muted { color: var(--muted); font-size: 13px; }

/* トースト */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy-dark); color: #fff; padding: 10px 22px; border-radius: 6px;
  font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 100;
  max-width: 90vw;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }

/* ログイン画面 */
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.auth-wrap .card { padding: 28px; }
.auth-title { text-align: center; font-size: 20px; margin-bottom: 4px; color: var(--navy); }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.auth-wrap input { max-width: none; }
.auth-wrap button { width: 100%; margin-top: 18px; padding: 10px; }

.seal-preview {
  width: 110px; height: 110px; border: 1px dashed var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff;
}
.seal-preview img { max-width: 100%; max-height: 100%; }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.inline-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; margin-top: 8px; }
