/* Matches jetstreampeptides.com: near-black background, navy cards, JetStream blue, Oswald headings + Inter body */
:root {
  --bg: #05070c;
  --panel: #0b1019;
  --panel-2: #101826;
  --line: #1c2636;
  --line-2: #2a3a52;
  --text: #c9d1dc;
  --head: #ffffff;
  --muted: #7d8aa0;
  --accent: #1f8bff;
  --accent-2: #1872d6;
  --accent-glow: rgba(31,139,255,.35);
  --good: #2fd27a;
  --warn: #f5b942;
  --bad: #ff5a5f;
  --radius: 14px;
  --head-font: Oswald, 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(31,139,255,.14), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, rgba(31,139,255,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
  font-size: 15px; line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--head-font); font-weight: 500; text-transform: uppercase; color: var(--head); letter-spacing: .01em; line-height: 1.15; }
h1 { font-size: 34px; margin: 0 0 6px; }
h2 { font-size: 21px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 4px; color: var(--head); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: rgba(8,12,20,.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--head); font-family: var(--head-font); font-weight: 500; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; }
#nav a, #nav button {
  color: var(--text); padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 500;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
#nav a:hover, #nav button:hover { color: var(--head); background: var(--panel-2); text-decoration: none; }
#nav a.active { color: var(--head); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }

main { width: 100%; max-width: 1000px; margin: 0 auto; padding: 32px 20px 56px; flex: 1; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.footer { border-top: 1px solid var(--line); padding: 20px 24px; text-align: center; color: var(--muted); font-size: 12px; background: rgba(8,12,20,.6); }
.footer p { margin: 4px 0; }

/* Panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.card.narrow { max-width: 440px; margin: 24px auto; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } h1 { font-size: 28px; } }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; background: #070b13; border: 1px solid var(--line); color: var(--head);
  border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 15px;
}
input::placeholder, textarea::placeholder { color: #4d5a6e; }
textarea { min-height: 84px; resize: vertical; }
select { color-scheme: dark; }
input[type=datetime-local] { color-scheme: dark; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,139,255,.2); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; font-weight: 400; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; font-size: 15px;
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--head); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); background: rgba(31,139,255,.06); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255,90,95,.4); box-shadow: none; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.block { width: 100%; }

/* Pills / status */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); }
.pill.open { color: var(--good); border-color: rgba(47,210,122,.4); background: rgba(47,210,122,.08); }
.pill.draft { color: var(--warn); border-color: rgba(245,185,66,.4); background: rgba(245,185,66,.08); }
.pill.cancelled { color: var(--bad); border-color: rgba(255,90,95,.4); }
.pill.paid { color: var(--good); border-color: rgba(47,210,122,.4); background: rgba(47,210,122,.08); }
.pill.unpaid { color: var(--warn); border-color: rgba(245,185,66,.4); background: rgba(245,185,66,.08); }

.notice { border: 1px solid rgba(245,185,66,.35); background: rgba(245,185,66,.06); padding: 12px 14px; border-radius: 10px; font-size: 14px; color: var(--text); }
.notice.info { border-color: rgba(31,139,255,.35); background: rgba(31,139,255,.06); }
.notice.good { border-color: rgba(47,210,122,.35); background: rgba(47,210,122,.06); }
.error { color: var(--bad); font-size: 14px; }
.error:empty { display: none; }

/* Progress */
.progress { height: 8px; background: #070b13; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; transition: width .3s; box-shadow: 0 0 12px var(--accent-glow); }
.progress.met > span { background: linear-gradient(90deg, #1fa862, var(--good)); box-shadow: none; }

/* Buy list */
.buy-card { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
.buy-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }

/* Items */
.item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item .price { font-weight: 700; color: var(--head); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #070b13; }
.stepper button { width: 42px; height: 42px; background: var(--panel-2); color: var(--head); border: 0; font-size: 20px; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--accent); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper input { width: 58px; border: 0; border-radius: 0; text-align: center; font-weight: 700; padding: 8px 4px; background: transparent; }
.stepper input:focus { box-shadow: none; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.summary { position: sticky; bottom: 12px; background: rgba(11,16,25,.96); backdrop-filter: blur(10px); border: 1px solid var(--accent-2); box-shadow: 0 10px 40px -10px rgba(31,139,255,.35); }
.total { font-family: var(--head-font); font-size: 28px; font-weight: 500; color: var(--head); line-height: 1.1; }
.countdown { font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
td strong { color: var(--head); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input[type=text] { padding: 6px 8px; font-size: 13px; min-width: 130px; }
td input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
tfoot td { font-weight: 700; color: var(--head); border-bottom: 0; }

.item-editor { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.item-editor .full { grid-column: 1 / -2; }
@media (max-width: 720px) { .item-editor { grid-template-columns: 1fr 1fr; } .item-editor .full { grid-column: 1 / -1; } }

/* Auth */
.auth-head { text-align: center; }
.auth-logo { height: 72px; width: auto; display: block; margin: 0 auto 14px; filter: drop-shadow(0 0 18px rgba(31,139,255,.35)); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--head);
  padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 50; font-size: 14px; max-width: 90vw;
}
.toast.good { border-color: var(--good); }
.toast.bad { border-color: var(--bad); }
