:root {
  --navy: #0b1f33; --navy-2: #13304d; --ink: #14202b; --muted: #5b6b7a; --line: #dde4ea;
  --bg: #f4f7fa; --card: #fff; --accent: #0e7c86; --accent-ink: #fff;
  --add: #1f7a3a; --take: #a8461b; --return: #2a5bab; --warn: #8a5a00;
  --r: 12px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
.top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; }
.brand svg { width: 30px; height: 30px; color: #5fd3dc; transform: rotate(-30deg); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: #a9c1d6; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.who { font-size: 13px; color: #cfe0ee; text-align: right; }
.who button { margin-left: 8px; }
.tabs { display: flex; background: var(--navy-2); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.tabs a { color: #cfe0ee; text-decoration: none; padding: 12px 16px; font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a.on { color: #fff; border-bottom-color: #5fd3dc; }
main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 16px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #c6d1db; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
button, .btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block; text-align: center; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid #b9d6d9; }
button.link { background: none; color: inherit; padding: 4px 6px; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .55; cursor: default; }
.search { position: sticky; top: 46px; z-index: 4; background: var(--bg); padding: 4px 0 10px; }
.search .row > * { flex: 1 1 160px; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.item:active { background: #eef4f7; }
.pn { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }
.qty { font-size: 22px; font-weight: 700; min-width: 54px; text-align: right; }
.qty small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.zero { color: #9aa7b2; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { font-size: 12px; background: #eaf2f5; color: #23495c; border-radius: 999px; padding: 2px 8px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.actions button { padding: 14px 6px; font-size: 16px; }
.a-add { background: var(--add); } .a-take { background: var(--take); } .a-return { background: var(--return); }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; color: #fff; }
.b-add { background: var(--add); } .b-take { background: var(--take); } .b-return { background: var(--return); }
.stock td.q { font-weight: 700; text-align: right; font-size: 18px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
tr.sel td { background: #e7f4f5; }
.log li { padding: 10px 0; border-bottom: 1px solid var(--line); list-style: none; }
.log { padding: 0; margin: 0; }
.log .meta { font-size: 13px; color: var(--muted); }
.sheet { position: fixed; inset: 0; background: rgba(8, 20, 33, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet > form { background: #fff; width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet > form { border-radius: 16px; } }
.sheet h2 { margin-top: 0; }
.sheet .row { margin-top: 14px; }
.sheet .row button { flex: 1; }
.stepper { display: flex; gap: 8px; }
.stepper button { width: 52px; font-size: 22px; padding: 6px; }
.stepper input { text-align: center; font-size: 20px; font-weight: 700; }
.toast { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; }
.toast.err { background: #8f1d1d; }
.linkbox { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: #f1f5f8; border-radius: 8px; padding: 10px; }
.signin { max-width: 560px; margin: 42px auto; padding: clamp(24px, 5vw, 42px); text-align: left; box-shadow: 0 18px 48px rgba(11, 31, 51, .11); border-top: 4px solid var(--accent); }
.signin h1 { margin: 12px 0 8px; font-size: clamp(27px, 5vw, 36px); letter-spacing: -.025em; }
.signin-lead { margin: 0 0 22px; color: #33495c; font-size: 17px; }
.status-pill { display: inline-block; border-radius: 999px; background: #dff4f3; color: #075e66; padding: 4px 10px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.signin-steps { display: grid; gap: 14px; margin: 24px 0; }
.signin-steps > div { display: grid; grid-template-columns: 32px 1fr; align-items: start; gap: 11px; }
.signin-steps b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; }
.signin-steps span { padding-top: 4px; color: #2f4354; }
.notice { margin: 18px 0; border-left: 4px solid #d08a19; border-radius: 8px; background: #fff6df; padding: 12px 14px; color: #594014; }
.access-btn { width: 100%; padding: 13px 18px; margin: 2px 0 10px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 4px 0 14px; }
.page-head h1 { margin: 2px 0 4px; font-size: clamp(24px, 4vw, 30px); letter-spacing: -.02em; }
.page-head p { margin: 0; max-width: 620px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.off { opacity: .55; }
.inventory-group { margin-bottom: 20px; }
.inventory-group h2 { margin: 0 0 8px; }
.inventory-card { padding: 0; overflow: hidden; }
.inventory-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; text-decoration: none; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.inventory-row:last-child { border-bottom: 0; }
.inventory-row small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.inventory-row .qty { font-size: 18px; }
.category-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
