/* Justice Lookup — unified admin panel.
   Dark navy admin chrome (matches listing-flow + stats pages).
   Mobile-first. Every interactive target >= 48px (fat-fingers rule). */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --navy: #faf6ec;
  --navy-d: #ffffff;
  --navy-dd: #f4efe4;
  --gold: #b0722a;
  --gold-d: #8f5a1f;
  --ink: #1d2a42;
  --muted: #5d6b82;
  --line: #e7ddc6;
  --green: #1e7d46;
  --red: #b3261e;
  --blue: #1e5a8a;
  --ivory: #faf6ec;
}
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--navy);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--gold); }

/* ---------- lock gate ---------- */
#gate {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center;
}
#gate .lock { font-size: 52px; margin-bottom: 14px; }
#gate h1 { font-size: 22px; color: var(--ink); margin-bottom: 8px; }
#gate p { font-size: 15px; color: var(--muted); margin-bottom: 20px; max-width: 340px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 22px;
  border-radius: 14px; border: 2px solid var(--gold);
  background: transparent; color: var(--gold);
  font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn.solid {
  background: linear-gradient(180deg, #e8c56a, #c9992e);
  color: var(--navy-dd); border-color: transparent;
}
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.ok { border-color: var(--green); color: var(--green); }
.btn.small { min-height: 48px; padding: 10px 16px; font-size: 15px; }
.btn:active { transform: scale(.97); }
.btnrow { display: flex; gap: 10px; margin-top: 14px; }
.btnrow .btn { flex: 1; }

/* ---------- shell ---------- */
#app { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy-dd); border-bottom: 2px solid var(--gold);
  padding: 10px 14px; display: flex; align-items: center; gap: 12px;
}
.topbar .crumb { font-size: 17px; font-weight: 800; color: var(--ink); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb .gold { color: var(--gold); }
.iconbtn {
  min-width: 52px; min-height: 52px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--navy-d);
  color: var(--ink); font-size: 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
#view { padding: 16px 14px 90px; max-width: 760px; margin: 0 auto; }

/* ---------- menu ---------- */
.mgroup { margin-bottom: 22px; }
.mgroup > h2 {
  font-size: 12px; letter-spacing: 2px; color: var(--muted);
  margin: 0 4px 8px; text-transform: uppercase;
}
.mitem {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--navy-d); border: 2px solid var(--line); border-radius: 16px;
  color: var(--ink); padding: 14px 16px; margin-bottom: 10px;
  font-size: 17px; font-weight: 600; font-family: inherit; cursor: pointer;
  min-height: 64px; text-align: left; text-decoration: none;
}
.mitem:active { border-color: var(--gold); }
.mitem .ico { font-size: 24px; flex: none; width: 34px; text-align: center; }
.mitem .t { flex: 1; }
.mitem .t small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.count {
  flex: none; min-width: 44px; min-height: 32px; padding: 4px 10px;
  border-radius: 999px; background: var(--navy-dd); border: 1px solid var(--gold);
  color: var(--gold); font-size: 15px; font-weight: 800; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.count.alert { background: #5a2323; border-color: var(--red); color: var(--red); }
.mitem .chev { color: var(--muted); font-size: 20px; }

/* ---------- cards / rows ---------- */
.card {
  background: var(--navy-d); border: 2px solid var(--line);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
}
.card h3 { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.card .meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--navy-d); border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; min-height: 64px;
}
.row .rt { flex: 1; min-width: 0; }
.row .rt b { display: block; font-size: 16px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rt small { font-size: 13px; color: var(--muted); }
.row .acts { display: flex; gap: 8px; flex: none; }
.mini {
  min-width: 52px; min-height: 48px; padding: 8px 12px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--navy-dd); color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.mini.go { border-color: var(--gold); color: var(--gold); }
.mini.ok { border-color: var(--green); color: var(--green); }
.mini.no { border-color: var(--red); color: var(--red); }
.mini:active { transform: scale(.95); }
.tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  border-radius: 8px; padding: 4px 8px; margin-right: 6px;
}
.tag.demo { background: #3a2f14; color: var(--gold); }
.tag.flag { background: #5a2323; color: var(--red); }
.tag.es { background: #1d3a5c; color: var(--blue); }
.tag.okk { background: #1d4a2a; color: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; }

/* ---------- dashboard counters ---------- */
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.stat {
  background: var(--navy-d); border: 2px solid var(--gold); border-radius: 16px;
  padding: 14px 6px; text-align: center;
}
.stat .n { font-size: 28px; font-weight: 800; color: var(--ink); }
.stat .n.in { color: var(--green); } .stat .n.out { color: var(--red); }
.stat .l { font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-top: 4px; }
.netbar {
  background: var(--navy-d); border: 2px solid var(--line); border-radius: 14px;
  padding: 12px; text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 18px;
}
.netbar.pos { color: var(--green); } .netbar.neg { color: var(--red); }
h2.sec { font-size: 15px; color: var(--gold); margin: 20px 0 10px; letter-spacing: .5px; }
p.note { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
p.note code { background: var(--navy-dd); padding: 2px 6px; border-radius: 6px; font-size: 12px; }

/* ---------- search / forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--line); border-radius: 12px; font-family: inherit;
  background: var(--ivory); color: #1c2a3a;
}
.field textarea { min-height: 120px; resize: vertical; }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input {
  flex: 1; min-height: 52px; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--line); border-radius: 12px; font-family: inherit;
  background: var(--ivory); color: #1c2a3a;
}

/* ---------- preview modal ----------
   RULE (Malcolm 2026-09-30): opens ONLY on explicit "Preview" tap.
   Never automatic, never unsolicited. He summons the window;
   it never summons him. */
#scrim {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 10, 18, .82);
  align-items: flex-end; justify-content: center;
}
#scrim.open { display: flex; }
.sheet {
  width: 100%; max-width: 760px; max-height: 92dvh;
  background: var(--navy-d); border: 2px solid var(--gold); border-bottom: none;
  border-radius: 20px 20px 0 0; overflow: hidden;
  display: flex; flex-direction: column;
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet .shead {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); flex: none;
}
.sheet .shead b { flex: 1; font-size: 16px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .sbody { overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.sheet .sbody iframe.pv {
  width: 100%; height: 56dvh; border: 1px solid var(--line);
  border-radius: 12px; background: #fff;
}
.sheet .sbody video.pv {
  width: 100%; border-radius: 12px; background: #000; max-height: 52dvh;
}
.sheet .sacts {
  flex: none; display: flex; gap: 10px; padding: 12px 14px 18px;
  border-top: 1px solid var(--line); background: var(--navy-dd);
}
.sheet .sacts .btn { flex: 1; }
.stars { color: var(--gold); font-size: 18px; letter-spacing: 2px; }

/* ---------- bottom nav ---------- */
#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--navy-dd); border-top: 2px solid var(--gold);
  display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#bottomnav button {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 11px; font-family: inherit; cursor: pointer;
  min-height: 56px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
#bottomnav button .bi { font-size: 22px; }
#bottomnav button.on { color: var(--gold); }

.snippet {
  background: var(--navy-dd); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: var(--blue);
  word-break: break-all; margin: 8px 0 12px; font-family: monospace;
}
.hidden { display: none !important; }

/* contact inbox */
.card.msg-new { border-color: var(--gold); }
.msg-body { white-space: pre-wrap; }
.card.msg .meta a { color: var(--blue); }
