* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px 16px 64px;
  background: #f2f4f7;
  font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #1f2933;
}

.card {
  max-width: 480px;
  margin: 0 auto 24px;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 20px;
  font-size: 22px;
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #52606d;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #cbd2d9;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #ffffff;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #2f80ed;
}

.btn-login {
  width: 100%;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  background: #2f80ed;
}

.btn-login:hover {
  opacity: 0.9;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  gap: 12px;
}

/* index.html: 上部の「ログイン中: ...」表示とログアウトボタンを横並びにする */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
  color: #52606d;
}

.btn {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  transition: opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-in {
  background: #2f80ed;
}

.btn-out {
  background: #eb5757;
}

.btn:not(:disabled):hover {
  opacity: 0.9;
}

#result {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 14px;
  white-space: pre-line;
}

#result.success {
  color: #1a7f37;
}

#result.error {
  color: #d1242f;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #e4e7eb;
}

th {
  color: #52606d;
  font-weight: 600;
}

.empty-message {
  color: #9aa5b1;
  font-size: 14px;
}

.nav-link {
  margin: -8px 0 20px;
  font-size: 14px;
}

.nav-link a {
  color: #2f80ed;
  text-decoration: none;
}

.nav-link a:hover {
  text-decoration: underline;
}

/* 勤怠サマリ画面(summary.html)は表の列が多いので、打刻画面より少し幅を広くする */
.card-wide {
  max-width: 720px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.toolbar input[type="text"] {
  flex: 1;
  margin-bottom: 0;
}

.btn-load {
  flex: none;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  background: #2f80ed;
}

.btn-load:hover {
  opacity: 0.9;
}

.period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid #e4e7eb;
  border-bottom: 1px solid #e4e7eb;
}

.btn-nav {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #cbd2d9;
  border-radius: 8px;
  background: #ffffff;
  color: #2f80ed;
  cursor: pointer;
}

.btn-nav:hover {
  background: #f2f4f7;
}

.period-label {
  min-width: 130px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.table-scroll {
  overflow-x: auto;
}

#summary-table {
  min-width: 560px;
}

/* 勤怠区分(遅刻・午前半休など)を丸いタグ風に表示する */
.category-tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  font-size: 12px;
  border-radius: 999px;
  background: #fdecea;
  color: #d1242f;
  white-space: nowrap;
}

/* 実働時間(正式値)の下に添える参考値(15分丸め)。
   正式値と見分けがつくよう、薄いグレーで一回り小さい文字にしている */
.reference-value {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #9aa5b1;
}

.total-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid #1f2933;
  font-size: 15px;
}

.total-row strong {
  font-size: 22px;
}

/* 正式な合計(strong)と参考値の合計(reference-value)を縦に並べ、右揃えにする */
.total-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* 月合計の参考値は行内の参考値より少し大きめの文字にして読みやすくする */
.total-value .reference-value {
  font-size: 13px;
}

/* admin.html: 表の行の中で使う小さいボタン(「修正」「履歴」など) */
.btn-small {
  padding: 4px 10px;
  margin: 0 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  background: #ffffff;
  color: #2f80ed;
  cursor: pointer;
}

.btn-small:hover {
  background: #f2f4f7;
}

/* admin.html: 打刻修正・打刻漏れ追加の入力フォームを枠で囲んで目立たせる */
.inline-form {
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #cbd2d9;
  border-radius: 8px;
  background: #f8f9fb;
}

.inline-form .button-row {
  margin-top: 4px;
}

/* admin.html: 修正履歴を表示する行(通常の行より少し背景を落として区別する) */
.history-detail {
  background: #f8f9fb;
  font-size: 13px;
  color: #52606d;
}

.history-detail td {
  padding: 10px 12px;
}

.history-detail ul {
  margin: 0;
  padding-left: 18px;
}

.history-detail li {
  margin-bottom: 4px;
}

/* admin.html: GPS打刻地点の地図を表示する行 */
.map-detail td {
  padding: 12px;
}

/* Leafletの地図が描画される<div>そのものの大きさ。
   Leafletは自分が入っている要素の幅・高さいっぱいに描画するため、
   この要素自体に高さを指定しておかないと地図が0pxの高さになって
   何も表示されない、という点に注意。 */
.gps-map {
  height: 300px;
  border-radius: 8px;
}
