/* マエダプラスターズ 現場割当表。紙の割当表に近い見た目・押すところは大きく（2026-12-03） */
:root {
  --p: #1f3b63; --p-d: #142a4a; --p-l: #e7edf6;
  --red: #C1272D; --yel: #fff4c2; --yel-t: #8a6200;
  --bg: #eceae6; --paper: #fff; --line: #555; --line-l: #ccc;
  --txt: #1a1a1a; --sub: #666; --left: #fbfaf6;
  --r: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums;
  font-family: "Hiragino Sans", "Meiryo UI", Meiryo, "Noto Sans JP", sans-serif; }
[hidden] { display: none !important; }
h2 { font-size: 1.1rem; margin: 0 0 10px; color: var(--p); }
h3 { font-size: 1rem; margin: 14px 0 6px; }
.hint { color: var(--sub); font-size: .85rem; }
.center { text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.warn { color: var(--red); font-weight: 700; }

button, .btn { font: inherit; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1.5px solid #999; background: #fff; color: var(--txt); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
button.p { background: var(--p); border-color: var(--p); color: #fff; font-weight: 700; }
button.q { background: transparent; border-color: transparent; color: var(--p); }
button.danger { color: var(--red); border-color: #e0a0a0; }
button.small { min-height: 34px; padding: 3px 10px; font-size: .88rem; }
button.wide { width: 100%; margin-top: 14px; }
button:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: .85rem; color: var(--sub); margin: 10px 0 4px; }
input, select, textarea { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1px solid #aaa; border-radius: var(--r); background: #fff; color: var(--txt); width: 100%; max-width: 100%; }
textarea { min-height: 70px; }
input[type=checkbox] { width: 24px; min-height: 24px; height: 24px; accent-color: var(--p); vertical-align: middle; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31,59,99,.25); border-color: var(--p); }
.msg { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }

/* ログイン */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.lcard { background: #fff; border: 1px solid #bbb; border-radius: 10px; padding: 20px 22px; width: 100%; max-width: 380px; }
.sheet-title { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; letter-spacing: .6em; font-size: 22px; text-align: center; font-weight: 700; padding: 6px 0 4px; }

/* 上の帯 */
header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: 52px; background: var(--p); color: #fff; padding: 0 12px; flex-wrap: wrap; }
header .ttl { font-size: 1.05rem; letter-spacing: .1em; }
header .sp { flex: 1; }
header button.q { color: #fff; }
#nav, #nav2 { display: flex; gap: 2px; overflow-x: auto; }
#nav button, #nav2 button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #fff; opacity: .75; min-height: 50px; padding: 0 10px; white-space: nowrap; }
#nav { font-weight: 700; }
#nav2 { border-left: 1px solid rgba(255,255,255,.3); padding-left: 6px; font-size: .92rem; }
#nav button.on, #nav2 button.on { opacity: 1; border-bottom-color: #fff; font-weight: 700; }
.umenu { position: relative; }
.ubtn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); min-height: 36px; padding: 2px 10px; font-size: .9rem; }
.ulist { position: absolute; right: 0; top: 42px; background: #fff; border: 1px solid #ccc; border-radius: var(--r); box-shadow: 0 4px 14px rgba(0,0,0,.15); min-width: 200px; z-index: 40; }
.ulist button { display: block; width: 100%; border: 0; border-radius: 0; text-align: left; justify-content: flex-start; }

main { max-width: 1280px; margin: 0 auto; padding: 12px 12px 120px; }
.box { background: #fff; border: 1px solid #bbb; border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.bar .sp { flex: 1; }
.daynav { display: flex; align-items: center; gap: 6px; }
.daynav button { width: 44px; padding: 0; font-size: 20px; }
.daynav b { font-size: 1.15rem; min-width: 7.5em; text-align: center; }
.daynav input[type=date] { width: auto; min-height: 40px; }

/* ===== 職人さんのスマホ ===== */
.staff { max-width: 560px; margin: 0 auto; }
.card { margin: 10px 0; background: #fff; border: 1.5px solid #333; }
.card .h { display: grid; grid-template-columns: 1.2fr 1fr 1fr; border-bottom: 1.5px solid #333; }
.card .h > div { padding: 6px 8px; border-right: 1px solid #999; min-width: 0; overflow-wrap: anywhere; }
.card .h > div:last-child { border-right: 0; }
.lbl { display: block; font-size: 11px; color: #777; }
.val { font-size: 16px; font-weight: 700; }
.val small { font-weight: 400; font-size: 12px; color: #555; }
.mine { outline: 3px solid var(--red); outline-offset: -1px; }
.tag { display: inline-block; background: var(--red); color: #fff; font-size: 11px; border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: 2px; font-weight: 400; }
.sec { padding: 8px; border-bottom: 1px solid #ccc; }
.sec:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { border: 1.5px solid #999; border-radius: 20px; padding: 6px 13px; font-size: 16px; background: #fff; min-height: 40px; }
.chip.on { background: var(--p); border-color: var(--p); color: #fff; }
.chip.add { border-style: dashed; color: #555; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f3f1ec; border-radius: 6px; padding: 4px 4px 4px 10px; margin: 4px 0; font-size: 17px; }
.line button { min-height: 36px; padding: 0 10px; color: #888; border-color: #ccc; }
.cnt { display: flex; align-items: center; gap: 10px; }
.cnt button { width: 46px; height: 46px; border-radius: 50%; font-size: 22px; padding: 0; }
.cnt .n { font-size: 24px; font-weight: 700; min-width: 44px; text-align: center; }
.addbtn { display: flex; width: 100%; border: 1.5px dashed #999; background: #fff; padding: 8px; font-size: 16px; }
.picker { border: 1px solid #ccc; border-radius: 8px; padding: 8px; margin-top: 8px; background: #fcfcfa; }
.cardbox { display: flex; gap: 8px; }
.cardbox label { flex: 1; display: flex; align-items: center; gap: 8px; border: 1.5px solid #999; border-radius: 8px; padding: 10px; font-size: 16px; color: var(--txt); margin: 0; }
.save { display: block; width: 100%; background: var(--red); border-color: var(--red); color: #fff; padding: 14px; font-size: 19px; font-weight: 700; margin: 12px 0 6px; }
.saved { color: #2e7d32; font-size: .9rem; text-align: center; }
.other { border-color: #ccc; color: #444; }
.other .h { border-bottom: 0; }
.note { font-size: 13px; color: #555; margin: 14px 0 4px; }
.readonly-line { font-size: 15px; }

/* ===== 事務所（紙と同じ表） ===== */
.paper { background: #fff; border: 1px solid #bbb; box-shadow: 0 2px 6px rgba(0,0,0,.08); padding: 10px 12px 14px; }
.tblwrap { overflow-x: auto; }
table.sheet { border-collapse: collapse; width: 100%; min-width: 980px; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 5px 6px; vertical-align: top; font-size: 14px; }
.sheet th { background: #f4f2ec; font-size: 12px; font-weight: 700; }
.sheet td.l { background: var(--left); }
.sheet td.y { background: var(--yel); }
.sheet tr.click td { cursor: pointer; }
.sheet tr.click:hover td { background: #eef3fb; }
.conv { color: var(--p); font-size: 12px; display: block; }
.conv.ng { color: var(--red); }
.money { text-align: right; white-space: nowrap; }
.mini { font-size: 11px; color: #666; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #555; margin: 8px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; border: 1px solid #999; }
table.list { border-collapse: collapse; width: 100%; }
.list th, .list td { border-bottom: 1px solid #ddd; padding: 6px 8px; text-align: left; font-size: 14px; vertical-align: top; }
.list th { background: #f4f2ec; font-size: 12px; }
.list td.num, .list th.num { text-align: right; white-space: nowrap; }
.list tr.off td { color: #999; }
.list tr.sum td { font-weight: 700; border-top: 2px solid #999; }
.pill { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; background: #eee; color: #555; }
.pill.y { background: var(--yel); color: var(--yel-t); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }

/* ダイアログ・知らせ */
.dlg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: grid; place-items: center; padding: 12px; }
.dlg-in { background: #fff; border-radius: 10px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 16px 18px; }
/* 工程表の取り込みの枠（ドラッグ＆ドロップ・押して選ぶ） */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 130px; margin-top: 10px; padding: 18px; border: 2px dashed #9aa6b8; border-radius: 10px; background: #f7f9fc; color: var(--txt); text-align: center; cursor: pointer; }
.drop b { font-size: 1.05rem; color: var(--p); }
.drop span { font-size: .88rem; color: var(--sub); }
.drop:hover, .drop:focus-visible { border-color: var(--p); outline: none; }
.drop.over { border-color: var(--p); border-style: solid; background: var(--p-l); }
.drop.over * { pointer-events: none; }
.dlg-x { position: sticky; top: 0; float: right; z-index: 5; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: -6px -8px 0 8px; border-radius: 50%; border: 1px solid #bbb; background: #fff; font-size: 20px; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; max-width: 92vw; }
.toast.err { background: var(--red); }
.busy { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: var(--p); color: #fff; padding: 6px 14px; border-radius: 8px; z-index: 60; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; border: 1px solid #bbb; border-radius: 18px; padding: 4px 10px; margin: 0; color: var(--txt); font-size: 15px; }
.skel { height: 60px; background: #f2f2f2; border-radius: 8px; margin: 8px 0; }
.empty { text-align: center; color: #666; padding: 30px 10px; }
@media print { header, .bar, .noprint { display: none !important; } body { background: #fff; } .paper { box-shadow: none; border: 0; } }

/* 工程表（2026-12-04・堀工務店の見本から流用。色の名前だけこのアプリに合わせた） */
.kt-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .85rem; color: var(--sub); margin-bottom: 8px; }
.kt-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid #bbb; }
.kt-legend i.work { background: var(--p); border-color: var(--p); } .kt-legend i.off { background: #e2e0da; } .kt-legend i.today { border: 2px solid var(--red); }
.kt-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #bbb; border-radius: var(--r); }
.kt-tbl { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.kt-tbl th, .kt-tbl td { padding: 0; border-bottom: 1px solid #bbb; border-right: 1px solid #EEF1F5; }
.kt-tbl td { width: 26px; min-width: 26px; height: 26px; }
.kt-tbl .kt-day { width: 26px; min-width: 26px; text-align: center; font-weight: 600; line-height: 1.1; padding: 3px 0; background: #f3f6fb; }
.kt-tbl .kt-day small { display: block; font-weight: 400; font-size: .7rem; color: var(--sub); }
.kt-tbl .kt-day.sun small { color: var(--red); } .kt-tbl .kt-day.sat small { color: #1F5FBF; }
.kt-tbl .kt-mon { text-align: left; padding: 4px 6px; background: var(--p-l); color: var(--p); }
.kt-tbl .kt-name { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; white-space: nowrap; padding: 4px 10px; min-width: 150px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid #bbb; font-weight: 600; }
.kt-tbl thead .kt-name { background: var(--p-l); z-index: 2; }
.kt-tbl .kt-task { font-weight: 400; padding-left: 20px; }
.kt-tbl tr.kt-grp .kt-name { color: var(--p); background: #f3f6fb; }
.kt-tbl tr.kt-grp td { background: #f3f6fb; }
.kt-tbl .off { background: #e2e0da; } .kt-tbl tr.kt-grp td.off { background: #e2e0da; }
.kt-tbl td.work { background: var(--p); }
.kt-tbl .today { box-shadow: inset 2px 0 0 var(--red), inset -2px 0 0 var(--red); }
.kt-notes { margin: 10px 0 0; padding-left: 1.2em; font-size: .85rem; color: var(--sub); }
@media (max-width: 640px) { .kt-tbl .kt-name { min-width: 120px; max-width: 140px; } }
.kt .bar { margin-bottom: 8px; }
