/* 従業員アプリ（モバイル前提）。theme.css/ui.css の後に読込。最大480px幅で端末風に中央寄せ。 */

body { background: #dfe4ea; }
.staff-app, .auth-wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg, #eef1f5);
  box-shadow: 0 0 30px rgba(0,0,0,.12); position: relative; display: flex; flex-direction: column; }

/* ---- 認証 ---- */
.auth-wrap { justify-content: center; padding: 24px 18px; }
.auth-card { background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-mark { width: 44px; height: 44px; border-radius: 12px; background: #2a6048; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.auth-title { font-weight: 800; font-size: 16px; color: var(--text, #1f2937); }
.auth-sub { font-size: 12px; color: var(--muted, #5b6573); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: #eef1f5; padding: 4px; border-radius: 10px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted, #5b6573); cursor: pointer; }
.auth-tab.active { background: #fff; color: #2a6048; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.auth-note { font-size: 13px; color: var(--muted, #5b6573); margin: 0 0 12px; }
.auth-go { width: 100%; margin-top: 12px; padding: 13px; font-size: 15px; }
.auth-err { color: var(--danger, #c2261b); font-size: 13px; min-height: 18px; margin: 8px 0 0; }
.auth-hint { font-size: 11px; color: var(--muted, #5b6573); margin: 10px 0 0; }
.chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chk { font-size: 13px; display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line, #d3d9e2); border-radius: 8px; }

/* ---- 共通フォーム ---- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted, #5b6573); }
.input, .select { padding: 11px 12px; border: 1px solid var(--line, #d3d9e2); border-radius: 10px; font-size: 16px; background: #fff; width: 100%; box-sizing: border-box; }

/* ---- シェル（ヘッダ + メイン + 下タブ） ---- */
.staff-hdr { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #2a6048; color: #fff; }
.staff-hdr-name { font-weight: 700; font-size: 15px; }
.hdr-ic-btn { background: transparent; border: 0; padding: 0; cursor: pointer; }
.hdr-ic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid rgba(255,255,255,.6); }
.hdr-ic-ph { display: grid; place-items: center; background: #fff; color: #2a6048; font-weight: 800; }
.staff-main { flex: 1; padding: 16px; padding-bottom: 88px; overflow-y: auto; }
.tabbar { position: sticky; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line, #d3d9e2); }
.tabbar-item { background: transparent; border: 0; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted, #5b6573); }
.tabbar-item.active { color: #2a6048; }
.tabbar-ic { font-size: 20px; line-height: 1; }
.tabbar-l { font-size: 11px; font-weight: 700; }

/* ---- 出退勤トップ（大きいボタン） ---- */
.punch-current { background: #fff; border: 1px solid var(--line, #d3d9e2); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.punch-current .pc-label { font-size: 12px; color: var(--muted, #5b6573); }
.punch-current .pc-site { font-size: 18px; font-weight: 800; color: var(--text, #1f2937); margin: 2px 0; }
.punch-current .pc-time { font-size: 14px; color: var(--text, #1f2937); }
.punch-wrap { display: grid; place-items: center; padding: 12px 0 24px; }
.punch-btn { width: 220px; height: 220px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  font-size: 30px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: grid; place-items: center; gap: 4px; }
.punch-btn .pb-sub { font-size: 13px; font-weight: 600; opacity: .9; }
.punch-btn.in { background: radial-gradient(circle at 50% 35%, #36a05f, #1e7d46); }
.punch-btn.out { background: radial-gradient(circle at 50% 35%, #d9534f, #c2261b); }
.punch-btn:active { transform: scale(.97); }
.punch-done { text-align: center; color: var(--muted, #5b6573); }

/* ---- カレンダー / 週タイムテーブル（モバイル） ---- */
.seg { display: flex; gap: 4px; background: #eef1f5; padding: 4px; border-radius: 10px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted, #5b6573); cursor: pointer; }
.seg button.active { background: #fff; color: #2a6048; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav button { border: 1px solid var(--line, #d3d9e2); background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.cal-nav .cal-title { font-weight: 800; }
/* 週タイムテーブル: 1列目=時間, 1行目=曜日 */
.tt-wrap { overflow-x: auto; border: 1px solid var(--line, #d3d9e2); border-radius: 10px; background: #fff; }
.tt { display: grid; grid-template-columns: 44px repeat(7, minmax(40px, 1fr)); min-width: 360px; }
.tt-cell { border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; min-height: 22px; font-size: 11px; position: relative; }
.tt-head { position: sticky; top: 0; background: #f3f6fa; text-align: center; font-weight: 700; padding: 6px 0; z-index: 1; }
.tt-hour { text-align: right; padding: 0 4px; color: var(--muted, #5b6573); font-size: 10px; background: #fafbfc; }
.tt-shift { background: #2a6048; color: #fff; border-radius: 4px; font-size: 10px; padding: 1px 3px; position: absolute; left: 1px; right: 1px; overflow: hidden; }
.tt-shift.is-tap { cursor: pointer; }

/* ---- 今日/明日カード ---- */
.todaycard { background: #fff; border: 1px solid var(--line, #d3d9e2); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.todaycard.is-today { border-left: 4px solid #2a6048; }
.todaycard .tc-when { font-size: 12px; color: var(--muted, #5b6573); }
.todaycard .tc-site { font-weight: 800; font-size: 16px; margin: 2px 0; }
.todaycard .tc-empty { color: var(--muted, #5b6573); }

/* ---- シフト入力 ---- */
.shift-day { background: #fff; border: 1px solid var(--line, #d3d9e2); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.shift-day-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.shift-day-date { font-weight: 800; }
.avail-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.avail-seg button { border: 1px solid var(--line, #d3d9e2); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.avail-seg button.on-ok { background: #1e7d46; color: #fff; border-color: #1e7d46; }
.avail-seg button.on-none { background: #5b6573; color: #fff; border-color: #5b6573; }
.avail-seg button.on-tbd { background: #b15c00; color: #fff; border-color: #b15c00; }
.avail-seg button.on-consult { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.band-row { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.band-row button { border: 1px solid var(--line, #d3d9e2); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.band-row button.active { background: #2a6048; color: #fff; border-color: #2a6048; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg, #eef1f5); padding: 10px 0; display: flex; gap: 8px; }
.sticky-actions .btn { flex: 1; padding: 13px; font-size: 15px; }
.submit-badge { font-size: 12px; }

/* 週セレクタ（ピル・横スクロールに閉じる） */
.wk-nav { gap: 8px; }
.wk-nav button { font-size: 13px; white-space: nowrap; }
.wk-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.wk-pill { flex: 0 0 auto; border: 1px solid var(--line, #d3d9e2); background: #fff; border-radius: 12px;
  padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; }
.wk-pill.active { border-color: #2a6048; box-shadow: 0 0 0 1px #2a6048 inset; }
.wk-pill-d { font-weight: 800; font-size: 13px; color: var(--text, #1f2937); white-space: nowrap; }
.wk-status { font-size: 13px; color: var(--muted, #5b6573); margin: 4px 0 10px; display: flex; align-items: center; gap: 6px; }
.shift-lock { background: #fdecea; color: #c2261b; border: 1px solid #f1c4c0; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }

/* 日カードの時間帯表示 */
.shift-day.is-weekend .shift-day-date { color: #c2261b; }
.shift-day-band { font-size: 12px; color: #2a6048; font-weight: 700; }
.avail-seg button { flex: 1; min-width: 0; text-align: center; }
.band-row button { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; gap: 1px; }
.band-row .band-sub { font-size: 10px; opacity: .8; font-weight: 600; }
.band-custom { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.band-custom label { font-size: 12px; font-weight: 700; color: var(--muted, #5b6573); }
.band-custom .select.sm { width: auto; flex: 1; min-width: 84px; padding: 8px 10px; font-size: 14px; }
.band-custom .band-dash { color: var(--muted, #5b6573); }

/* テンプレート */
.tpl-card .tpl-save { margin-bottom: 6px; }
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line, #d3d9e2); border-radius: 10px; }
.tpl-name { flex: 1; font-weight: 700; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-acts { display: flex; gap: 4px; flex-shrink: 0; }
.tpl-empty, .tpl-note { font-size: 12px; color: var(--muted, #5b6573); margin: 6px 0 0; }

/* トースト（保存・提出のフィードバック） */
.ss-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  max-width: 88%; background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 80; text-align: center; }

/* ---- マイページ ---- */
.mypage-top { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line, #d3d9e2); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.mypage-ic { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line, #d3d9e2); }
.mypage-ic-ph { display: grid; place-items: center; background: #2a6048; color: #fff; font-weight: 800; font-size: 26px; }
.mp-name { font-weight: 800; font-size: 17px; }
.mp-code { font-size: 12px; color: var(--muted, #5b6573); }
.mp-ic-btn { position: relative; background: transparent; border: 0; padding: 0; cursor: pointer; flex: 0 0 auto; }
.mp-ic-edit { position: absolute; left: 0; right: 0; bottom: -4px; margin: 0 auto; width: max-content;
  background: #2a6048; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; line-height: 1.4; }
.mp-id { min-width: 0; }
.mp-kv dd { word-break: break-word; }
.mp-quals { display: flex; flex-wrap: wrap; gap: 4px; }
.mp-edit-btn { margin-top: 12px; width: 100%; box-sizing: border-box; }
.mp-logout { margin-top: 18px; }

/* ボタン基本（theme.btn が無い箇所の保険） */
.btn { display: inline-grid; place-items: center; border: 1px solid var(--line, #d3d9e2); background: #fff; color: var(--text, #1f2937); border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn-primary { background: #2a6048; color: #fff; border-color: #2a6048; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger, #c2261b); color: #fff; border-color: var(--danger, #c2261b); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
