:root {
  --bg: #0c0d11;
  --bg-2: #111319;
  --card: #15171e;
  --card-2: #1b1e27;
  --line: #252935;
  --line-2: #323746;
  --text: #eceef3;
  --muted: #8d94a5;
  --accent: #8f7dff;
  --accent-2: #b8adff;
  --accent-ink: #0c0b18;
  --ok: #3ccf8e;
  --warn: #f3b552;
  --bad: #f2676b;
  --info: #6aa8ff;
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: -30vh -10vw auto -10vw;
  height: 80vh;
  background:
    radial-gradient(45% 55% at 25% 30%, rgba(143, 125, 255, 0.16), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(60, 207, 142, 0.07), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
[hidden] { display: none !important; }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- layout ---------- */
.banner {
  background: repeating-linear-gradient(-45deg, #3a2c0c, #3a2c0c 12px, #33270b 12px, #33270b 24px);
  color: var(--warn);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-bottom: 1px solid #5a4415;
}
.top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  margin-right: auto;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), #ff8fd1, #ffd27a, #6ee7c8, var(--accent));
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px);
  mask: radial-gradient(circle, transparent 7px, #000 8px);
}
nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 1080px; margin: 0 auto; padding: 8px 20px 64px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; }
.side .card + .card { margin-top: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: #222634; border-color: #3d4356; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; margin-top: 16px; }
.link { color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 6px; }
.link:hover { color: var(--text); }

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(143, 125, 255, 0.18); }
input:disabled, textarea:disabled { opacity: 0.5; }
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.6; min-height: 112px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.error-text { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.chip.ok { color: var(--ok); border-color: rgba(60, 207, 142, 0.35); }
.chip.warn { color: var(--warn); border-color: rgba(243, 181, 82, 0.35); }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.badge.ok { color: var(--ok); background: rgba(60, 207, 142, 0.1); border-color: rgba(60, 207, 142, 0.3); }
.badge.warn { color: var(--warn); background: rgba(243, 181, 82, 0.1); border-color: rgba(243, 181, 82, 0.3); }
.badge.bad { color: var(--bad); background: rgba(242, 103, 107, 0.1); border-color: rgba(242, 103, 107, 0.3); }
.badge.info { color: var(--info); background: rgba(106, 168, 255, 0.1); border-color: rgba(106, 168, 255, 0.3); }
.badge.live { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- auth / hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 750; letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent-2), #ff9bd6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 17px; margin: 16px 0 22px; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.mini-plans { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-plan { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.mini-plan strong { font-size: 20px; }
.mini-plan span { color: var(--muted); margin-left: 4px; }

.auth { padding: 24px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 4px; margin-bottom: 20px; }
.tabs button { font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 8px; cursor: pointer; }
.tabs button.active { background: var(--card-2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 3px rgba(0, 0, 0, 0.3); }

/* ---------- plans ---------- */
.plans-card { background: linear-gradient(180deg, rgba(143, 125, 255, 0.08), transparent 70%), var(--card); border-color: rgba(143, 125, 255, 0.3); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.plan { position: relative; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 18px; display: grid; gap: 10px; }
.plan.featured { border-color: var(--accent); }
.plan-name { font-weight: 650; color: var(--muted); }
.plan-price { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; }
.plan-price span { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan-tag { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 9px; }

/* ---------- order + quote ---------- */
.order-form .row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.order-form .row .muted { margin-left: auto; }
.locked { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(243, 181, 82, 0.08); border: 1px solid rgba(243, 181, 82, 0.25); color: var(--warn); font-size: 14px; }
.quote { margin-top: 16px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.quote-list { list-style: none; margin: 0; padding: 0; }
.quote-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.q-name { display: grid; min-width: 0; }
.q-name small { color: var(--muted); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.q-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.quote-errors { padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(242, 103, 107, 0.06); font-size: 13px; }
.quote-errors strong { color: var(--bad); }
.quote-errors ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-family: var(--mono); font-size: 12px; word-break: break-all; }
.quote-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card-2); flex-wrap: wrap; }
.q-total { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- wallet / pass ---------- */
.balance { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 14px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; }
.input-eur { position: relative; flex: 1; }
.input-eur::before { content: "€"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-eur input { padding-left: 26px; }
.pass-state { font-size: 15px; margin: 4px 0 6px; }
.pass-state.ok strong { color: var(--ok); }
.pass-state.warn strong { color: var(--warn); }
.side .btn-row { margin-top: 14px; }

/* ---------- orders ---------- */
.order { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-2); }
.order + .order { margin-top: 10px; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-title { font-weight: 600; flex: 1; min-width: 140px; }
.order-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.order-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.progress { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 12px 0 8px; }
.progress span { display: block; height: 100%; width: 35%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.codes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 12px; }
.code { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 9px; background: var(--card); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; }
.code > a, .code > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.code > a:hover { color: var(--accent-2); }
.codes-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 18px 0 4px; text-align: center; }

.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pay-row:first-child { border-top: 0; }
.pay-via { color: var(--muted); }
.pay-reason { grid-column: 1 / -1; color: var(--bad); font-size: 13px; }

.field-copy { margin-top: 14px; }
.center { text-align: center; }

/* ---------- pay flow ---------- */
.method {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.method:hover { border-color: var(--accent); background: var(--card-2); }
.method strong { font-size: 15px; }
.method span { color: var(--muted); font-size: 12px; }
.method.paypal { margin-top: 12px; }
.method-label { margin: 18px 0 8px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.rules { margin: 14px 0; padding: 11px 14px 11px 30px; display: grid; gap: 4px; font-size: 13px; color: var(--warn); background: rgba(243, 181, 82, 0.08); border: 1px solid rgba(243, 181, 82, 0.25); border-radius: 10px; }
.modal-card .btn-row:not(.end) { margin-top: 14px; }
.modal-card .center { margin-top: 8px; }
.proof-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.step-title { font-weight: 650; margin-bottom: 14px; }
input[type="file"] { padding: 8px; font-size: 13px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; color: var(--text); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; margin-right: 10px; cursor: pointer; }
textarea.plain { font-family: inherit; font-size: 14px; min-height: 64px; }
.proof-preview { margin: -6px 0 14px; }
.proof-preview img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line-2); }

/* ---------- admin tickets ---------- */
.notice { font-size: 13px; color: var(--warn); background: rgba(243, 181, 82, 0.08); border: 1px solid rgba(243, 181, 82, 0.25); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.ticket { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.ticket + .ticket { margin-top: 10px; }
.ticket-shot { display: block; width: 120px; height: 120px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); background: var(--card); }
.ticket-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ticket-main { display: grid; gap: 4px; font-size: 14px; min-width: 0; }
.ticket-main .mono { overflow-wrap: anywhere; }
.ticket-title { font-weight: 650; font-size: 15px; }
.ticket-flag { color: var(--warn); font-size: 13px; font-weight: 600; }
.ticket-msg { color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.ticket-actions { display: grid; gap: 8px; }
@media (max-width: 640px) {
  .ticket { grid-template-columns: 84px minmax(0, 1fr); }
  .ticket-shot { width: 84px; height: 84px; }
  .ticket-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

/* ---------- toast + modal ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--info);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 50;
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(5, 6, 9, 0.7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal-card { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
.modal-card p + p { margin-top: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.alert { border-color: rgba(243, 181, 82, 0.45); }
.stat.alert .value { color: var(--warn); }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono, .mono { font-family: var(--mono); font-size: 12px; }
td.actions { white-space: nowrap; text-align: right; }
.search { max-width: 240px; padding: 7px 11px; font-size: 14px; }
.ev-error { color: var(--bad); }
.ev-warn { color: var(--warn); }
.ledger { max-height: 260px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.ledger table { font-size: 13px; }
.admin-forms { display: grid; gap: 16px; }
.admin-forms form { display: grid; gap: 8px; }
.admin-forms .inline-form input { flex: 1; }

@media (max-width: 860px) {
  .grid, .hero { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; gap: 28px; }
}
@media (max-width: 560px) {
  .top { padding: 14px 16px; flex-wrap: wrap; }
  main { padding: 4px 16px 48px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .pay-row { grid-template-columns: 1fr auto; }
  .pay-row > :nth-child(4) { display: none; }
  .quote-foot .btn { width: 100%; }
}

.stats + .card { margin-top: 16px; }
.plan-tag.alt { background: var(--ok); }
.price-changes { margin: 10px 0 0; padding: 10px 12px; list-style: none; max-height: 240px; overflow: auto; font-family: var(--mono); font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 3px; }
.price-changes .up { color: var(--bad); }
.price-changes .down, .price-changes .new { color: var(--ok); }
