:root {
  --bg: #0b1120;
  --bg-soft: #101827;
  --panel: rgba(17, 24, 39, 0.92);
  --line: #334155;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #38bdf8;
  --brand-2: #2563eb;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
}
a { color: inherit; text-decoration: none; }
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0 20px;
  flex-wrap: wrap;
}
.brand {
  font-size: 24px;
  font-weight: 700;
}
.brand small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nav a, .btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.btn.primary, button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.hero, .card, .panel {
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}
.hero {
  padding: 24px;
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 34px;
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.card, .panel { padding: 20px; }
.card h2, .panel h2, .card h3 {
  margin: 0 0 12px;
}
.muted { color: var(--muted); }
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #0b1220;
}
.metric .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.metric .value {
  font-size: 28px;
  font-weight: 700;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.module-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #0b1220;
  display: grid;
  gap: 12px;
}
.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
textarea, input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 180px; resize: vertical; }
.field-grid {
  display: grid;
  gap: 12px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.qr-output {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #020617;
  display: grid;
  place-items: center;
  padding: 18px;
}
.qr-output img, .qr-output canvas {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  max-width: 100%;
  height: auto;
}
.dropzone {
  min-height: 160px;
  border: 1.5px dashed #47627f;
  border-radius: 16px;
  background: #06101f;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  color: var(--muted);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone.active {
  border-color: var(--brand);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}
.dropzone input[type="file"] {
  display: none;
}
.dropzone strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}
.scan-preview {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: none;
}
.status {
  font-size: 13px;
  color: var(--muted);
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: #cbd5e1;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}
.iframe-shell {
  width: 100%;
  min-height: 78vh;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
}
.iframe-shell iframe {
  width: 100%;
  min-height: 78vh;
  border: 0;
}
@media (max-width: 960px) {
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 12; }
  .two-col { grid-template-columns: 1fr; }
}
