/* 肉そば あつよし 採用・入社手続きシステム
   公開画面：スマホ縦画面を基準／管理画面：店舗の iPad（横・縦）と本社 PC */
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b665e;
  --line: #e4ded3;
  --brand: #1f2a2e;
  --accent: #c8671c;
  --accent-ink: #ffffff;
  --ok: #2f7d4a; --ok-bg: #e7f3eb;
  --warn: #8a5a00; --warn-bg: #fdf3dc;
  --danger: #b3261e; --danger-bg: #fbe9e7;
  --info: #24527a; --info-bg: #e8f0f8;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px; line-height: 1.7;
}
a { color: var(--info); }
h1 { font-size: 1.3rem; margin: 0 0 14px; }
h2 { font-size: 1.05rem; margin: 18px 0 10px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 14px 0 8px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.wide { max-width: 1180px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.lead { color: var(--muted); }
.small { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; word-break: break-all; }
.narrow { max-width: 420px; margin: 24px auto; }
.inline { display: inline; }

/* 公開画面のヘッダー */
.pub-head { background: var(--brand); color: #fff; padding: 12px 16px; display: flex; align-items: baseline; gap: 10px; }
.pub-head .brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .05em; }
.pub-head .sub { opacity: .8; font-size: .9rem; }
.pub-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 0 32px; }

/* フォーム */
.form label { display: block; margin: 0 0 12px; font-weight: 600; font-size: .95rem; }
.form label.sub { font-weight: 400; }
.form input[type=text], .form input[type=tel], .form input[type=email], .form input[type=date],
.form input[type=datetime-local], .form input[type=password], .form input[type=number], .form select, .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 1px solid #cfc8bb; border-radius: 8px; background: #fff; color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.req { display: inline-block; font-size: .7rem; background: var(--danger); color: #fff; border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }
.opt { display: inline-block; font-size: .7rem; background: #8f877a; color: #fff; border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }
.err { color: var(--danger); font-size: .88rem; margin: -6px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0 !important; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; min-width: 48px; text-align: center; padding: 9px 14px; border: 1px solid #cfc8bb; border-radius: 999px; background: #fff; font-weight: 500; cursor: pointer; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
label.check.strong { background: var(--warn-bg); padding: 12px; border-radius: 8px; margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; left: -9999px; }

button, .btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid #cfc8bb;
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; min-height: 44px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--danger); border-color: var(--danger); background: #fff; }
button.block { display: block; width: 100%; margin-top: 8px; }
button.small { padding: 4px 10px; min-height: 34px; font-size: .85rem; }
button.link { border: 0; background: none; color: var(--info); text-decoration: underline; padding: 0; min-height: 0; font-weight: 400; }
button.link.light { color: #fff; }
button[disabled] { opacity: .45; cursor: not-allowed; }

.flash { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; border: 1px solid transparent; }
.flash-success { background: var(--ok-bg); border-color: #c4e1cd; }
.flash-info { background: var(--info-bg); border-color: #c9d9ea; }
.flash-warn { background: var(--warn-bg); border-color: #f0dca7; }
.flash-error { background: var(--danger-bg); border-color: #f2c4bf; }
.notice-msg { background: var(--danger-bg); border: 1px solid #f2c4bf; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.card.done { text-align: center; padding: 28px 16px; }
.card.done .store { color: var(--muted); }

/* 書類（通知書・誓約書）：文面は書かれたとおりの改行・字下げで表示 */
.doc-text { white-space: pre-wrap; word-break: break-word; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-size: .95rem; line-height: 1.85;
  background: #fffdf8; border: 1px solid var(--line); border-radius: 8px; padding: 14px; max-height: 60vh; overflow-y: auto; }
.sig-inline { height: 48px; vertical-align: middle; }
.sig-placeholder { color: var(--muted); font-family: sans-serif; font-size: .85rem; }
.sigpad { border: 2px dashed #b9b0a1; border-radius: 10px; background: #fff; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; touch-action: none; }
.sig-thumb { max-width: 220px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 10px 6px 0; vertical-align: top; width: 7.5em; font-size: .9rem; }
table.kv td { padding: 6px 0; word-break: break-word; }

/* 管理画面 */
.adm-head { background: var(--brand); color: #fff; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: max(10px, env(safe-area-inset-top)); }
.adm-head .brand { color: #fff; text-decoration: none; font-weight: 700; }
.adm-head .who { font-size: .9rem; display: flex; gap: 12px; align-items: center; }
.adm-nav { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; -webkit-overflow-scrolling: touch; }
.adm-nav a { padding: 12px 14px; text-decoration: none; color: var(--ink); white-space: nowrap; border-bottom: 3px solid transparent; min-height: 44px; }
.adm-nav a.on { border-bottom-color: var(--accent); font-weight: 700; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.tile .n { font-size: 2rem; font-weight: 700; color: var(--muted); }
.tile.has .n { color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 14px; } }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
/* 姓・名など2つ並べる入力（スマホでも横並び） */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 入社手続きの職歴（1件ずつ区切る） */
.work-row { border-top: 1px dashed var(--line); padding-top: 10px; }
/* 掛け持ち先の曜日ごとの勤務時間帯（曜日・開始・〜・終了の4列。幅390pxのスマホでも横スクロールなし） */
.sj-hours { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.sj-day { font-weight: 600; text-align: center; }
.sj-sep { color: var(--muted); }
.form .sj-hours input[type=time] { display: block; width: 100%; min-width: 0; margin: 0; padding: 9px 6px; font: inherit; font-weight: 400;
  border: 1px solid #cfc8bb; border-radius: 8px; background: #fff; color: var(--ink); }
.form .sj-hours input[type=time]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.row label { flex: 1 1 220px; margin-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
td.actions { margin: 0; }
.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 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: .82rem; color: var(--muted); font-weight: 600; background: #faf8f4; }
table.list.compact td { padding: 6px; font-size: .85rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbf7ef; }
tr.muted td { color: var(--muted); }
table.tasks td.state { width: 28px; font-weight: 700; color: var(--ok); font-size: 1.2rem; }
table.tasks tr.done td { color: var(--muted); }
.statusbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: #ece7de; color: var(--muted); margin-right: 4px; white-space: nowrap; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.card pre { white-space: pre-wrap; word-break: break-all; background: #f6f3ee; padding: 8px; border-radius: 6px; }
textarea.copy { width: 100%; font: inherit; font-size: .85rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #faf8f4; margin-bottom: 8px; }
details.card summary { cursor: pointer; font-weight: 600; }
code { background: #f0ece4; padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* iPad 縦（768〜）・横（1024〜） */
@media (min-width: 768px) {
  body.admin { font-size: 17px; }
  .wrap { padding: 20px 24px 60px; }
}

/* 使い方（help.php） */
.howto { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.howto > li { display: flex; gap: 12px; }
.howto > li::before { counter-increment: step; content: counter(step); flex: 0 0 2em; height: 2em; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; margin-top: 2px; }
.howto .card { flex: 1; min-width: 0; }
.howto h2 { font-size: 1.05rem; margin: 2px 0 8px; }
.howto p { margin: 6px 0; }
.howto ul { margin: 6px 0; padding-left: 1.3em; }


/* シフト（バイト用 /shift/ と管理画面 shift*.php） */
.shift-board th { white-space: nowrap; font-size: .85rem; color: var(--ink); background: none; }
.shift-board tr.sun th { color: var(--danger); }
.shift-board tr.sat th { color: var(--info); }
.shift-board td { padding: 4px 3px; width: 30%; }
.slot { display: block; text-align: center; border-radius: 8px; padding: 4px 2px; font-size: .82rem; line-height: 1.35; border: 1px solid var(--line); background: #fff; color: var(--muted); text-decoration: none; min-height: 44px; }
.slot .fl { display: block; font-size: .7rem; color: var(--muted); }
a.slot.open { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.slot.mine { background: var(--ok-bg); border-color: #c4e1cd; color: var(--ok); font-weight: 700; }
.slot.full { background: #f1eee8; }
.slot.off { background: #f6f3ee; color: #b3ab9d; }
table.shift-admin td { font-size: .85rem; min-width: 150px; }
table.shift-admin th.sun { color: var(--danger); }
table.shift-admin th.sat { color: var(--info); }
table.shift-admin td.short { background: var(--danger-bg); }
table.shift-admin td.closed { background: #f1eee8; color: var(--muted); }
table.shift-admin .cnt { font-weight: 700; }
table.shift-admin ul { margin: 2px 0 0; padding-left: 1.1em; }
table.shift-admin input[type=number] { width: 4.2em; padding: 4px; font: inherit; }
/* シフト画面：申告受付の行の「受付期間を変更する」（ボタンの見た目の折りたたみ） */
.schedule-edit { margin-top: 6px; }
.schedule-edit > summary { display: inline-block; list-style: none; cursor: pointer; padding: 4px 10px; min-height: 34px; font-size: .85rem; }
.schedule-edit > summary::-webkit-details-marker { display: none; }
.schedule-edit[open] > summary { margin-bottom: 6px; }
/* 勤怠差分（shift_kot.php）：差分の種類ごとに行の左端の色を変える（欠勤＝赤・予定外＝青・時刻ずれ＝黄） */
table.kot-diff td.sun { color: var(--danger); }
table.kot-diff td.sat { color: var(--info); }
table.kot-diff tr.kot-absent td:first-child { border-left: 4px solid var(--danger); }
table.kot-diff tr.kot-unplanned td:first-child { border-left: 4px solid var(--info); }
table.kot-diff tr.kot-time td:first-child { border-left: 4px solid var(--warn); }
.kot-summary .badge { font-size: .9rem; padding: 4px 12px; }
.kot-note { margin: 4px 0; }
.kot-guide ol, .kot-guide ul { margin: 4px 0 8px; padding-left: 1.4em; }
.kot-guide li { margin: 2px 0; }
.kot-hint { display: block; }
@media print {
  .adm-head, .adm-nav, .no-print, .flash { display: none !important; }
  .badge, table.kot-diff td:first-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 12px; }
  .wrap.wide { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  table.list th, table.list td { padding: 3px 4px; border: 1px solid #999; }
  table.shift-admin td.short { background: none; }
}
