[hidden] { display: none !important; }
:root { --g: #1a7f4b; --y: #d98e04; --r: #c62828; --bg: #f4f6f5; --fg: #1d2421; --mut: #6b7570; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); padding-bottom: 76px; }
header { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--g); color: #fff; }
header .brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
header .brand img { height: 26px; background: #fff; border-radius: 14px; padding: 2px 4px; }
.login .logo { width: 100%; max-width: 280px; display: block; margin: 4px auto 16px; }
.login h1 { text-align: center; margin: 0; }
.login > .muted { text-align: center; }
header #who { margin-left: auto; font-size: 13px; opacity: .9; text-align: right; }
header select { max-width: 45%; font-size: 14px; border-radius: 8px; border: 0; padding: 4px; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; font-size: 13px; }
main { padding: 12px; max-width: 720px; margin: 0 auto; }
nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 6px; padding: 8px; background: #fff; box-shadow: 0 -2px 8px #0002; }
nav#tabs button { flex: 1; padding: 12px 4px; border: 0; border-radius: 10px; background: #e8ecea; font-size: 15px; }
nav#tabs button.primary { background: var(--g); color: #fff; font-weight: 600; }
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px #0001; }
.login { max-width: 360px; margin: 40px auto; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--mut); }
input, select, textarea { width: 100%; padding: 11px; font-size: 16px; border: 1px solid #ccd3cf; border-radius: 8px; margin-top: 4px; background: #fff; color: var(--fg); }
button { font: inherit; cursor: pointer; }
button.primary, button.btn { padding: 11px 16px; border: 0; border-radius: 10px; background: var(--g); color: #fff; font-weight: 600; }
button.btn.sec { background: #e8ecea; color: var(--fg); }
button.btn.warn { background: var(--y); }
button.btn.danger { background: var(--r); }
button.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { border: 0; border-radius: 12px; padding: 14px; text-align: left; color: #fff; }
.tile b { display: block; font-size: 30px; }
.t-md { background: var(--y); } .t-rm { background: #e65100; } .t-ex { background: var(--r); } .t-soon { background: #546e7a; }
.tile.active { outline: 3px solid var(--fg); }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef1ef; }
.item:last-child { border-bottom: 0; }
.item img, .ph { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #e8ecea; flex: none; }
.item .t { flex: 1; min-width: 0; }
.item .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--mut); font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #fff; }
.b-ok { background: var(--g); } .b-markdown { background: var(--y); } .b-remove { background: #e65100; } .b-expired { background: var(--r); }
.days { font-weight: 700; font-size: 18px; text-align: right; min-width: 52px; }
.err { color: var(--r); min-height: 1em; }
.warnbox { background: #fff4e0; border-left: 4px solid var(--y); padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
.okbox { background: #e6f4ec; border-left: 4px solid var(--g); padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
#cam { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; max-height: 60vh; width: 100%; }
#cam video { width: 100%; height: 100%; object-fit: cover; }
#cam .frame { position: absolute; inset: 25% 12%; border: 3px solid #fff8; border-radius: 12px; }
.prod-head { display: flex; gap: 12px; align-items: center; }
.prod-head img, .prod-head .ph { width: 84px; height: 84px; }
h2 { font-size: 18px; margin: 4px 0 10px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; }
.seg { display: flex; gap: 6px; margin: 6px 0; }
.seg button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #ccd3cf; background: #fff; }
.seg button.on { background: var(--g); color: #fff; border-color: var(--g); }
header .brand small, .login h1 small { display: block; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; opacity: .85; line-height: 1; }
.login h1 small { font-size: 13px; color: var(--mut); margin-bottom: 4px; }
.camctl { margin: 8px 0 0; align-items: center; }
.camctl label { margin: 0; }
.camctl input[type=range] { padding: 0; border: 0; }
