/* SpacePayment panel HUD — muted emerald / void (match landing), layout like our ops panels */
:root {
  --void: #020805;
  --bg: #020805;
  --bg-elev: #07140e;
  --card: #0a1812;
  --card-2: #0e1f17;
  --line: rgba(59, 184, 122, 0.18);
  --text: #dceee4;
  --muted: #7a9a88;
  --faint: #4a6a58;
  /* Landing emerald HUD */
  --green: #3bb87a;
  --green-dim: #1a7a52;
  --green-hi: #7ec9a4;
  --green-soft: #5fbf90;
  --green-rgb: 59, 184, 122;
  --green-hi-rgb: 126, 201, 164;
  --ember: #a8c478;
  --ember-rgb: 168, 196, 120;
  --cream: #dceee4;
  /* aliases used by sidebar/pills CSS */
  --teal: var(--green);
  --teal-2: var(--green-dim);
  --teal-rgb: var(--green-rgb);
  --neon: var(--green);
  --neon-2: var(--green-dim);
  --neon-soft: rgba(var(--green-rgb), 0.12);
  --neon-ink: #041008;
  --warn: #c4a35a;
  --ok: var(--green-hi);
  --bad: #e07070;
  --radius: 14px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Orbitron", "Exo 2", system-ui, sans-serif;
  --nav-brand-font: "Orbitron", system-ui, sans-serif;
  --sp-edge-line: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--green-rgb), 0.15) 10%,
    rgba(var(--green-hi-rgb), 0.85) 35%,
    rgba(var(--ember-rgb), 0.7) 65%,
    rgba(var(--green-rgb), 0.15) 90%,
    transparent 100%
  );
  --pl-edge-line: var(--sp-edge-line);
  --pl-edge-mask: linear-gradient(90deg, transparent 0%, #000 11%, #000 89%, transparent 100%);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #3bb87a #020805;
  }
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 7px;
  height: 7px;
  background: #020805;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #04110a;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7ec9a4, #1a7a52);
  border-radius: 999px;
  border: 1px solid rgba(2, 8, 5, 0.6);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--void);
}
button, input { font: inherit; }
button { cursor: pointer; }

/* Void atmosphere — no Push Land cityscape */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--void);
}
.bg-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--green-rgb), 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(var(--ember-rgb), 0.06), transparent 50%),
    #020805;
  opacity: 1;
  filter: none;
}
.bg-mesh {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 17, 10, 0.4) 0%, transparent 30%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 47px,
      rgba(var(--green-rgb), 0.03) 48px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(var(--green-rgb), 0.025) 48px
    );
  opacity: 0.9;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.45;
}
.bg-glow-a {
  width: 44vw;
  height: 44vw;
  top: -14%;
  left: -10%;
  background: radial-gradient(circle, rgba(var(--green-rgb), 0.28), transparent 68%);
}
.bg-glow-b {
  width: 36vw;
  height: 36vw;
  right: -12%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(var(--ember-rgb), 0.16), transparent 70%);
}
.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 70% at 50% 40%, transparent 25%, rgba(2, 8, 5, 0.65) 80%, rgba(2, 8, 5, 0.92) 100%);
}

.login[hidden],
.app[hidden] {
  display: none !important;
}

.login {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid rgba(var(--green-rgb), 0.28);
  background:
    linear-gradient(145deg, rgba(var(--green-rgb), 0.1), transparent 50%),
    linear-gradient(180deg, rgba(10, 24, 18, 0.96), rgba(4, 16, 10, 0.98));
  box-shadow: var(--shadow), 0 0 36px rgba(var(--green-rgb), 0.08);
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--sp-edge-line);
  -webkit-mask-image: var(--pl-edge-mask);
  mask-image: var(--pl-edge-mask);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.login-brand strong {
  display: block;
  font-family: var(--nav-brand-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
}
.login-brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.login-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.login-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(224, 112, 112, 0.12);
  border: 1px solid rgba(224, 112, 112, 0.28);
  color: #ffb0b0;
  font-size: 13px;
}
.btn-primary {
  display: block;
  width: 100%;
  text-align: center;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--green-hi) 0%, var(--green) 55%, var(--green-dim) 120%);
  color: var(--neon-ink);
  font-family: var(--nav-brand-font);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(var(--green-rgb), 0.25);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 0 24px rgba(var(--green-rgb), 0.35);
}
.login-back {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.login-back:hover { color: var(--green-hi); }

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(var(--green-rgb), 0.12);
  backdrop-filter: blur(16px);
  background: rgba(2, 8, 5, 0.88);
}
.bar::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: var(--sp-edge-line);
  -webkit-mask-image: var(--pl-edge-mask);
  mask-image: var(--pl-edge-mask);
  opacity: 0.65;
}
.bar-left, .bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-left strong {
  display: block;
  font-family: var(--nav-brand-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bar-left span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.ghost {
  border: 1px solid rgba(var(--green-rgb), 0.28);
  background: rgba(4, 16, 10, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ghost:hover {
  border-color: rgba(var(--green-hi-rgb), 0.55);
  color: var(--green-hi);
  background: rgba(var(--green-rgb), 0.1);
}

.main {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--green-rgb), 0.2);
  background:
    linear-gradient(160deg, rgba(var(--green-rgb), 0.08), transparent 55%),
    linear-gradient(180deg, rgba(14, 31, 23, 0.94), rgba(6, 16, 11, 0.96));
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--sp-edge-line);
  -webkit-mask-image: var(--pl-edge-mask);
  mask-image: var(--pl-edge-mask);
  opacity: 0.55;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--green-hi); }

.toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 280px);
  gap: 12px;
  margin-bottom: 10px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid rgba(var(--green-rgb), 0.16);
  background: rgba(4, 16, 10, 0.75);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover {
  border-color: rgba(var(--green-rgb), 0.4);
  color: var(--text);
}
.chip.is-on {
  background: rgba(var(--green-rgb), 0.14);
  border-color: rgba(var(--green-hi-rgb), 0.45);
  color: var(--green-hi);
  box-shadow: 0 0 12px rgba(var(--green-rgb), 0.12);
}
.search input {
  width: 100%;
  border: 1px solid rgba(var(--green-rgb), 0.18);
  background: rgba(4, 16, 10, 0.85);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  outline: none;
  border-color: rgba(var(--green-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.12);
}

.meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.orders {
  display: grid;
  gap: 12px;
}
.order {
  border: 1px solid rgba(var(--green-rgb), 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(var(--green-rgb), 0.06), transparent 50%),
    linear-gradient(180deg, rgba(14, 31, 23, 0.95) 0%, rgba(8, 18, 13, 0.97) 100%);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.order-id {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.order-id button {
  border: 0;
  background: none;
  color: var(--green-hi);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.order-amount {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: #c8ddd2;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.badge.await {
  background: rgba(196, 163, 90, 0.12);
  border-color: rgba(196, 163, 90, 0.3);
  color: var(--warn);
}
.badge.paid {
  background: rgba(var(--green-rgb), 0.12);
  border-color: rgba(var(--green-rgb), 0.3);
  color: var(--green-hi);
}
.badge.done {
  background: rgba(var(--green-hi-rgb), 0.12);
  border-color: rgba(var(--green-hi-rgb), 0.28);
  color: var(--green-hi);
}
.badge.bad {
  background: rgba(224, 112, 112, 0.12);
  border-color: rgba(224, 112, 112, 0.28);
  color: var(--bad);
}
.badge.neutral {
  background: rgba(var(--green-rgb), 0.08);
  border-color: rgba(var(--green-rgb), 0.22);
  color: var(--green-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
}
.grid dt {
  margin: 0;
  color: var(--muted);
}
.grid dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(var(--green-rgb), 0.2);
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn.warn {
  background: rgba(196, 163, 90, 0.14);
  color: var(--warn);
  border: 1px solid rgba(196, 163, 90, 0.3);
}
.btn.ok {
  background: rgba(var(--green-rgb), 0.16);
  color: var(--green-hi);
  border: 1px solid rgba(var(--green-rgb), 0.32);
}
.btn.danger {
  background: rgba(224, 112, 112, 0.12);
  color: var(--bad);
  border: 1px solid rgba(224, 112, 112, 0.28);
}
.btn.ghost-btn {
  background: rgba(4, 16, 10, 0.7);
  color: var(--muted);
  border: 1px solid rgba(var(--green-rgb), 0.16);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
  border: 1px dashed rgba(var(--green-rgb), 0.25);
  border-radius: var(--radius);
  background: rgba(4, 16, 10, 0.4);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 20, 14, 0.96);
  border: 1px solid rgba(var(--green-rgb), 0.4);
  color: var(--green-hi);
  font-size: 13px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
