:root {
  --bg: #0b0f14;
  --bg2: #111823;
  --panel: #151d29;
  --border: #223044;
  --text: #dbe5f1;
  --muted: #7d8ea3;
  --accent: #3ea6ff;
  --accent2: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
header {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; background: var(--bg2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header h1 span { color: var(--accent); }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: #1c2a3d; color: var(--muted); border: 1px solid var(--border);
}
.spacer { flex: 1; }
main { flex: 1; display: flex; min-height: 0; }
nav {
  width: 210px; background: var(--bg2); border-right: 1px solid var(--border);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 2px;
}
nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; font-family: inherit;
}
nav button:hover { background: #182234; color: var(--text); }
nav button.active { background: #1b2c43; color: #fff; font-weight: 600; }
nav .ico { width: 16px; text-align: center; opacity: .9; }
section { flex: 1; overflow-y: auto; padding: 22px 26px; min-width: 0; }
.pane { display: none; }
.pane.active { display: block; }
h2 { font-size: 17px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
textarea, input, select {
  width: 100%; background: #0d141d; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-family: var(--mono); font-size: 12.5px; resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 130px; }
button.btn {
  background: var(--accent); color: #06121f; border: 0; border-radius: 8px;
  padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 13px; font-family: inherit;
}
button.btn:hover { filter: brightness(1.1); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
button.ghost {
  background: #1b2534; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 12.5px; font-family: inherit;
}
button.ghost:hover { background: #22303f; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 99px;
  background: #16202e; border: 1px solid var(--border); color: var(--muted);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--mono); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #131c28; }
.tag { padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.tag.VALID, .tag.done, .tag.ok { background: #0f3d24; color: #4ade80; }
.tag.INVALID, .tag.error, .tag.AUTH_FAILED { background: #3d1414; color: #f87171; }
.tag.FLAGGED, .tag.NO_CREDITS, .tag.queued, .tag.warn { background: #3d2f0f; color: #fbbf24; }
.tag.UNKNOWN, .tag.running, .tag.ERROR { background: #1f2a3a; color: #93b4d8; }
.tablewrap { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.empty { color: var(--muted); padding: 26px; text-align: center; font-size: 13px; }
.log {
  background: #080c11; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; color: #9fb3c8;
  max-height: 180px; overflow: auto; white-space: pre-wrap; margin-top: 12px;
}
.progress { height: 5px; background: #1b2534; border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 24px; color: #fff; }
.stat span { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.login {
  position: fixed; inset: 0; background: var(--bg); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.login .card { width: 340px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
code { background: #0d141d; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #9fd0ff; }
a { color: var(--accent); }
@media (max-width: 720px) {
  main { flex-direction: column; }
  nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  nav button { width: auto; white-space: nowrap; }
  nav button .lbl { display: none; }
  section { padding: 16px; }
}
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.chk input { width: auto; }
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.meta b { color: #fff; font-size: 15px; }
.meta a.dl { background: var(--accent); color: #04121f; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 12.5px; text-decoration: none; }
.meta a.dl:hover { opacity: .9; }
