/* ============================================================
   VOLTPROXY dashboard — same deep space palette as the landing
   ============================================================ */

:root {
  --bg: #050913;
  --bg-raise: #0a1020;
  --bg-card: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --ice: #7cd9ff;
  --ice-dim: rgba(124, 217, 255, 0.14);
  --aurora: #8fa3ff;
  --warn: #ffb46b;
  --danger: #ff7a7a;
  --ok: #7ee0a8;
  --text: #e9effa;
  --muted: #8b97ae;
  --display: "Unbounded", sans-serif;
  --body: "Manrope", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100svh;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 80% -10%, rgba(124, 217, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(143, 163, 255, 0.07), transparent 55%);
  background-attachment: fixed;
}

svg { display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.wrap { width: min(1100px, 92%); margin-inline: auto; }
.mono { font-family: var(--mono); }

h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 18px;
}

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 9px; }
.logo__mark { width: 30px; height: 30px; overflow: visible; }
.logo__planet { fill: none; stroke: var(--ice); stroke-width: 1.3; opacity: 0.3; }
.logo__orbit { fill: none; stroke: var(--ice); stroke-width: 1.2; opacity: 0.55; }
.logo__bolt { fill: var(--ice); filter: drop-shadow(0 0 7px rgba(124, 217, 255, 0.65)); }
.logo__word { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.logo__word em { font-style: normal; color: var(--ice); }
.logo--auth { justify-content: center; margin-bottom: 28px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 13px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn--ice { background: var(--ice); color: #03111c; box-shadow: 0 0 30px rgba(124, 217, 255, 0.18); }
.btn--ice:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 46px rgba(124, 217, 255, 0.36); }
.btn--ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.btn--ghost:hover:not(:disabled) { border-color: var(--ice); color: var(--ice); }
.btn--sm { padding: 9px 18px; font-size: 0.72rem; }
.btn--full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- form fields ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input, .field select {
  width: 100%;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus { border-color: var(--ice); }
.field input::placeholder { color: rgba(139, 151, 174, 0.6); }
.field select option { background: var(--bg-raise); }

.field--inline { margin-bottom: 0; }
.field__row { display: flex; align-items: center; gap: 0; }
.field__prefix {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
}
.field__row input { border-radius: 0 12px 12px 0; }

.note {
  font-size: 0.86rem;
  color: var(--danger);
  margin-bottom: 14px;
}
.note--ok { color: var(--ok); }

/* ---------- auth screen ---------- */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 30px 20px; }
.auth__card {
  width: min(420px, 100%);
  padding: 36px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.tabs__btn {
  padding: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 10px;
  transition: 0.2s;
}
.tabs__btn.is-active { background: var(--ice); color: #03111c; }
.auth__foot { margin-top: 22px; text-align: center; font-size: 0.85rem; }
.auth__foot a { color: var(--muted); }
.auth__foot a:hover { color: var(--ice); }

/* ---------- top bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  background: rgba(5, 9, 19, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bar__right { display: flex; align-items: center; gap: 14px; }
.bar__email { font-size: 0.78rem; color: var(--muted); }

.main { padding: 34px 0 60px; }
.section { margin-bottom: 40px; }

/* ---------- balance ---------- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(10px);
}
.panel--balance {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 40px;
  border-color: rgba(124, 217, 255, 0.3);
  background: linear-gradient(120deg, var(--ice-dim), transparent 60%), var(--bg-card);
}
.panel__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.balance {
  font-family: var(--display);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  color: var(--ice);
  text-shadow: 0 0 28px rgba(124, 217, 255, 0.35);
  line-height: 1.1;
}
.topup { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topup input { width: 110px; }

/* ---------- admin strip ---------- */
.panel--admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-style: dashed;
}
.admin__state { font-size: 0.92rem; font-weight: 600; }
.admin__state--ok { color: var(--ok); }
.admin__state--warn { color: var(--warn); }
.admin__state--error { color: var(--danger); }
.admin__right { text-align: right; }
.admin__balance { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--ice); }

.admin__probe { flex-basis: 100%; }
.admin__out {
  margin-top: 12px;
  padding: 14px;
  max-height: 320px;
  overflow: auto;
  background: rgba(5, 9, 19, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.plan:hover { border-color: rgba(124, 217, 255, 0.4); box-shadow: 0 0 34px rgba(124, 217, 255, 0.12); }
.plan__head { display: flex; align-items: baseline; justify-content: space-between; }
.plan__name { font-family: var(--display); font-weight: 600; }
.plan__price { font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--ice); }
.plan__per { font-size: 0.78rem; color: var(--muted); }
.plan__row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.plan__row .field { flex: 1; margin: 0; }
.plan__row .field--qty { flex: 0 0 88px; }

h2.h2--row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2.h2--row .btn { margin-left: auto; }

/* ---------- protocol switch ---------- */
.switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 9, 19, 0.5);
  transition: opacity 0.2s;
}
.switch.is-busy { opacity: 0.5; pointer-events: none; }
.switch__opt {
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.switch__opt:hover:not(.is-on):not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.switch__opt.is-on {
  background: var(--ice);
  color: #03111c;
  font-weight: 700;
}
.switch__opt:disabled { cursor: default; }

/* ---------- proxy cards ---------- */
.proxy {
  padding: 20px 22px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.proxy--soon { border-color: rgba(255, 180, 107, 0.4); }
.proxy--expired { border-color: rgba(255, 122, 122, 0.35); opacity: 0.75; }
.proxy__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.proxy__geo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.pill {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill--active { color: var(--ok); border-color: rgba(126, 224, 168, 0.4); }
.pill--soon { color: var(--warn); border-color: rgba(255, 180, 107, 0.45); }
.pill--expired { color: var(--danger); border-color: rgba(255, 122, 122, 0.45); }

.creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cred {
  background: rgba(5, 9, 19, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}
.cred__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.cred__value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.84rem;
  word-break: break-all;
}
.copy {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  transition: 0.2s;
}
.copy:hover { color: var(--ice); background: var(--ice-dim); }
.copy svg { width: 14px; height: 14px; }

.proxy__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.proxy__expiry { font-size: 0.85rem; color: var(--muted); }
.proxy__expiry b { color: var(--text); }
.proxy__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proxy__actions select {
  font-family: var(--body);
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  outline: none;
}
.proxy__actions select option { background: var(--bg-raise); }

.proxy__verdict {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 0.86rem;
  border: 1px solid var(--line);
  background: rgba(5, 9, 19, 0.5);
  color: var(--muted);
}
.proxy__verdict--ok { color: var(--ok); border-color: rgba(126, 224, 168, 0.35); }
.proxy__verdict--bad { color: var(--danger); border-color: rgba(255, 122, 122, 0.35); }

/* ---------- string blocks ---------- */
.connstr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 16px;
  background: rgba(5, 9, 19, 0.5);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

/* ---------- rotation ---------- */
.rotate {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(124, 217, 255, 0.22);
  border-radius: 12px;
  background: rgba(124, 217, 255, 0.05);
}
.rotate__link {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  background: rgba(5, 9, 19, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  word-break: break-all;
}
.rotate__hint {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- history ---------- */
.history { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.history__row:last-child { border-bottom: 0; }
.history__when { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.history__amount { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.history__amount--plus { color: var(--ok); }
.history__amount--minus { color: var(--text); }

/* ---------- empty state ---------- */
.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.count { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* ---------- payment modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.8);
  backdrop-filter: blur(6px);
}
.modal__box {
  position: relative;
  width: min(430px, 100%);
  max-height: 92svh;
  overflow-y: auto;
  padding: 26px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal__x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  border-radius: 9px;
}
.modal__x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.pay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 34px;
}
.pay__coin { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.pay__coin em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.pay__timer {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ice);
  padding: 6px 14px;
  border: 1px solid rgba(124, 217, 255, 0.4);
  border-radius: 20px;
}
.pay__timer.is-late { color: var(--danger); border-color: rgba(255, 122, 122, 0.5); }

/* once the address is dead, it stays visible but plainly out of use */
.modal__box.is-expired .pay__qr,
.modal__box.is-expired .pay__row {
  opacity: 0.32;
  pointer-events: none;
}

.pay__warn {
  padding: 10px 13px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--warn);
  background: rgba(255, 180, 107, 0.09);
  border: 1px solid rgba(255, 180, 107, 0.4);
  border-radius: 11px;
}

.pay__qr {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 14px;
}
.pay__qr img, .pay__qr svg { width: 100%; max-width: 190px; height: auto; display: block; }
.pay__qr--empty {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
  padding: 30px 20px;
}

.pay__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: rgba(5, 9, 19, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pay__row > div { min-width: 0; }
.pay__label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.pay__value { font-size: 0.88rem; word-break: break-all; }
.pay__note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.pay__note b { color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(440px, 92vw);
  padding: 13px 22px;
  background: var(--bg-raise);
  border: 1px solid var(--ice);
  border-radius: 13px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  font-size: 0.88rem;
  animation: toastIn 0.25s ease;
}
.toast--error { border-color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.foot a:hover { color: var(--ice); }

/* ---------- статистика владельца ---------- */

#adminStats h2 { margin-top: 34px; }
#adminStats h2:first-child { margin-top: 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px 20px;
}
.tile__label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tile__value {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  margin: 8px 0 4px;
  color: var(--ice);
}
.tile__sub { font-size: 0.76rem; color: var(--muted); }

/* wide tables scroll on their own instead of stretching the page */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg-card);
}
table.stat { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.stat th, table.stat td {
  padding: 11px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.stat th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.stat tbody tr:last-child td { border-bottom: none; }
table.stat tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.stat .right { text-align: right; }
table.stat .plus { color: var(--ok); }
table.stat .minus { color: var(--muted); }

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 0.68rem;
  color: var(--aurora);
  border: 1px solid rgba(143, 163, 255, 0.35);
  border-radius: 20px;
}
.stat__note { margin-top: 14px; font-size: 0.76rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .panel--balance { flex-direction: column; align-items: stretch; }
  .topup { justify-content: space-between; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .auth__card { padding: 26px 22px; }
  .bar__email { display: none; }
  .proxy__foot { flex-direction: column; align-items: stretch; }
  .proxy__actions { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
