:root {
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --blue: #2f7ef7;
  --blue2: #1d63cf;
  --danger: #ff5a6b;
  --ok: #26d07c;
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, #152a5a, var(--bg));
  color: var(--text);
}
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.topbar-left, .topbar-center, .topbar-right { display: flex; align-items: center; }
.topbar-center { justify-content: center; }
.topbar-right { justify-content: flex-end; gap: 12px; }
.logo { max-height: 42px; width: auto; }
.logo-center { max-height: 48px; }
.logo-left, .logo-center { cursor: pointer; }
.username { font-weight: 600; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.title { font-size: 20px; font-weight: 700; margin: 2px 0 12px; }
.muted { color: var(--muted); }
.grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }
label { display:block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
select, input {
  width:100%; padding: 12px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.25);
  color: var(--text); outline: none; box-sizing: border-box;
}
.menu { display:flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.menu a {
  display:inline-flex; align-items:center; gap: 8px; padding: 12px 14px;
  border-radius: 14px; text-decoration:none; color: var(--text);
  border: 1px solid var(--border); background: rgba(0,0,0,0.18);
}
.menu a:hover { border-color: rgba(255,255,255,0.22); background: rgba(0,0,0,0.28); }
.primary {
  display:block; width: 100%; max-width: 520px; margin: 18px auto 0;
  padding: 18px 16px; font-size: 18px; font-weight: 800; border-radius: 18px;
  border: 0; cursor: pointer; color: white;
  background: linear-gradient(180deg, var(--blue), var(--blue2));
  box-shadow: 0 14px 35px rgba(47,126,247,0.25);
}
.primary:disabled { opacity: 0.65; cursor: not-allowed; }
.blink { animation: blink 0.9s infinite; }
@keyframes blink {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.25); transform: scale(1.01); }
}
.center { text-align:center; margin-top: 10px; }
.btn-link {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
}
/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display:none; align-items:center; justify-content:center; padding: 16px; z-index: 999;
}
.modal {
  width: min(720px, 100%); background: rgba(20,25,40,0.95);
  border: 1px solid rgba(255,255,255,0.16); border-radius: 18px; padding: 16px;
}
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal pre {
  white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 12px;
  color: rgba(255,255,255,0.90); margin: 10px 0 0;
}
.modal-actions { display:flex; justify-content:flex-end; gap: 10px; margin-top: 12px; }
.btn {
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer;
}
.ok-badge {
  display:inline-block; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(38,208,124,0.35); color: var(--ok);
  background: rgba(38,208,124,0.08); font-size: 12px; font-weight: 700;
}
.err-badge {
  display:inline-block; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(255,90,107,0.35); color: var(--danger);
  background: rgba(255,90,107,0.08); font-size: 12px; font-weight: 700;
}
/* Inventory specific */
.inv-layout { display: flex; gap: 14px; margin-top: 12px; }
.inv-left { width: 33%; min-width: 280px; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.inv-right { flex: 1; min-width: 0; }
.inv-list {
  border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px;
  height: 60vh; overflow: auto; background: #fff;
}
.inv-item { padding: 10px 10px; border-radius: 10px; cursor: pointer; color: #000; }
.inv-item:hover { background: #f3f4f6; }
.inv-item-label { font-size: 14px; line-height: 1.25; word-break: break-word; color: #000; }
.inv-coords { font-size: 13px; }
.inv-detail { margin-top: 10px; }
.inv-pre {
  white-space: pre-wrap; word-break: break-word; background: #0b1220;
  color: #e5e7eb; padding: 12px; border-radius: 12px; overflow: auto; max-height: 60vh;
}
@media (max-width: 900px) {
  .inv-layout { flex-direction: column; }
  .inv-left { width: 100%; max-width: none; }
  .inv-list { height: 40vh; }
}
@media (max-width: 640px) {
  .logo { max-height: 32px; }
  .logo-center { max-height: 36px; }
  .username { display: none; }
}