:root {
  --bg-deep: #06080f;
  --bg-panel: #0c1220;
  --bg-panel-2: #111827;
  --card: #0c1220;
  --gold: #c9a24a;
  --gold-light: #e8c872;
  --gold-dim: rgba(201, 162, 74, 0.25);
  --steel: #6b8cae;
  --text: #f4f0e8;
  --muted: #a8b0c4;
  --border: rgba(201, 162, 74, 0.22);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 162, 74, 0.12), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(107, 140, 174, 0.08), transparent 40%),
    var(--bg-deep);
  line-height: 1.6;
}

h1, h2, h3, .brand-title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(6, 8, 15, 0.88);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px var(--gold-dim);
}

.brand-title {
  font-size: 1.15rem;
  margin: 0;
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-gold {
  background: linear-gradient(135deg, #b8892f, #e8c872);
  color: #1a1205;
  box-shadow: 0 8px 24px rgba(201, 162, 74, 0.28);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.08);
}

.btn-danger {
  border-color: #c62828;
  color: #ffb4ab;
  background: rgba(198, 40, 40, 0.08);
}

.btn-danger:hover {
  border-color: #ef5350;
  background: rgba(198, 40, 40, 0.18);
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 20px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 12px;
  line-height: 1.15;
}

.hero-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 22px;
  max-width: 540px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-banner img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--bg-panel);
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(6, 8, 15, 0.55));
  pointer-events: none;
}

.tagline {
  text-align: center;
  color: var(--gold-light);
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin: 8px 0 0;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: linear-gradient(160deg, rgba(201, 162, 74, 0.07), rgba(17, 24, 39, 0.95));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--gold-light);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  counter-reset: step;
}

.step {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 10px;
}

.step strong { display: block; margin-bottom: 6px; }
.step span { color: var(--muted); font-size: 0.9rem; }

.cta-box {
  margin-top: 28px;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(201, 162, 74, 0.12), transparent 45%),
    var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer strong { color: var(--gold-light); }

.form-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.form-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-card h1 {
  font-family: Georgia, serif;
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.form-card .lead {
  color: var(--muted);
  margin: 0 0 22px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.88rem;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.95rem;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  font-size: 0.9rem;
}

.form-error.show { display: block; }

.cred-box {
  display: none;
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: rgba(201, 162, 74, 0.08);
}

.cred-box.show { display: block; }

.cred-tools .cred-panel {
  display: block;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: rgba(201, 162, 74, 0.08);
}

.api-cred-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(200px, 1.6fr);
  gap: 14px 18px;
  align-items: center;
}

.api-cred-grid .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.api-cred-grid .label strong {
  display: block;
  color: var(--gold-light);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.api-cred-value {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.api-cred-value code {
  flex: 1;
  min-width: 180px;
  word-break: break-all;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
}

@media (max-width: 640px) {
  .api-cred-grid { grid-template-columns: 1fr; }
}

.cred-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0;
  flex-wrap: wrap;
}

.cred-row code {
  flex: 1;
  min-width: 200px;
  word-break: break-all;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.copy-mini {
  border: 1px solid var(--border);
  background: rgba(201, 162, 74, 0.15);
  color: var(--gold-light);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle { display: inline-flex; margin-left: auto; }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
  }

  .nav-links.nav-open { display: flex; }

  .nav-links .btn { width: 100%; justify-content: center; }

  .steps { grid-template-columns: 1fr; }

  .cta-box { flex-direction: column; align-items: stretch; text-align: center; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

.dash-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.dash-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  position: sticky;
  top: 78px;
  z-index: 10;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(6, 8, 15, 0.98) 70%, transparent);
}

.dash-subnav a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.03);
}

.dash-subnav a:hover,
.dash-subnav a:focus {
  border-color: var(--gold);
  color: var(--gold-light);
}

#credSection,
#telegramSection,
#walletSection,
#statsSection {
  scroll-margin-top: 120px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dash-login { max-width: 640px; margin: 0 auto; }

.dash-footnote {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-panel:not([hidden]) { display: block; }

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.dash-head h1 {
  margin: 0 0 6px;
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.dash-sub { margin: 0; color: var(--muted); font-size: 0.92rem; }

.dash-date {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-date label {
  display: block;
  width: 100%;
  font-size: 0.82rem;
  color: var(--gold-light);
}

.dash-date input[type="date"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.stat-card.stat-gold {
  background: linear-gradient(160deg, rgba(201, 162, 74, 0.12), rgba(17, 24, 39, 0.95));
  border-color: var(--gold);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 1.45rem;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.dash-table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.dash-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.dash-table-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--gold-light);
}

.dash-muted { color: var(--muted); font-size: 0.85rem; }

.table-scroll { overflow-x: auto; }

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dash-table th,
.dash-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(201, 162, 74, 0.1);
}

.dash-table th {
  color: var(--gold-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-table code {
  font-size: 0.82rem;
  color: var(--text);
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 28px !important;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.ok { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.badge.pending { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.badge.expired { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.tx-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0 2px;
}

.tx-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.86rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.tx-filter-btn:hover,
.tx-filter-btn:focus {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.08);
}

.tx-filter-btn.active {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.18);
  color: var(--gold-light);
  font-weight: 600;
}

.tx-count {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  color: var(--muted);
}

.tx-filter-btn.active .tx-count {
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold-light);
}

.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .tx-filter-nav { gap: 6px; }
  .tx-filter-btn { padding: 8px 11px; font-size: 0.8rem; }
  .tx-pagination { flex-direction: column; align-items: stretch; }
  .tx-pagination .btn { width: 100%; justify-content: center; }
  .tx-table-desktop { display: none; }
  .tx-card-list { display: flex; }
}

.tx-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: end;
}

.tx-search-field { grid-column: span 2; min-width: 180px; }

.tx-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tx-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tx-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.tx-card:hover { border-color: var(--gold); }

.tx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tx-row-click { cursor: pointer; }
.tx-row-click:hover td { background: rgba(201, 162, 74, 0.06); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.onboarding-overlay[hidden] { display: none; }

.onboarding-card {
  width: min(520px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.onboarding-steps {
  margin: 16px 0 20px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.onboarding-steps li { margin-bottom: 6px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.footer-tagline {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 162, 74, 0.55);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
}

.cred-tools {
  margin-bottom: 20px;
  padding: 18px 20px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal[hidden] {
  display: none !important;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.admin-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  margin: 0;
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--gold-light);
}

.modal-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.dash-table tr.row-selected {
  background: rgba(201, 162, 74, 0.08);
}

.dash-table tr.row-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}

.wallet-grid {
  margin-bottom: 16px;
}

.wallet-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .wallet-forms { grid-template-columns: 1fr; }
  .bank-grid { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: 1fr 1fr; }
}

.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.legal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
}

.legal-card h1 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  color: var(--steel);
}

.legal-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.legal-card section {
  margin-bottom: 22px;
}

.legal-card h2 {
  font-size: 1.05rem;
  color: var(--gold-light);
  margin: 0 0 8px;
}

.legal-card ul {
  margin: 8px 0 0 18px;
  color: var(--text);
  line-height: 1.65;
}

.legal-card p {
  line-height: 1.65;
  color: var(--text);
}

.legal-nav {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legal-nav a {
  color: var(--gold-light);
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.field-check input {
  margin-top: 4px;
  flex-shrink: 0;
}

.field-check label {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.field-check label a {
  color: var(--gold-light);
}

.admin-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .admin-ops-grid { grid-template-columns: 1fr; }
  .legal-card { padding: 20px 18px; }
}
