:root {
  --bg: #f4f6f9; --card: #fff; --ink: #18202b; --muted: #5f6b7a; --line: #d8dee6;
  --brand: #1f3b63; --brand-ink: #fff; --accent: #2f6fdb; --ok: #1d7a46; --bad: #b42318; --warn: #a15c00;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
.muted { color: var(--muted); } .pad { padding: 16px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: var(--brand-ink);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 6px; background: #fff; }
.net { margin-left: auto; font-size: 13px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.15); }
.net.off { background: #f5b84a; color: #3d2600; }
.me { color: inherit; text-decoration: none; font-size: 22px; padding: 2px 6px; }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 120px; }
h2 { font-size: 20px; margin: 18px 0 10px; }
h3 { font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.newgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.newgrid button { min-height: 64px; text-align: left; font-weight: 600; }
@media (max-width: 380px) { .newgrid { grid-template-columns: 1fr; } }

a.btn { text-decoration: none; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.btn, button { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger, button.danger { color: var(--bad); border-color: #f0c4c0; }
button:disabled { opacity: .5; }

.search { width: 100%; margin-bottom: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: block; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 8px; color: inherit; text-decoration: none; }
.list .t { font-weight: 600; }
.list .s { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #eef2f7; color: var(--muted); }
.tag.Pass { background: #e3f4ea; color: var(--ok); } .tag.Fail { background: #fde8e6; color: var(--bad); }
.tag.unsynced { background: #fff2dc; color: var(--warn); }

/* form */
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 12px; overflow: hidden; }
.section > summary { list-style: none; padding: 14px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: "▾"; color: var(--muted); }
.section:not([open]) > summary::after { content: "▸"; }
.section .body { padding: 0 14px 14px; }
.field { margin: 0 0 14px; }
.field > label, .field > .lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input[readonly] { background: #f1f4f8; color: var(--muted); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-width: 72px; }
.seg.vertical { flex-direction: column; } .seg.vertical button { text-align: left; }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.seg button.on.Fail, .seg button.on.Leaked, .seg button.on.Non-Compliance { background: var(--bad); border-color: var(--bad); }
.seg button.on.Pass { background: var(--ok); border-color: var(--ok); }

.chk { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; min-height: 44px; }
.chk input { width: 24px; height: 24px; min-height: 0; }

.grid-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.grid-row .rl { font-weight: 700; margin-bottom: 6px; }
.grid-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.grid-cols label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }

.sigbox { border: 1px dashed var(--muted); border-radius: 10px; background: #fff; touch-action: none; }
.sigbox canvas { width: 100%; height: 150px; display: block; }
.sigimg { max-width: 100%; height: 90px; display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; justify-content: center; }
.bar > * { flex: 1; max-width: 240px; }
.status { font-size: 13px; color: var(--muted); text-align: center; margin: -4px 0 10px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom));
  background: #18202b; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }

.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.login label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.login-logo { width: 100%; max-width: 260px; justify-self: center; margin: 8px 0; }
.err { color: var(--bad); margin: 0; }
table.users { width: 100%; border-collapse: collapse; } table.users td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
