:root {
  --navy: #14284b;
  --navy-2: #1f3a6b;
  --red: #c8102e;
  --bg: #f3f5f9;
  --card: #fff;
  --ink: #16202e;
  --muted: #5c6b80;
  --line: #d6dce6;
  --ok: #1d7a46;
  --warn: #b26a00;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.35; }
body { padding-bottom: env(safe-area-inset-bottom); }
#app { max-width: 640px; margin: 0 auto; padding: 0 0 96px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; min-height: 56px; }
.topbar h1 { font-size: 19px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { background: transparent; color: #fff; border: 0; font-size: 28px; line-height: 1; padding: 6px 12px 6px 4px; min-width: 44px; min-height: 44px; }
.chip { border: 0; border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 600; min-height: 36px; background: #2c4a7e; color: #fff; }
.chip.ok { background: var(--ok); }
.chip.warn { background: var(--warn); }
.chip.err { background: var(--red); }

#banners { position: sticky; top: 0; z-index: 6; }
.banner { padding: 10px 14px; font-size: 15px; font-weight: 600; text-align: center; }
.banner.test { background: #ffd23f; color: #3a2d00; }
.banner.info { background: #e7eefb; color: var(--navy); font-weight: 500; text-align: left; display: flex; gap: 10px; align-items: center; }
.banner.info button { margin-left: auto; }
.banner.red { background: var(--red); color: #fff; }

.pad { padding: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px; }
.card h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.row-card { display: block; width: calc(100% - 24px); text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin: 10px 12px; color: inherit; font: inherit; min-height: 64px; }
.row-card .t { font-weight: 700; }
.row-card .s { color: var(--muted); font-size: 15px; margin-top: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #e6ebf3; color: var(--navy); margin-right: 6px; }
.badge.red { background: #fde3e7; color: var(--red); }
.badge.ok { background: #dff3e8; color: var(--ok); }
.badge.warn { background: #fff0d6; color: var(--warn); }

label.f { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 15px; color: var(--navy); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 18px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 50px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #9db8e8; border-color: var(--navy-2); }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.err-text { color: var(--red); font-size: 14px; margin-top: 4px; font-weight: 600; }
.ok-text { color: var(--ok); font-size: 14px; margin-top: 4px; font-weight: 600; }

button, .btn { font: inherit; font-weight: 700; border-radius: 12px; border: 0; padding: 14px 16px; min-height: 52px; background: var(--navy); color: #fff; cursor: pointer; }
button.red, .btn.red { background: var(--red); }
button.ghost, .btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
button.small { min-height: 40px; padding: 8px 12px; font-size: 15px; }
button:disabled { opacity: .5; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn input { display: none; }
.big { width: 100%; margin-top: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { flex: 1 1 28%; min-width: 80px; background: #fff; color: var(--navy); border: 1.5px solid var(--line); padding: 12px 8px; min-height: 52px; }
.pill.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pill.on.red { background: var(--red); border-color: var(--red); }
.pill.off-required { border-color: var(--red); }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #dfe5ee; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .st { position: absolute; left: 4px; bottom: 4px; font-size: 11px; padding: 2px 6px; border-radius: 999px; background: rgba(20,40,75,.85); color: #fff; }
.ph .st.up { background: rgba(29,122,70,.9); }
.ph .x { position: absolute; right: 4px; top: 4px; min-height: 32px; width: 32px; padding: 0; border-radius: 999px; background: rgba(0,0,0,.6); }

.info { background: #eef3fb; border: 1px solid #cfdcf1; border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.info.tempered { background: #fff1d6; border-color: #f0cf8a; }
.info.bad { background: #fde7ea; border-color: #f2b5bf; }
.missing { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1.5px solid #f2b5bf; margin-top: 8px; font-weight: 600; }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
table.sm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sm td, table.sm th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.login { padding: 24px 16px; }
.login .logo { text-align: center; margin: 16px 0 24px; }
.login .logo img { width: 96px; height: 96px; border-radius: 22px; }
.login h1 { text-align: center; color: var(--navy); margin: 8px 0 4px; }
.code { letter-spacing: .5em; text-align: center; font-size: 28px; }
.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 4; box-shadow: 0 6px 16px rgba(0,0,0,.25); border-radius: 999px; padding: 16px 22px; background: var(--red); }
.spacer { height: 8px; }

.tc { text-align: center; }
.flex { display: flex; }
.adder { flex: 1; margin: 4px; }
.mt6 { margin-top: 6px; }
.mt8 { margin-top: 8px; }
.rc { width: 100%; margin: 8px 0; }
.wide { width: calc(100% - 24px); margin: 12px; }
.warnb { border-color: #f0cf8a; }
.pad16 { padding: 0 16px; }
.updbtn { display: block; width: 100%; border: 0; font: inherit; min-height: 48px; }
