: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; }
/* Pastikan atribut [hidden] selalu menyembunyikan elemen, termasuk .btn yang
   punya display: inline-flex (kalau tidak, tombol Login/Dashboard ikut tampil
   walau sudah di-set hidden oleh JS sesi). */
[hidden] { display: none !important; }
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;
}

/* Cegah halaman bisa di-geser horizontal di HP. overflow-x: clip dipilih agar
   header position: sticky tetap berfungsi (overflow-x: hidden bisa merusaknya). */
html, body { max-width: 100%; overflow-x: clip; }
/* Media & konten lebar jangan melebihi lebar layar */
img, svg, video, canvas { max-width: 100%; height: auto; }
pre { max-width: 100%; }

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 select,
.admin-select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.95rem;
}

.field select:focus,
.admin-select: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);
}

.withdraw-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-modal-card textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.admin-modal-card textarea:focus {
  outline: none;
  border-color: 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; }
}

/* ===== Admin console shell (sidebar nav + views) ===== */
.admin-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding: 6px 10px 10px;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.admin-nav-btn:hover {
  background: rgba(201, 162, 74, 0.07);
  border-color: var(--border);
}

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

.admin-nav-btn .nav-ico {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  opacity: 0.9;
}

.admin-nav-btn .nav-label { flex: 1; }

.admin-nav-badge {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--gold-light);
  text-align: center;
}

.admin-nav-badge[hidden] { display: none; }

.admin-nav-btn.active .admin-nav-badge {
  background: rgba(0, 0, 0, 0.45);
}

.admin-nav-badge.alert {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.admin-content { min-width: 0; }

.admin-view[hidden] { display: none; }

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 18px;
}

.admin-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.admin-search input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.92rem;
}

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

.admin-search .search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.admin-search-count {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-global-bar {
  position: sticky;
  top: 72px;
  z-index: 18;
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.admin-global-search {
  position: relative;
  flex: 1;
  max-width: 100%;
}

.admin-global-search input {
  width: 100%;
  padding-right: 40px;
}

.admin-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.admin-search-clear:hover { color: var(--gold-light); }

.admin-global-dropdown {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 10px;
}

.admin-global-meta {
  margin: 0 0 10px;
  padding: 6px 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-global-empty {
  margin: 0;
  padding: 16px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-global-section + .admin-global-section {
  border-top: 1px solid rgba(201, 162, 74, 0.1);
  margin-top: 8px;
  padding-top: 8px;
}

.admin-global-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding: 4px 8px 8px;
  font-weight: 700;
}

.admin-global-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, border-color 0.14s;
}

.admin-global-item:hover {
  background: rgba(201, 162, 74, 0.1);
  border-color: var(--border);
}

.admin-global-item-main {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

.admin-global-item-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}

@media (max-width: 900px) {
  .admin-global-bar { top: 64px; }
}

.admin-mobile-nav { display: none; }

@media (max-width: 920px) {
  .admin-shell {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 12px 48px;
  }
  /* Mobile nav: horizontal scrollable pill bar with icon + label always visible */
  .admin-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    border-radius: 14px;
  }
  .admin-sidebar::-webkit-scrollbar { height: 5px; }
  .admin-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 999px;
  }
  .admin-nav-title { display: none; }
  .admin-nav-btn {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 7px;
    padding: 9px 13px;
    font-size: 0.86rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .admin-nav-btn .nav-label { flex: 0 0 auto; }
  .admin-nav-btn .nav-ico { width: auto; }
  .admin-nav-badge { min-width: 20px; padding: 1px 6px; }
}

/* Mobile layout polish for dashboard heads, dates, tables, filters */
@media (max-width: 600px) {
  .dash-head { gap: 14px; margin-bottom: 18px; }
  .dash-head h1 { font-size: 1.42rem; }
  .dash-date { width: 100%; }
  .dash-date input[type="date"] { flex: 1 1 auto; min-width: 0; }
  .dash-date .btn { flex: 0 0 auto; }
  .dash-table-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
    .tx-filter-actions { width: 100%; }
    .tx-filter-actions .btn { flex: 1 1 auto; justify-content: center; }
    .admin-global-bar { position: static; }
  .admin-modal { padding: 12px; align-items: flex-start; }
  .admin-modal-card { max-height: 94vh; margin-top: 8px; }
  .admin-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ===== FN unified log / detail cards (admin + merchant) ===== */
.fn-log-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fn-log-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.fn-log-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.fn-log-card.is-clickable { cursor: pointer; }
.fn-log-card.is-clickable:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.fn-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(201, 162, 74, 0.09), rgba(201, 162, 74, 0.015));
  border-bottom: 1px solid rgba(201, 162, 74, 0.14);
}

.fn-log-head-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.fn-log-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
}

.fn-log-time { font-size: 0.82rem; color: var(--muted); }
.fn-log-order code { font-size: 0.84rem; word-break: break-all; }

.fn-log-note {
  margin: 0;
  padding: 11px 18px;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.14);
  border-bottom: 1px solid rgba(201, 162, 74, 0.08);
}

.fn-log-detected {
  margin: 0;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(56, 132, 255, 0.08);
  border-bottom: 1px solid rgba(56, 132, 255, 0.16);
}

.fn-log-detected strong { color: var(--gold-light); }

.fn-log-section { padding: 14px 18px 16px; }
.fn-log-section + .fn-log-section { border-top: 1px solid rgba(201, 162, 74, 0.08); }

.fn-log-section h4 {
  margin: 0 0 12px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.fn-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 9px 20px;
  margin: 0;
  font-size: 0.88rem;
}

.fn-dl dt { color: var(--muted); font-weight: 600; }
.fn-dl dd { margin: 0; color: var(--text); word-break: break-word; }
.fn-dl dd code { word-break: break-all; }
.fn-dl-amount { font-weight: 700; color: var(--gold-light); }

@media (max-width: 560px) {
  .fn-log-head { padding: 12px 14px; }
  .fn-log-note { padding: 10px 14px; }
  .fn-log-detected { padding: 9px 14px; }
  .fn-log-section { padding: 12px 14px 14px; }
  .fn-dl {
    grid-template-columns: 1fr;
    gap: 1px 0;
  }
  .fn-dl dt {
    margin-top: 9px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .fn-dl dt:first-of-type { margin-top: 0; }
  .fn-dl dd { font-size: 0.92rem; }
}

.fn-log-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.fn-log-actions.fn-log-resolved {
  background: rgba(34, 197, 94, 0.06);
  border-top-color: rgba(34, 197, 94, 0.2);
}

.fn-log-merchant {
  font-size: 0.82rem;
  color: var(--muted);
}

.fn-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fn-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.fn-chip:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.fn-chip.is-active {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(201, 162, 74, 0.12);
}

.fn-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.field textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

@media (max-width: 560px) {
  .fn-log-actions { padding: 10px 14px 14px; }
  .fn-log-actions .btn { width: 100%; }
  .fn-toggle-label { width: 100%; margin-left: 0 !important; }
}

/* —— Merchant approval state (register + dashboard) —— */
.form-note {
  border-left: 3px solid var(--gold);
  padding: 12px 14px;
  background: rgba(201, 162, 74, 0.08);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.approval-state {
  margin: 0 0 20px;
  padding: 28px 26px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 162, 74, 0.08), transparent 42%),
    linear-gradient(160deg, rgba(12, 18, 32, 0.98), rgba(17, 24, 39, 0.92));
  box-shadow: var(--shadow);
}

.approval-state__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  margin-bottom: 18px;
}

.approval-state__title {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  color: var(--text);
}

.approval-state__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 560px;
  line-height: 1.6;
}

.approval-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.approval-pill--pending {
  color: #f0c14b;
  background: rgba(240, 193, 75, 0.12);
  border: 1px solid rgba(240, 193, 75, 0.35);
}

.approval-pill--rejected {
  color: #ffb4ab;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.approval-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.approval-pill--pending .approval-pill__dot {
  animation: approvalPulse 1.6s ease-in-out infinite;
}

@keyframes approvalPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

.approval-meta {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.approval-meta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.approval-meta__label {
  min-width: 108px;
  color: var(--muted);
  font-size: 0.82rem;
}

.approval-meta__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--gold-light);
  word-break: break-all;
}

.approval-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.approval-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.approval-steps li.is-done {
  color: var(--text);
  border-color: rgba(62, 207, 142, 0.28);
  background: rgba(62, 207, 142, 0.06);
}

.approval-steps li.is-current {
  color: var(--text);
  border-color: rgba(201, 162, 74, 0.35);
  background: rgba(201, 162, 74, 0.08);
}

.approval-steps__num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(201, 162, 74, 0.15);
  color: var(--gold-light);
}

.approval-steps li.is-done .approval-steps__num {
  background: rgba(62, 207, 142, 0.18);
  color: #7dffb0;
}

.approval-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.approval-contacts .btn { min-width: 132px; }

.cred-box--pending,
.cred-box--rejected {
  border-color: rgba(201, 162, 74, 0.35);
  background: rgba(201, 162, 74, 0.05);
  padding: 0;
  overflow: hidden;
}

.cred-box--pending .approval-state,
.cred-box--rejected .approval-state {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

@media (max-width: 600px) {
  .approval-state { padding: 22px 18px; }
  .approval-meta__label { min-width: 100%; }
}
