:root {
  --border: #e5e7eb;
  --muted: #9ca3af;
  --text: #1f2937;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --canvas: #fafafa;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif; font-size: 15px; color: var(--text); background: var(--canvas); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.view { min-height: 100%; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0 16px 14px; }
.card-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.field-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; margin: 10px 0 6px; }
input, select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 16px; }
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: var(--blue); }
.btn-primary { background: var(--blue); color: #fff; border: 0; border-radius: 10px; height: 48px; font-weight: 600; font-size: 16px; }
.btn-primary:disabled { opacity: .6; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; height: 46px; font-weight: 600; }
.btn-block { display: block; width: calc(100% - 32px); margin: 16px; }
.card .btn-block { width: 100%; margin: 18px 0 0; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

.login-wrap { max-width: 420px; margin: 0 auto; padding-top: max(48px, env(safe-area-inset-top)); }
.brand { text-align: center; margin-bottom: 22px; }
.brand img { border-radius: 14px; }
.brand h1 { font-size: 26px; margin-top: 10px; }

.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--border); padding: max(12px, env(safe-area-inset-top)) 16px 12px; margin-bottom: 14px; }
.top-title { font-weight: 700; font-size: 17px; }
.net { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #dcfce7; color: var(--green); }
.net.off { background: #fef3c7; color: var(--amber); }
main { max-width: 560px; margin: 0 auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.status-card { text-align: left; }
.status-row { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px #dcfce7; }
.today { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.today-num { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }

.punch-btn { display: block; width: calc(100% - 32px); margin: 4px 16px 10px; height: 88px; border: 0; border-radius: 18px; color: #fff; font-size: 24px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 6px 18px rgba(0,0,0,.12); transition: transform .06s; }
.punch-btn:active { transform: scale(.98); }
.punch-btn:disabled { opacity: .6; }
.punch-in { background: var(--green); }
.punch-out { background: var(--red); }

.plist, .sheet { list-style: none; }
.plist li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
.plist li:first-child { border-top: 0; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.tag-in { background: #dcfce7; color: var(--green); }
.tag-out { background: #fee2e2; color: var(--red); }
.tag-q { background: #fef3c7; color: var(--amber); }

.sheet-head { display: flex; justify-content: space-between; align-items: baseline; }
.sheet-total { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.sheet-total span:first-child { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet li { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border); }
.sheet li b { font-variant-numeric: tabular-nums; }

.avatar { width: 64px; height: 64px; border-radius: 50%; background: #dbeafe; color: var(--blue); font-weight: 700; font-size: 24px; display: flex; align-items: center; justify-content: center; margin: 4px auto 8px; }
.pf-name { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.pf { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.pf dt { color: #6b7280; font-size: 13px; }
.pf dd { text-align: right; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; background: none; border: 0; height: 60px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tabbar button.active { color: var(--blue); }
.ti { font-size: 18px; line-height: 1; }

.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 90%; z-index: 5; }
