@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0e12; --surface: #12171f; --surface-2: #1a212b;
  --border: #232b36; --border-bright: #34404f;
  --text: #e8edf2; --text-dim: #8b96a5; --text-faint: #576273;
  --gold: #d4a24c; --gold-bright: #e8bc6e; --cyan: #45e0c4; --danger: #f0625c;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(212,162,76,0.08), transparent),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(69,224,196,0.06), transparent),
    var(--bg);
  color: var(--text); font-family: var(--font-body); line-height: 1.5; min-height: 100vh;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 24px 20px 80px; }

header.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.mark {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #a97a2f);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: #1a1305;
  box-shadow: 0 0 0 1px rgba(212,162,76,0.3), 0 4px 16px -4px rgba(212,162,76,0.4);
}
h1 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.subtitle { font-size: 13px; color: var(--text-faint); margin: 2px 0 0; font-family: var(--font-mono); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.balance-pill {
  font-family: var(--font-mono); font-size: 12.5px; padding: 6px 12px; border-radius: 20px;
  background: rgba(212,162,76,0.1); border: 1px solid rgba(212,162,76,0.3); color: var(--gold-bright);
}
.logout-link { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); text-decoration: none; cursor: pointer; }
.logout-link:hover { color: var(--text-dim); }

.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin: 40px 0 12px; display: flex; align-items: center; gap: 8px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; position: relative; overflow: hidden; }
.card.scanning::before {
  content: ""; position: absolute; top: 0; left: -30%; width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(69,224,196,0.14), transparent);
  animation: scan 1.6s linear infinite; pointer-events: none;
}
@keyframes scan { from { left: -30%; } to { left: 100%; } }

.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; font-family: var(--font-mono); letter-spacing: 0.01em; }
label .opt { color: var(--text-faint); font-weight: 400; }

.file-input { position: relative; display: flex; align-items: center; border: 1px dashed var(--border-bright); border-radius: 9px; background: var(--surface-2); padding: 11px 12px; transition: border-color 0.15s; }
.file-input:hover { border-color: var(--gold); }
.file-input input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-input .fname { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-input.has-file .fname { color: var(--cyan); }
.file-input .icon { margin-right: 9px; color: var(--text-faint); flex-shrink: 0; }

input[type=text], input[type=password], input[type=email], input[type=number], select {
  width: 100%; padding: 10px 12px; font-family: var(--font-mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); outline: none; transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--gold); }
input::placeholder { color: var(--text-faint); }
select { appearance: none; cursor: pointer; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

button, .btn {
  width: 100%; margin-top: 22px; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1a1305; font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; box-shadow: 0 4px 20px -6px rgba(212,162,76,0.5);
  text-align: center; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled), .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px -6px rgba(212,162,76,0.65); }
button:disabled { background: var(--surface-2); color: var(--text-faint); box-shadow: none; cursor: default; transform: none; }
.btn.small { width: auto; margin: 0; padding: 7px 13px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; box-shadow: none; }
.btn.ghost { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--border-bright); color: var(--text); box-shadow: none; }
.btn.danger { background: rgba(240,98,92,0.12); color: var(--danger); box-shadow: none; }

#result { margin-top: 16px; border-radius: 12px; padding: 16px 18px; display: none; font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border); }
#result.pending { border-color: rgba(69,224,196,0.35); background: rgba(69,224,196,0.05); color: #9fe8da; }
#result.success { border-color: rgba(212,162,76,0.4); background: rgba(212,162,76,0.06); color: #e8dcc0; }
#result.error { border-color: rgba(240,98,92,0.4); background: rgba(240,98,92,0.06); color: #f4b3af; }

.seal-row { display: flex; align-items: center; gap: 14px; }
.seal {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 60%, #8a621f 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(212,162,76,0.25), 0 6px 18px -4px rgba(212,162,76,0.6);
  transform: scale(0) rotate(-35deg); animation: stamp 0.5s cubic-bezier(.2,1.4,.4,1) forwards;
}
.seal svg { width: 22px; height: 22px; }
@keyframes stamp { to { transform: scale(1) rotate(0deg); } }
.result-links { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.result-links a { color: var(--gold-bright); text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(232,188,110,0.4); font-size: 12.5px; }
.result-links a:hover { border-color: var(--gold-bright); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); padding: 0 12px 8px; font-weight: 500; }
.table td { padding: 12px; font-size: 13px; border-top: 1px solid var(--border); }
.table tr:hover td { background: var(--surface-2); }
.mono { font-family: var(--font-mono); font-size: 12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.row-card .fname { font-family: var(--font-mono); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .time { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.row-card a { color: var(--cyan); text-decoration: none; font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.row-card a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 30px 0; color: var(--text-faint); font-family: var(--font-mono); font-size: 12.5px; }

.badge { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; padding: 3px 8px; border-radius: 20px; white-space: nowrap; letter-spacing: 0.02em; }
.badge.success { color: var(--gold-bright); background: rgba(212,162,76,0.12); }
.badge.failed { color: var(--danger); background: rgba(240,98,92,0.12); }
.badge.running, .badge.queued { color: var(--cyan); background: rgba(69,224,196,0.12); }
.badge.admin { color: var(--gold-bright); background: rgba(212,162,76,0.12); }
.badge.user { color: var(--text-dim); background: var(--surface-2); }

.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab { font-family: var(--font-mono); font-size: 13px; padding: 10px 16px; color: var(--text-faint); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--gold-bright); border-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.err-msg { color: var(--danger); font-family: var(--font-mono); font-size: 12.5px; margin-top: 12px; display: none; }
