* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "PingFang TC", sans-serif; background: #f4f5f7; color: #1a1d24; }
.hidden { display: none !important; }
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
#login form { background: #fff; padding: 32px; border-radius: 14px; width: 300px; display: grid; gap: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
#login h1 { font-size: 20px; text-align: center; }
input, select { padding: 10px; border: 1px solid #d4d7dd; border-radius: 8px; font-size: 16px; width: 100%; }
button { padding: 10px 14px; border: 0; border-radius: 8px; background: #1a3a6b; color: #fff; font-size: 15px; cursor: pointer; }
button.ghost { background: #e8eaef; color: #1a1d24; }
button.small { padding: 5px 9px; font-size: 13px; border-radius: 6px; }
button.on { background: #1a7a4a; }
button.warn { background: #b3372f; }
.err { color: #b3372f; font-size: 14px; min-height: 1em; }
#main { padding: 14px 14px 80px; max-width: 720px; margin: 0 auto; }
#tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid #e2e4e9; padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; background: none; color: #667; border-radius: 0; padding: 13px 0; font-size: 15px; }
#tabs button.active { color: #1a3a6b; font-weight: 700; }
h2 { font-size: 18px; margin: 10px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card.tap { cursor: pointer; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: #778; font-size: 13px; }
.name-link { color: #1a3a6b; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #e8eaef; }
.badge.green { background: #d9efe3; color: #16603a; }
.badge.red { background: #f6dedc; color: #8f2b24; }
.badge.orange { background: #fdeccf; color: #8a5a10; }
.roster-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f1f4; gap: 6px; flex-wrap: wrap; }
.roster-item:last-child { border-bottom: 0; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; }
.week-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.day-head { margin: 14px 0 6px; font-weight: 700; font-size: 15px; color: #445; }
.search { margin-bottom: 10px; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.field-row label { font-size: 12px; color: #667; }
table.grid { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
table.grid th, table.grid td { border: 1px solid #e8eaef; padding: 4px 7px; text-align: center; }
table.grid .g-name { text-align: left; position: sticky; left: 0; background: #fff; min-width: 86px; }
table.grid thead th { background: #f4f5f7; font-weight: 600; }
table.grid thead th.g-name { z-index: 1; }
.g-ok { color: #16603a; font-weight: 700; }
.g-leave { color: #8a5a10; }
.g-no { color: #8f2b24; }
.g-mk { color: #1a3a6b; font-weight: 700; }
.g-closed { color: #8f2b24; }
.g-mkrow td { background: #fafbfd; }
dialog { border: 0; border-radius: 14px; padding: 18px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(0,0,0,.35); }
