:root {
  --bg: #0b0b10;
  --panel: #141420;
  --panel-2: #1b1b2a;
  --border: #272742;
  --text: #e6e6f0;
  --muted: #8a8aa8;
  --accent: #ffd45a;
  --accent-2: #a56cff;
  --good: #5bd69a;
  --bad: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

.view { min-height: 100vh; }

/* Login */
#login-view { display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.brand { font-weight: 800; letter-spacing: 0.08em; color: var(--accent); font-size: 18px; }
.brand-sub { color: var(--accent-2); font-weight: 600; margin-left: 6px; }
#login-form label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 13px; }
#login-form input, #login-form button {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 14px;
}
#login-form button {
  margin-top: 20px; background: var(--accent); color: #0b0b10; font-weight: 700; cursor: pointer;
  border: none;
}
#login-form button:hover { filter: brightness(1.08); }
.err { color: var(--bad); margin-top: 10px; font-size: 13px; min-height: 18px; }

/* App */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.topbar nav { display: flex; gap: 6px; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab.active { color: var(--text); background: var(--panel); border-color: var(--border); }
.tab:hover { color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.ghost:hover { color: var(--text); }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }
.pane-head { display: flex; align-items: center; margin-bottom: 16px; }
.pane-head h2 { margin: 0; font-size: 20px; }
.pane-head .primary {
  margin-left: auto; background: var(--accent-2); color: #fff; border: none;
  padding: 9px 14px; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.pane-head .primary:hover { filter: brightness(1.1); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.monthly  { background: rgba(91,214,154,0.15); color: var(--good); }
.chip.yearly   { background: rgba(165,108,255,0.15); color: var(--accent-2); }
.chip.lifetime { background: rgba(255,212,90,0.15); color: var(--accent); }
.chip.active   { background: rgba(91,214,154,0.15); color: var(--good); }
.chip.banned   { background: rgba(255,107,107,0.15); color: var(--bad); }
.chip.expired  { background: rgba(138,138,168,0.15); color: var(--muted); }

.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; }

.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; margin-left: 4px; }
.icon-btn:hover { color: var(--text); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; width: 420px; max-width: 92vw;
}
.modal h3 { margin: 0 0 16px; }
.modal label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 14px; font-family: inherit;
}
.modal textarea { min-height: 70px; resize: vertical; }
.modal .row { display: flex; gap: 10px; }
.modal .row > div { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions button { padding: 9px 16px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.modal-actions .cancel { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.modal-actions .confirm { background: var(--accent); color: #0b0b10; }
.modal-actions .danger  { background: var(--bad); color: #fff; }

.chip.awaiting_payment { background: rgba(255,212,90,0.15); color: var(--accent); }
.chip.review           { background: rgba(165,108,255,0.15); color: var(--accent-2); }
.chip.approved         { background: rgba(91,214,154,0.15); color: var(--good); }
.chip.denied           { background: rgba(255,107,107,0.15); color: var(--bad); }

.muted { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Public shop ---------- */
body.shop { background: radial-gradient(1200px 500px at 20% -10%, rgba(165,108,255,0.12), transparent 60%), var(--bg); }
.shop-top { display: flex; align-items: center; gap: 28px; padding: 18px 32px; border-bottom: 1px solid var(--border); }
.brand-lg { font-size: 22px; text-decoration: none; }
.shop-top nav { margin-left: auto; display: flex; gap: 20px; }
.shop-top nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.shop-top nav a:hover { color: var(--text); }

.hero { text-align: center; padding: 90px 24px 60px; }
.hero h1 { margin: 0; font-size: 56px; letter-spacing: 0.01em; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); margin: 14px 0 28px; font-size: 18px; }
.cta { display: inline-block; background: var(--accent); color: #0b0b10; font-weight: 700; padding: 12px 22px; border-radius: 10px; text-decoration: none; }
.cta:hover { filter: brightness(1.08); }

.shop-grid-wrap { max-width: 1100px; margin: 20px auto 80px; padding: 0 24px; }
.shop-grid-wrap h2 { margin: 0 0 18px; font-size: 22px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.product-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease, border-color .12s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.product-name { font-size: 20px; font-weight: 700; }
.product-desc { color: var(--muted); font-size: 14px; min-height: 36px; }
.product-price { font-size: 26px; font-weight: 800; color: var(--accent); margin-top: auto; }
.buy { background: var(--accent-2); color: #fff; border: none; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.buy:hover { filter: brightness(1.1); }

.shop-foot { display: flex; justify-content: space-between; padding: 18px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.shop-foot a { color: var(--muted); text-decoration: none; }
.shop-foot a:hover { color: var(--text); }

.cart-summary {
  display: flex; justify-content: space-between; background: var(--panel-2);
  padding: 12px 14px; border-radius: 10px; margin-bottom: 8px;
}
.cart-price { color: var(--accent); font-weight: 700; }

/* ---------- Order page ---------- */
.order-wrap { max-width: 640px; margin: 50px auto; padding: 0 24px; }
.order-wrap h1 { font-size: 30px; margin-bottom: 20px; }
#lookup-form { display: flex; gap: 10px; align-items: flex-end; }
#lookup-form label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
#lookup-form input { flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); }
#lookup-form button { padding: 11px 18px; border-radius: 10px; border: none; background: var(--accent); color: #0b0b10; font-weight: 700; cursor: pointer; }

#order-view { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.order-head { display: flex; align-items: center; gap: 14px; }
.order-code { font-size: 20px; font-weight: 800; letter-spacing: 0.04em; }
.order-prod { display: flex; justify-content: space-between; background: var(--panel); border: 1px solid var(--border); padding: 14px 16px; border-radius: 10px; }
.pay-box { background: var(--panel); border: 1px solid var(--border); padding: 20px; border-radius: 12px; }
.pay-box h3 { margin: 0 0 10px; }
.pay-handle { font-family: ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 10px 12px; border-radius: 8px; margin-top: 8px; word-break: break-all; }
.pay-note { color: var(--muted); font-size: 13px; margin-top: 16px; }
.order-code-big { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 0.08em; background: var(--panel-2); padding: 12px 14px; border-radius: 8px; margin: 6px 0 14px; color: var(--accent); }
.pay-box.good { border-color: var(--good); }
.pay-box.bad  { border-color: var(--bad); color: var(--bad); }
.pay-box .confirm { background: var(--accent); color: #0b0b10; border: none; padding: 10px 16px; border-radius: 8px; font-weight: 700; cursor: pointer; margin-top: 10px; }
