:root {
  --bg: #f4f6fb; --card: #fff; --text: #172033; --muted: #6b7489; --line: #e3e7f0;
  --brand: #1f5eff; --ok: #12a150; --warn: #d98a00; --bad: #d93a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--brand); color: #fff; }
.brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.2); }
.status { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.status #statusText { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }
main { padding: 16px; max-width: 640px; margin: 0 auto; padding-bottom: 96px; }
h1 { font-size: 20px; margin: 4px 0 14px; }
.search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-bottom: 12px; background: var(--card); }
.card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: #dfe6ff; color: var(--brand); display: grid;
  place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { flex: 1; min-width: 0; }
.card .name { font-weight: 600; }
.card .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.badge.pending { background: #fff2d6; color: var(--warn); }
.badge.synced { background: #dcf5e6; color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.fab { position: fixed; right: 18px; bottom: 54px; width: 56px; height: 56px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 30px; display: grid; place-items: center; text-decoration: none; box-shadow: 0 6px 18px rgba(31,94,255,.35); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 10px; margin-top: 18px; }
.btn { flex: 1; padding: 12px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-align: center; text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--card); color: var(--bad); border: 1px solid #f3c6c6; }
.link { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; padding: 0; }
.photo { margin-top: 6px; display: flex; gap: 12px; align-items: center; }
.photo img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.big-photo { width: 100%; max-height: 340px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 12px; }
.detail { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.detail div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail div:last-child { border-bottom: 0; }
.detail span:first-child { color: var(--muted); }
.detail span:last-child { text-align: right; word-break: break-word; }
.note { font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #172033; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 90%; z-index: 20; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12px; color: var(--muted);
  padding: 8px; background: var(--bg); border-top: 1px solid var(--line); }
