:root {
  --bg: #080b12;
  --surface: #10151f;
  --surface-2: #151c28;
  --surface-3: #1b2432;
  --border: rgba(255,255,255,.09);
  --text: #f5f7fb;
  --muted: #8f9bad;
  --primary: #7357ff;
  --primary-hover: #846cff;
  --success: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
  --radius: 20px;
  --radius-sm: 13px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(115,87,255,.18), transparent 32%),
    radial-gradient(circle at 90% 15%, rgba(41,187,255,.1), transparent 30%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(8,11,18,.78);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #7357ff, #9c7cff);
  box-shadow: 0 10px 32px rgba(115,87,255,.38);
  font-weight: 900;
}

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

.nav-link {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px;
  transition: .2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  font-weight: 750;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}

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

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), #8e73ff);
  box-shadow: 0 12px 32px rgba(115,87,255,.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #9b83ff);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.045);
}

.btn-block {
  width: 100%;
}

.hero {
  padding: 94px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
  align-items: center;
  gap: 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 12px;
  border: 1px solid rgba(115,87,255,.28);
  border-radius: 999px;
  color: #c9beff;
  background: rgba(115,87,255,.1);
  font-size: 14px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(46px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -.06em;
}

.hero h1 span {
  color: #a893ff;
}

.hero-text {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 19px;
}

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

.hero-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.preview-card,
.card,
.auth-card,
.donate-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(21,28,40,.96), rgba(14,19,28,.96));
  box-shadow: var(--shadow);
}

.preview-card {
  padding: 20px;
  border-radius: 26px;
  transform: rotate(1.5deg);
}

.preview-inner {
  padding: 24px;
  border-radius: 19px;
  background: rgba(255,255,255,.035);
}

.preview-top,
.streamer-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #7357ff, #37c6ff);
  font-weight: 850;
  font-size: 19px;
}

.preview-name,
.streamer-name {
  font-weight: 800;
}

.preview-sub,
.streamer-sub,
.muted {
  color: var(--muted);
}

.amount-preview {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,.15);
}

.amount-value {
  font-size: 38px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.message-preview {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(115,87,255,.11);
  color: #dcd5ff;
}

.section {
  padding: 34px 0 84px;
}

.section-title {
  max-width: 700px;
  margin-bottom: 34px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -.045em;
}

.section-title p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

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

.card {
  padding: 24px;
  border-radius: var(--radius);
}

.card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 13px;
  background: rgba(115,87,255,.12);
  color: #b9aaff;
  font-weight: 900;
}

.card h3 {
  margin: 0;
  font-size: 20px;
}

.card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-shell {
  min-height: calc(100vh - 75px);
  display: grid;
  place-items: center;
  padding: 54px 16px;
}

.auth-layout {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 18px;
}

.auth-intro,
.auth-card {
  border-radius: 24px;
}

.auth-intro {
  padding: 42px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 20%, rgba(115,87,255,.25), transparent 38%),
    rgba(255,255,255,.025);
}

.auth-intro h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -.05em;
}

.auth-intro p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.auth-card {
  padding: 28px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 5px;
  border-radius: 13px;
  background: rgba(255,255,255,.04);
}

.tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.tab.active {
  color: var(--text);
  background: var(--surface-3);
}

.form-panel {
  display: none;
}

.form-panel.active {
  display: block;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #c7cfdb;
  font-size: 14px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  outline: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255,255,255,.035);
  transition: border .18s ease, box-shadow .18s ease;
}

textarea.input {
  min-height: 118px;
  resize: vertical;
}

.input:focus {
  border-color: rgba(115,87,255,.7);
  box-shadow: 0 0 0 4px rgba(115,87,255,.12);
}

.form-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
}

.form-status.error {
  color: var(--danger);
}

.donate-wrap {
  width: min(100%, 560px);
}

.donate-card {
  padding: 30px;
  border-radius: 26px;
}

.streamer-row {
  margin-bottom: 26px;
}

.amount-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.amount-chip {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.035);
  font-weight: 750;
}

.amount-chip:hover {
  border-color: rgba(115,87,255,.55);
  background: rgba(115,87,255,.09);
}

.payment-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 14px;
}

.result-box {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.result-box.visible {
  display: block;
}

.site-footer {
  padding: 24px 0 38px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 860px) {
  .hero-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 64px;
  }

  .preview-card {
    transform: none;
  }

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

  .auth-intro {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-link {
    display: none;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-text {
    font-size: 17px;
  }

  .hero-actions {
    flex-direction: column;
  }

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

  .donate-card,
  .auth-card {
    padding: 22px;
    border-radius: 20px;
  }

  .amount-row {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* =========================================================
   CABINET UI V1
   ========================================================= */

.dashboard-body {
  background:
    radial-gradient(circle at 72% 0%, rgba(115,87,255,.11), transparent 30%),
    var(--bg);
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(8,11,18,.88);
  backdrop-filter: blur(18px);
}

.dashboard-sidebar-top {
  min-width: 0;
}

.dashboard-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
}

.dashboard-account-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #37c6ff);
  font-weight: 850;
}

.dashboard-account-info {
  min-width: 0;
}

.dashboard-account-name,
.dashboard-account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-account-name {
  font-weight: 750;
}

.dashboard-account-email {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-nav {
  display: grid;
  gap: 5px;
  margin-top: 24px;
}

.dashboard-nav-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 650;
  transition:
    color .18s ease,
    background .18s ease;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,.055);
}

.dashboard-nav-link.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.dashboard-nav-icon {
  width: 21px;
  color: #a997ff;
  text-align: center;
  font-size: 17px;
}

.dashboard-sidebar-bottom {
  display: grid;
  gap: 5px;
}

.dashboard-logout {
  cursor: pointer;
}

.dashboard-main {
  width: min(100%, 1500px);
  padding: 42px 44px 70px;
  overflow: hidden;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 36px;
}

.dashboard-eyebrow {
  margin-bottom: 8px;
  color: #a997ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.dashboard-header-description {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.dashboard-action-btn {
  min-height: 44px;
  padding: 0 17px;
  white-space: nowrap;
}

.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-section-heading h2,
.dashboard-panel-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.025em;
}

.dashboard-section-heading p,
.dashboard-panel-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-stat-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(21,28,40,.95), rgba(14,19,28,.95));
}

.dashboard-stat-label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-stat-value {
  display: block;
  margin-top: 9px;
  overflow-wrap: anywhere;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.dashboard-panel {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(21,28,40,.96), rgba(14,19,28,.96));
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}

.dashboard-section-anchor {
  scroll-margin-top: 24px;
}

.dashboard-panel-header {
  margin-bottom: 22px;
}

.dashboard-panel-header-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-current-wallet {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(0,0,0,.13);
  overflow-wrap: anywhere;
}

.dashboard-current-wallet div {
  min-width: 0;
}

.dashboard-current-wallet strong,
.dashboard-current-wallet span {
  display: block;
}

.dashboard-current-wallet strong {
  color: var(--text);
  font-size: 14px;
}

.dashboard-current-wallet span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(143,155,173,.1);
}

.dashboard-status-dot.success {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(52,211,153,.1);
}

.dashboard-status-dot.warning {
  background: #fbbf24;
  box-shadow: 0 0 0 5px rgba(251,191,36,.1);
}

.dashboard-status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251,113,133,.1);
}

.dashboard-form-grid {
  display: grid;
  align-items: end;
  gap: 12px;
}

.dashboard-wallet-grid {
  grid-template-columns: minmax(260px, 2.6fr) minmax(110px, .7fr) minmax(100px, .65fr) minmax(180px, 1fr);
}

.dashboard-payout-grid {
  grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(260px, 1.7fr) minmax(180px, 1fr);
}

.dashboard-filter-bar {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(150px, .7fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
}

.dashboard-field {
  min-width: 0;
}

.dashboard-field span {
  display: block;
  margin-bottom: 7px;
  color: #c7cfdb;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-field-action {
  align-self: end;
}

.dashboard-form-status {
  min-height: 22px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-form-status.success {
  color: var(--success);
}

.dashboard-form-status.error {
  color: var(--danger);
}

.dashboard-table-wrap {
  width: 100%;
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(0,0,0,.1);
}

.dashboard-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-table th,
.dashboard-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.dashboard-table th {
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-table tbody tr:hover td {
  background: rgba(255,255,255,.018);
}

.dashboard-id-cell {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.dashboard-amount-cell {
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-message-cell {
  min-width: 210px;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.dashboard-empty-cell {
  height: 92px;
  color: var(--muted);
  text-align: center !important;
}

.dashboard-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-badge-success {
  border-color: rgba(52,211,153,.2);
  color: #70e7b7;
  background: rgba(52,211,153,.09);
}

.dashboard-badge-danger {
  border-color: rgba(251,113,133,.2);
  color: #ff9bad;
  background: rgba(251,113,133,.09);
}

.dashboard-badge-warning {
  border-color: rgba(251,191,36,.2);
  color: #ffd76a;
  background: rgba(251,191,36,.09);
}

.dashboard-badge-muted,
.dashboard-badge-neutral {
  border-color: var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.035);
}

@media (max-width: 1180px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-wallet-grid,
  .dashboard-payout-grid,
  .dashboard-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .dashboard-shell {
    display: block;
  }

  .dashboard-sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .dashboard-sidebar-top {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
  }

  .dashboard-account {
    margin: 0 0 0 auto;
  }

  .dashboard-nav {
    width: 100%;
    display: flex;
    margin-top: 4px;
    overflow-x: auto;
  }

  .dashboard-nav-link {
    width: auto;
    flex: 0 0 auto;
  }

  .dashboard-sidebar-bottom {
    display: none;
  }

  .dashboard-main {
    padding: 30px 20px 60px;
  }
}

@media (max-width: 640px) {
  .dashboard-account {
    width: 100%;
    margin: 4px 0 0;
  }

  .dashboard-header,
  .dashboard-panel-header-split {
    display: block;
  }

  .dashboard-header-actions {
    margin-top: 20px;
  }

  .dashboard-header-actions .btn,
  .dashboard-panel-header-split .btn {
    width: 100%;
  }

  .dashboard-panel-header-split .btn {
    margin-top: 16px;
  }

  .dashboard-stats-grid,
  .dashboard-wallet-grid,
  .dashboard-payout-grid,
  .dashboard-filter-bar {
    grid-template-columns: 1fr;
  }

  .dashboard-panel {
    padding: 20px;
    border-radius: 17px;
  }

  .dashboard-stat-card {
    padding: 17px;
  }

  .dashboard-stat-value {
    font-size: 23px;
  }
}


/* CABINET STATS UI FIX */

.dashboard-stat-meta {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}


/* =========================================================
   ADMIN UI V1
   ========================================================= */

.admin-body {
  background:
    radial-gradient(circle at 75% 0%, rgba(115,87,255,.1), transparent 32%),
    var(--bg);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(8,11,18,.9);
  backdrop-filter: blur(18px);
}

.admin-role {
  margin-top: 34px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
}

.admin-role-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-nav {
  display: grid;
  gap: 4px;
  margin-top: 24px;
}

.admin-nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  transition:
    color .18s ease,
    background .18s ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,.055);
}

.admin-nav-link.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.admin-main {
  width: min(100%, 1600px);
  padding: 42px 44px 70px;
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 50px);
  letter-spacing: -.045em;
}

.admin-header p {
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-refresh-button {
  min-width: 180px;
}

.admin-panel,
.admin-table-section {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(21,28,40,.96), rgba(14,19,28,.96));
  box-shadow: 0 18px 55px rgba(0,0,0,.17);
}

.admin-panel {
  margin-bottom: 16px;
}

.admin-panel-header,
.admin-table-heading {
  margin-bottom: 20px;
}

.admin-panel-header h2,
.admin-table-heading h2,
.admin-section-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.admin-panel-header p,
.admin-table-heading p,
.admin-section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-section {
  margin: 28px 0 16px;
}

.admin-section-anchor {
  scroll-margin-top: 24px;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    minmax(160px, .8fr)
    minmax(180px, 1fr)
    minmax(170px, .9fr);
  align-items: end;
  gap: 12px;
}

.admin-secret-field {
  grid-column: span 2;
}

.admin-error {
  min-height: 22px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  white-space: pre-wrap;
}

.admin-settings-row {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-settings-row .dashboard-field {
  width: min(100%, 240px);
}

.admin-inline-status {
  min-height: 22px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.admin-section-heading {
  margin-bottom: 14px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(21,28,40,.95), rgba(14,19,28,.95));
}

.admin-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: -.035em;
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.admin-code-block {
  min-height: 300px;
  max-height: 520px;
  margin: 0;
  padding: 17px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: #c9d2df;
  background: rgba(0,0,0,.18);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-table-section {
  margin-top: 16px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(0,0,0,.1);
}

.admin-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover td {
  background: rgba(255,255,255,.018);
}

.admin-id-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(115,87,255,.28);
  border-radius: 8px;
  color: #b9aaff;
  background: rgba(115,87,255,.09);
  font-weight: 750;
}

.admin-id-button:hover {
  border-color: rgba(115,87,255,.55);
  background: rgba(115,87,255,.16);
}

.admin-table code {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #c9d2df;
  background: rgba(255,255,255,.035);
  font-size: 11px;
}

.admin-wallet-cell {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-empty-cell {
  height: 86px;
  color: var(--muted);
  text-align: center !important;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-badge-success {
  border-color: rgba(52,211,153,.2);
  color: #70e7b7;
  background: rgba(52,211,153,.09);
}

.admin-badge-danger {
  border-color: rgba(251,113,133,.2);
  color: #ff9bad;
  background: rgba(251,113,133,.09);
}

.admin-badge-warning {
  border-color: rgba(251,191,36,.2);
  color: #ffd76a;
  background: rgba(251,191,36,.09);
}

.admin-badge-neutral {
  border-color: var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.035);
}

@media (max-width: 1200px) {
  .admin-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-secret-field {
    grid-column: span 1;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .admin-role {
    margin-top: 18px;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
  }

  .admin-nav-link {
    flex: 0 0 auto;
  }

  .admin-main {
    padding: 30px 20px 60px;
  }
}

@media (max-width: 640px) {
  .admin-header {
    display: block;
  }

  .admin-refresh-button {
    width: 100%;
    margin-top: 20px;
  }

  .admin-filter-grid,
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel,
  .admin-table-section {
    padding: 19px;
    border-radius: 17px;
  }

  .admin-settings-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-settings-row .dashboard-field,
  .admin-settings-row .btn {
    width: 100%;
  }
}



/* =========================================================
   ADMIN EXCHANGE DIRECTIONS UI V1
   ========================================================= */

.admin-direction-toggle {
  min-width: 104px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-direction-toggle.enabled {
  border-color: rgba(52,211,153,.24);
  color: #70e7b7;
  background: rgba(52,211,153,.09);
}

.admin-direction-toggle.disabled {
  color: var(--muted);
  background: rgba(255,255,255,.035);
}

.admin-direction-toggle:hover {
  border-color: rgba(115,87,255,.55);
}


/* =========================================================
   EXCHANGE LOGIN UI V1
   ========================================================= */

.exchange-login-layout {
  width: min(100%, 1000px);
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 18px;
}

.exchange-login-intro,
.exchange-login-card {
  border-radius: 24px;
}

.exchange-login-intro {
  padding: 42px;
  border: 1px solid var(--border);
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(115,87,255,.25),
      transparent 38%
    ),
    rgba(255,255,255,.025);
}

.exchange-login-intro h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -.05em;
}

.exchange-login-intro > p {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.exchange-login-features {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.exchange-login-features div {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.exchange-login-features strong,
.exchange-login-features span {
  display: block;
}

.exchange-login-features strong {
  font-size: 14px;
}

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

.exchange-login-card {
  align-self: center;
}

.exchange-login-card-header {
  margin-bottom: 24px;
}

.exchange-login-card-header h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -.035em;
}

.exchange-login-card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.exchange-login-card button:disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 860px) {
  .exchange-login-layout {
    grid-template-columns: 1fr;
  }

  .exchange-login-intro {
    display: none;
  }
}


/* =========================================================
   EXCHANGE CABINET UI V1
   ========================================================= */

.exchange-dashboard-body {
  background:
    radial-gradient(
      circle at 75% 0%,
      rgba(115,87,255,.11),
      transparent 32%
    ),
    var(--bg);
}

.exchange-dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.exchange-dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(8,11,18,.9);
  backdrop-filter: blur(18px);
}

.exchange-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
}

.exchange-account-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--primary),
    #37c6ff
  );
  font-weight: 850;
}

.exchange-account-info {
  min-width: 0;
}

.exchange-account-info strong,
.exchange-account-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-account-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.exchange-dashboard-nav {
  display: grid;
  gap: 5px;
  margin-top: 24px;
}

.exchange-dashboard-nav-link {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

.exchange-dashboard-nav-link:hover,
.exchange-dashboard-nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,.055);
}

.exchange-dashboard-nav-link.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.exchange-dashboard-sidebar-bottom {
  display: grid;
  gap: 5px;
}

.exchange-dashboard-main {
  width: min(100%, 1500px);
  padding: 42px 44px 70px;
  overflow: hidden;
}

.exchange-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.exchange-dashboard-header h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.exchange-dashboard-header p {
  margin: 11px 0 0;
  color: var(--muted);
}

.exchange-reload-button {
  min-width: 150px;
}

.exchange-direction-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.exchange-direction-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background:
    linear-gradient(
      180deg,
      rgba(21,28,40,.95),
      rgba(14,19,28,.95)
    );
}

.exchange-direction-card.muted-direction {
  opacity: .72;
}

.exchange-direction-label {
  display: block;
  margin-bottom: 7px;
  color: #a997ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.exchange-direction-card strong {
  display: block;
  font-size: 18px;
}

.exchange-direction-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.exchange-orders-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(
      180deg,
      rgba(21,28,40,.96),
      rgba(14,19,28,.96)
    );
  box-shadow: 0 18px 55px rgba(0,0,0,.17);
}

.exchange-orders-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.exchange-orders-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.exchange-orders-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.exchange-action-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.exchange-action-status.success {
  color: var(--success);
}

.exchange-action-status.error {
  color: var(--danger);
}

.exchange-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(0,0,0,.1);
}

.exchange-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 13px;
}

.exchange-table th,
.exchange-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.exchange-table th {
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.exchange-table tbody tr:last-child td {
  border-bottom: 0;
}

.exchange-table tbody tr:hover td {
  background: rgba(255,255,255,.018);
}

.exchange-order-provider-id,
.exchange-order-message {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.exchange-order-provider-id {
  max-width: 180px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-order-message {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.exchange-amount-cell {
  font-weight: 800;
  white-space: nowrap;
}

.exchange-wallet-cell {
  display: block;
  max-width: 250px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #c9d2df;
  background: rgba(255,255,255,.035);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-order-actions {
  display: flex;
  gap: 6px;
}

.exchange-action-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.exchange-action-button.primary {
  border-color: rgba(115,87,255,.32);
  color: #c5baff;
  background: rgba(115,87,255,.11);
}

.exchange-action-button.secondary {
  color: var(--text);
  background: rgba(255,255,255,.035);
}

.exchange-action-button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.exchange-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.exchange-status-success {
  border-color: rgba(52,211,153,.2);
  color: #70e7b7;
  background: rgba(52,211,153,.09);
}

.exchange-status-info {
  border-color: rgba(115,87,255,.25);
  color: #c5baff;
  background: rgba(115,87,255,.1);
}

.exchange-status-warning {
  border-color: rgba(251,191,36,.2);
  color: #ffd76a;
  background: rgba(251,191,36,.09);
}

.exchange-status-danger {
  border-color: rgba(251,113,133,.2);
  color: #ff9bad;
  background: rgba(251,113,133,.09);
}

.exchange-status-neutral {
  border-color: var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.035);
}

.exchange-empty-cell {
  height: 100px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 900px) {
  .exchange-dashboard-shell {
    display: block;
  }

  .exchange-dashboard-sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .exchange-dashboard-nav {
    display: flex;
    overflow-x: auto;
  }

  .exchange-dashboard-sidebar-bottom {
    display: none;
  }

  .exchange-dashboard-main {
    padding: 30px 20px 60px;
  }
}

@media (max-width: 640px) {
  .exchange-dashboard-header {
    display: block;
  }

  .exchange-reload-button {
    width: 100%;
    margin-top: 20px;
  }

  .exchange-direction-summary {
    grid-template-columns: 1fr;
  }

  .exchange-orders-panel {
    padding: 19px;
    border-radius: 17px;
  }

  .exchange-orders-heading {
    display: block;
  }

  .exchange-action-status {
    margin-top: 12px;
  }
}


/* =========================================================
   ADMIN EXCHANGE CREATE UI V1
   ========================================================= */

.admin-exchange-create {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.admin-exchange-create > summary {
  padding: 16px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.admin-exchange-create[open] > summary {
  border-bottom: 1px solid var(--border);
}

#exchange_create_form {
  padding: 20px;
}

.admin-exchange-common-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-exchange-common-grid label,
.admin-exchange-direction-form > label,
.admin-exchange-limit-grid label {
  display: grid;
  gap: 7px;
}

.admin-exchange-common-grid label > span,
.admin-exchange-direction-form label > span,
.admin-exchange-limit-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-exchange-provider-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-exchange-directions-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-exchange-direction-form {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}

.admin-exchange-direction-form legend {
  padding: 0 7px;
}

.admin-exchange-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 800;
}

.admin-exchange-check input {
  width: 17px;
  height: 17px;
}

.admin-exchange-limit-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-exchange-create-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
}

.admin-exchange-create-status {
  color: var(--muted);
  font-size: 13px;
}

.admin-exchange-create-status.success {
  color: var(--success);
}

.admin-exchange-create-status.error {
  color: var(--danger);
}

.admin-exchange-commission {
  display: inline-block;
  line-height: 1.5;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .admin-exchange-common-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-exchange-common-grid,
  .admin-exchange-directions-grid {
    grid-template-columns: 1fr;
  }

  .admin-exchange-create-footer {
    align-items: stretch;
    flex-direction: column;
  }
}


/* =========================================================
   ADMIN EXCHANGE EDIT UI V1
   ========================================================= */

.admin-exchange-edit-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(115,87,255,.3);
  border-radius: 8px;
  color: #c5baff;
  background: rgba(115,87,255,.1);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-exchange-edit-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  background: #111722;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.admin-exchange-edit-dialog::backdrop {
  background: rgba(4,7,12,.78);
  backdrop-filter: blur(6px);
}

.admin-exchange-edit-form {
  padding: 24px;
}

.admin-exchange-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-exchange-edit-header h3 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -.03em;
}

.admin-exchange-dialog-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: 24px;
  line-height: 1;
}

.admin-exchange-dialog-close:hover {
  color: var(--text);
  border-color: rgba(115,87,255,.5);
}

@media (max-width: 720px) {
  .admin-exchange-edit-form {
    padding: 18px;
  }
}
