/* timecard-iolite 共通スタイル（shift-iolite準拠のモノトーン + 打刻画面用タイル） */
/* 配色: 墨#1E1E1E・ボタン黒#353535・枠#D4D4D4/#E6E6E6・アラートのみ#B23B3B */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #353535;      /* 主ボタン・アクセント */
  --green-dark: #1E1E1E; /* 見出し・本文強調 */
  --green-pale: #F5F5F5; /* エントリ背景 */
  --red: #B23B3B;        /* 危険・警告 */
  --gray: #6B6B6B;
  --line: #E6E6E6;
  --bg: #FAFAFA;
}
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: #1E1E1E;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 40px;
  -webkit-text-size-adjust: 100%;
}
header.appbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--green); color: #fff;
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
header.appbar h1 { font-size: 16px; font-weight: 600; }
header.appbar .clock { font-size: 15px; font-variant-numeric: tabular-nums; opacity: .95; }
.container { padding: 12px; max-width: 720px; margin: 0 auto; }
.container.wide { max-width: 900px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 12px;
}
.card h2 { font-size: 14px; color: var(--green-dark); margin-bottom: 8px; }
button, .btn {
  appearance: none; border: none; border-radius: 8px;
  background: var(--green); color: #fff;
  font-size: 14px; padding: 9px 14px; cursor: pointer;
  font-family: inherit;
}
button.secondary { background: #fff; color: var(--green-dark); border: 1px solid #D4D4D4; }
button.ghost { background: #ECECEC; color: #1E1E1E; }
button.danger { background: var(--red); }
button.small { font-size: 12px; padding: 5px 9px; border-radius: 6px; }
button:disabled { opacity: .45; cursor: default; }
select, input[type="date"], input[type="text"], input[type="number"], input[type="time"], input[type="password"] {
  font-family: inherit; font-size: 15px;
  border: 1px solid #D4D4D4; border-radius: 8px;
  padding: 8px; background: #fff;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.notice { background: #F5F5F5; border: 1px solid #E6E6E6; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.error { background: #F9EDED; border: 1px solid #E3C6C6; color: #B23B3B; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; white-space: pre-wrap; }
.success { background: #F2F2F2; border: 1px solid #D4D4D4; color: var(--green-dark); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; white-space: pre-wrap; }
.fatal { padding: 40px 20px; text-align: center; color: var(--gray); font-size: 14px; }
.loading { padding: 30px; text-align: center; color: var(--gray); }
.muted { color: var(--gray); font-size: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; background: #fff; color: #1E1E1E; border: 1px solid var(--line); }
.tabs button.active { background: var(--green); color: #fff; border-color: var(--green); }
table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th, table.simple td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
table.simple tbody tr.clickable { cursor: pointer; }
table.simple tbody tr.clickable:hover { background: #F5F5F5; }
tr.warnrow td { color: var(--red); }
.warntext { color: var(--red); }

/* ---- コード入力（初回登録） ---- */
.login-wrap { max-width: 380px; margin: 60px auto 0; padding: 0 16px; }
.login-wrap h1 { font-size: 18px; margin-bottom: 16px; text-align: center; color: var(--green-dark); }
input.codein {
  width: 100%; font-size: 22px; text-align: center; letter-spacing: 3px;
  padding: 12px; margin-bottom: 12px;
}
.login-wrap button { width: 100%; font-size: 16px; padding: 12px; }

/* ---- 打刻タイル ---- */
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  min-height: 96px; padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  -webkit-tap-highlight-color: rgba(0,0,0,.08);
}
.tile .nm { font-size: 19px; font-weight: 700; }
.tile .st { font-size: 12px; color: var(--gray); line-height: 1.4; }
.tile.working { background: var(--green); color: #fff; border-color: var(--green); }
.tile.working .st { color: #fff; opacity: .92; }
.tile.done { background: #ECECEC; }
.tile .st .warn { color: var(--red); }
.tile.working .st .warn { color: #FFD9D9; }

/* ---- 下部シート ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 720px;
  border-radius: 16px 16px 0 0; padding: 18px 16px 30px;
  max-height: 88vh; overflow-y: auto;
}
.sheet h2 { font-size: 20px; margin-bottom: 10px; color: var(--green-dark); }
.sheet .field { margin-bottom: 10px; }
.sheet .field label { display: block; font-size: 12px; color: var(--gray); margin-bottom: 3px; }
.bigbtn { width: 100%; font-size: 20px; padding: 16px; border-radius: 12px; margin-top: 12px; }
.locpick { display: flex; gap: 8px; flex-wrap: wrap; }
.locpick button {
  flex: 1; min-width: 120px; background: #fff; color: #1E1E1E;
  border: 1px solid #D4D4D4; font-size: 16px; padding: 12px;
}
.locpick button.picked { background: var(--green); color: #fff; border-color: var(--green); }

/* ---- 完了オーバーレイ ---- */
.overlay {
  position: fixed; inset: 0; background: var(--green); color: #fff; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px;
}
.overlay .big { font-size: 36px; font-weight: 700; }
.overlay .sub { font-size: 20px; opacity: .95; }
.overlay .note { font-size: 15px; color: #FFD9D9; }

/* ---- 打刻画面デザイン（body.punch: 背景写真 + ロゴ） ---- */
body.punch { background: #1A1D1A; }
body.punch::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("../assets/bg.jpg") center 32% / cover no-repeat;
}
body.punch::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14,18,14,.78), rgba(14,18,14,.5) 42%, rgba(14,18,14,.78));
}
body.punch header.appbar {
  background: rgba(18, 21, 18, .55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 12px 18px;
}
body.punch .brand { display: flex; align-items: center; min-width: 0; }
body.punch .applogo { height: 32px; display: block; filter: brightness(0) invert(1); }
body.punch .applabel {
  font-size: 13px; letter-spacing: .18em; opacity: .85; white-space: nowrap;
  border-left: 1px solid rgba(255, 255, 255, .35); padding-left: 12px; margin-left: 12px;
}
body.punch .clock { font-size: 17px; }
/* タイルは「案A シャープ明朝」（2026-08-06 市山様選定）: 直角+細白枠+明朝、出勤中のみ白反転 */
body.punch .tile {
  background: rgba(15, 18, 15, .38);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 3px;
  box-shadow: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  min-height: 110px;
}
body.punch .tile .nm {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 24px; font-weight: 600; letter-spacing: .14em; color: #fff;
}
body.punch .tile .st { font-size: 11px; letter-spacing: .16em; color: rgba(255, 255, 255, .78); }
body.punch .tile.working { background: rgba(255, 255, 255, .94); border-color: #fff; }
body.punch .tile.working .nm { color: #1E1E1E; }
body.punch .tile.working .st { color: #1E1E1E; opacity: 1; }
body.punch .tile.working .st .warn { color: var(--red); }
body.punch .tile.done { background: rgba(15, 18, 15, .22); border-color: rgba(255, 255, 255, .28); }
body.punch .tile.done .nm { color: rgba(255, 255, 255, .6); }
body.punch .tile.done .st { color: rgba(255, 255, 255, .55); }
.tile.addtile { border: 1px dashed #B5B5B5; background: transparent; box-shadow: none; }
.tile.addtile .nm, .tile.addtile .st { color: var(--gray); }
body.punch .tilegrid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
body.punch .tile.addtile { border: 1px dashed rgba(255, 255, 255, .45); background: transparent; }
body.punch .tile.addtile .nm { font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; color: rgba(255, 255, 255, .92); }
body.punch .tile.addtile .st { color: rgba(255, 255, 255, .75); }
body.punch .hint { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px rgba(0, 0, 0, .45); font-size: 12px; }
body.punch .error { box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
body.punch .brandline { text-align: center; margin: 48px 0 18px; }
body.punch .brandline img { height: 46px; filter: brightness(0) invert(1); opacity: .95; }
body.punch .login-wrap {
  background: rgba(255, 255, 255, .94); border-radius: 18px;
  padding: 26px 22px; margin-top: 0;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
