:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --brand: #1a56db;
  --brand-dark: #1e40af;
  --ok: #047857;
  --err: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 420px; }
header.bar {
  background: var(--brand-dark);
  color: #fff;
  padding: 14px 16px;
}
header.bar .wrap { padding: 0 16px; display: flex; justify-content: space-between; align-items: center; }
header.bar h1 { font-size: 16px; margin: 0; font-weight: 600; }
header.bar a { color: #dbeafe; font-size: 13px; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { height: 38px; width: auto; border-radius: 6px; display: block; }
.logo-lg { display: block; height: 96px; width: auto; margin: 0 auto 12px; border-radius: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
h2 { font-size: 18px; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0;
  padding: 12px 18px; font-size: 15px; font-weight: 600; border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn.wide { width: 100%; text-align: center; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 10px 0; }
.alert.err { background: #fef2f2; color: var(--err); border: 1px solid #fecaca; }
.alert.ok { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.pill { display:inline-block; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:600; }
.pill.on { background:#ecfdf5; color:var(--ok); }
.pill.off { background:#fef2f2; color:var(--err); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.grid th { background: #f8fafc; font-size: 12px; }
.item-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; background: #fafafa; }
.item-card .hd { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.item-card .hd .n { font-weight:700; color: var(--brand-dark); }
.item-photos { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.item-photos > label { display:block; }
.muted { color: var(--muted); font-size: 12px; }
.sig-wrap { border: 1px dashed #94a3b8; border-radius: 8px; background:#fff; }
canvas.sig { width: 100%; height: 120px; display:block; touch-action: none; }
.sig-actions { display:flex; justify-content:flex-end; padding:6px; }
.sig-entry { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #fafafa; }
.sig-entry .hd { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.photo-grid { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.photo-thumb { position:relative; width:92px; height:92px; border-radius:8px; overflow:hidden; border:1px solid var(--line); background:#eef1f4; }
.photo-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-thumb .rm { position:absolute; top:2px; right:2px; width:22px; height:22px; border:0; border-radius:50%; background:rgba(17,24,39,.78); color:#fff; font-size:15px; line-height:22px; text-align:center; cursor:pointer; padding:0; }
.section-title { font-size: 15px; font-weight: 700; margin: 22px 0 6px; }
.footer { text-align:center; color: var(--muted); font-size: 12px; padding: 24px 0; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
