/* RobRun panel. Same colours as robrunaim.com, kept plain: it is a tool. */
:root {
  --bg: #0c0f13; --surface: #11151b; --raised: #161b22; --line: #1e252e; --line2: #2f3945;
  --white: #fff; --text: #b8bfca; --muted: #8792a1; --dim: #636d7b;
  --accent: #5ed4ff; --ink: #03202c; --ok: #35e0c8; --warn: #ffa53d; --bad: #ff5c5c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
h1, h2, h3 { color: var(--white); margin: 0; font-weight: 650; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 14px; margin: 26px 0 10px; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 13px; color: var(--white); overflow-wrap: anywhere; }

/* ---------- controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: transparent; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 14px;
  color: var(--white); cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--muted); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 650; }
button.primary:hover { filter: brightness(1.08); }
button.link { border-color: transparent; padding: 4px 6px; color: var(--muted); }
button.link:hover { color: var(--white); }
button.small { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--bad); }
button.armed { border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }

label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; background: var(--bg); border: 1px solid var(--line2);
  border-radius: 8px; padding: 9px 11px; color: var(--white);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.45; }
textarea.plain { font-family: var(--sans); font-size: 14px; }
input:disabled { color: var(--dim); }
.note { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-size: 14px; min-height: 1.5em; }
.empty { color: var(--muted); padding: 28px 0; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.card h1 { margin: 18px 0 8px; }
.card .note { margin-bottom: 18px; }
.card button { width: 100%; margin-bottom: 10px; }

/* ---------- top bar ---------- */
.brand { color: var(--white); font-weight: 700; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px; height: 56px;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button { border-color: transparent; color: var(--muted); padding: 6px 12px; }
.tabs button:hover { color: var(--white); }
.tabs button.on { color: var(--white); background: var(--raised); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; }
.filters input, .filters select { margin: 0; width: auto; }
.filters input { width: 300px; max-width: 60vw; }

/* ---------- stock ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat b { display: block; color: var(--white); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }

.grid { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.grid thead th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 0 6px; }
.grid tbody th { text-align: left; color: var(--white); font-size: 16px; font-weight: 650; width: 150px; padding-right: 10px; }
.grid td { padding: 0 6px; vertical-align: middle; }
.grid td:last-child { width: 170px; padding-right: 0; }
.grid td select { margin: 0; }
.cell {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; white-space: normal;
}
.cell:hover { border-color: var(--line2); background: var(--raised); }
.cell b { color: var(--white); font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cell i { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 8px; }
.cell small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cell.low b { color: var(--warn); }
.cell.out b, .cell.out i { color: var(--bad); }
.status-undetected { color: var(--ok); }
.status-updating { color: var(--warn); }
.status-down { color: var(--bad); }

/* ---------- lists ---------- */
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list td.num, .list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list td.nowrap { white-space: nowrap; }
.list td.actions { white-space: nowrap; text-align: right; }
.list tr.click { cursor: pointer; }
.list tr.click:hover td { background: var(--surface); }
.list small { display: block; color: var(--muted); font-size: 12.5px; }
.list .white { color: var(--white); }
.pill { display: inline-block; border: 1px solid; border-radius: 999px; padding: 1px 9px; font-size: 12.5px; }
.pill.paid { color: var(--ok); }
.pill.refunded { color: var(--muted); }
.chip { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--white); }

/* ---------- side panel and pop-up ---------- */
.shade { position: fixed; inset: 0; background: rgba(4, 6, 9, .62); z-index: 10; }
.side {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 11; width: min(470px, 100vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line2); padding: 22px 24px 40px;
}
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.box-head .x { border-color: transparent; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 8px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1; margin-bottom: 0; }
.side form { margin-bottom: 8px; }
.side form .note { margin-top: 8px; min-height: 1.5em; }
.keys { list-style: none; margin: 0; padding: 0; }
.keys li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }

.modal {
  position: fixed; z-index: 11; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 22px 24px;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--white); }
.keybox { background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.keybox code { font-size: 16px; }

/* ---------- settings ---------- */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 16px; max-width: 760px; }
.section h2 { margin-bottom: 6px; }
.section > .note { margin-bottom: 16px; }
.section form + form { margin-top: 18px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; display: none;
  background: var(--raised); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 16px; color: var(--white); font-size: 14px;
}
#toast.show { display: block; }
#toast.bad { border-color: var(--bad); }

@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .top { gap: 12px; padding: 0 12px; }
  main { padding: 20px 12px 60px; overflow-x: auto; }
  .grid tbody th { width: auto; }
}
