:root {
  --bg: #0b0f15;
  --panel: #141b26;
  --panel-2: #101722;
  --border: rgba(255,255,255,0.08);
  --text: #e7edf7;
  --muted: #95a2b8;
  --accent: #5c9cff;
  --accent-2: #78b1ff;
  --ok: #19c37d;
  --warn: #f5b942;
  --err: #ef6767;
  --shadow: 0 16px 40px rgba(0,0,0,0.28);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #0b0f15 0%, #101722 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}
.landing-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}
h1, h2, h3 {
  margin: 0;
}
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.span-2 { grid-column: span 2; }
.card {
  background: rgba(20, 27, 38, 0.96);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.admin-grid {
  align-items: end;
}
label span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(12, 18, 28, 0.95);
  color: var(--text);
  outline: none;
}
textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(92,156,255,0.88);
  box-shadow: 0 0 0 3px rgba(92,156,255,0.12);
}
button, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
}
button.secondary, .link-button.secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text);
}
.actions { display: flex; align-items: center; gap: 10px; }
.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.wrap-actions { flex-wrap: wrap; }
.lookup-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lookup-row input { flex: 1; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.badge-ok { background: rgba(25,195,125,0.14); color: #77e0b4; }
.badge-wait { background: rgba(245,185,66,0.14); color: #ffd476; }
.badge-error { background: rgba(239,103,103,0.14); color: #ffb0b0; }
.notice {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.notice-error {
  background: rgba(239,103,103,0.14);
  border-color: rgba(239,103,103,0.20);
  color: #ffb0b0;
}
.notice-ok {
  background: rgba(25,195,125,0.14);
  border-color: rgba(25,195,125,0.20);
  color: #77e0b4;
}
.hidden { display: none !important; }
.result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.result-grid {
  display: grid;
  grid-template-columns: 1.5fr 280px;
  gap: 18px;
}
.result-data {
  display: grid;
  gap: 10px;
}
.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  align-items: start;
}
.kv span {
  color: var(--muted);
  font-size: 13px;
}
.kv strong { font-size: 14px; }
.mono { font-family: var(--mono); }
.break-all { word-break: break-all; }
.qr-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.qr-frame {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #0b1118;
  overflow: hidden;
}
.qr-frame img { width: 220px; height: 220px; object-fit: contain; }
.qr-placeholder { color: var(--muted); text-align: center; font-size: 13px; padding: 16px; }
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.checkbox input { width: auto; min-height: auto; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
.table-wrap th { color: var(--muted); background: rgba(255,255,255,0.02); }
.table-wrap tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center !important; }
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
}
.job-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.job-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}
.job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.landing-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  border-radius: 24px;
  background: rgba(20, 27, 38, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.landing-card h2 { font-size: 28px; }
.landing-card p { color: var(--muted); line-height: 1.7; }
.landing-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(92,156,255,0.12);
  color: #9dc6ff;
  font-size: 12px;
  font-weight: 800;
}
.landing-link {
  margin-top: auto;
  color: #9dc6ff;
  font-weight: 800;
}
@media (max-width: 980px) {
  .grid, .result-grid, .form-grid, .admin-grid, .landing-grid, .status-grid, .job-grid {
    grid-template-columns: 1fr;
  }
  .span-2 { grid-column: span 1; }
  .topbar { flex-direction: column; }
  .kv { grid-template-columns: 1fr; }
  .lookup-row { flex-direction: column; }
}
