﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --primary: #1a2a6c;
  --secondary: #b21f1f;
  --accent: #fdbb2d;
  --dark: #2c3e50;
  --light: #f5f5f5;
  --gray: #e3e6ee;
  --muted: #6b7280;
  --card: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] {
  --primary: #0f172a;
  --secondary: #9f1239;
  --accent: #f59e0b;
  --dark: #e5e7eb;
  --light: #0a1220;
  --gray: #1f2937;
  --muted: #9ca3af;
  --card: #0f172a;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body {
  background: var(--light);
  color: var(--dark);
  line-height: 1.5;
}
[data-theme="dark"] body {
  background: #0a1220;
  color: var(--dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  transition: 0.2s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
  border: 1px solid var(--primary);
}
[data-theme="dark"] .btn.ghost {
  background: #111827;
  color: var(--dark);
  border: 1px solid #334155;
}
.btn.small {
  padding: 8px 12px;
  font-size: 13px;
}
.btn.full {
  width: 100%;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}
.btn:active {
  transform: scale(0.98);
}

/* ЛЕНДИНГ */
.landing {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  overflow: hidden;
  color: #fff;
}
[data-theme="dark"] .landing {
  background: linear-gradient(135deg, #0a1220, #0f172a, #1f2937);
}
.landing-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.12), transparent 35%),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.18), transparent 45%);
  pointer-events: none;
}
.landing-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
}
.landing .logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.landing-actions {
  display: flex;
  gap: 10px;
}
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 30px;
  padding: 60px 0 40px;
}
.hero-text h1 {
  font-size: 42px;
  margin-bottom: 16px;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.hero-text p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 18px;
  max-width: 520px;
}
.hero-actions {
  display: flex;
  gap: 12px;
}
.hero-stats {
  display: grid;
  gap: 14px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}
.stat-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.stat-desc {
  opacity: 0.9;
}
.features {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 10px 0 60px;
}
.feature-card {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(10px);
  color: #fff;
}
[data-theme="dark"] .feature-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ДАШБОРД */
.dashboard {
  display: none;
}
.dashboard-header {
  background: #0f1e59;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] .dashboard-header {
  background: #0a1220;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-balance {
  cursor: pointer;
  text-align: right;
  font-size: 14px;
  line-height: 1.2;
}
.top-balance span {
  display: block;
  opacity: 0.9;
}
.notify-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.notify-panel {
  position: absolute;
  right: 0;
  top: 60px;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}
[data-theme="dark"] .notify-panel {
  background: #0f172a;
  border-color: #1f2937;
}
.notify-panel.show {
  display: flex;
}
.notify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.notify-body {
  max-height: 340px;
  overflow-y: auto;
}
.notify-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
  color: var(--dark);
}
[data-theme="dark"] .notify-item {
  border-color: #1f2937;
  color: #e5e7eb;
}
.notify-item time {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}
[data-theme="dark"] .notify-item time {
  color: #9ca3af;
}
.notify-empty {
  padding: 14px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
[data-theme="dark"] .notify-empty {
  color: #9ca3af;
}
.notify-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.dashboard-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  padding: 24px 0 40px;
}
.sidebar {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 10px 0;
  border: 1px solid #e6e8f0;
}
[data-theme="dark"] .sidebar {
  background: #0f172a;
  border-color: #1f2937;
  color: var(--dark);
}
.sidebar-menu {
  list-style: none;
}
.sidebar-menu li {
  padding: 14px 18px;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: 0.2s;
  font-weight: 600;
  color: inherit;
}
.sidebar-menu li:hover,
.sidebar-menu li.active {
  background: var(--light);
  border-left-color: var(--primary);
  color: var(--primary);
}
[data-theme="dark"] .sidebar-menu li {
  color: var(--dark);
}
[data-theme="dark"] .sidebar-menu li:hover,
[data-theme="dark"] .sidebar-menu li.active {
  background: #111827;
  color: #e5e7eb;
  border-left-color: #f59e0b;
}

.main-content {
  background: transparent;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
.section h2 {
  margin-bottom: 12px;
  color: var(--primary);
}
[data-theme="dark"] .section h2 {
  color: #e5e7eb;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1px solid #eef1f7;
}
[data-theme="dark"] .card {
  background: #0f172a;
  border-color: #1f2937;
  color: var(--dark);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.card.metric {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.metric-value {
  font-size: 20px;
  font-weight: 700;
  justify-content: center;
}
[data-theme="dark"] .metric-value {
  color: #e5e7eb;
}
.card.full {
  margin-top: 16px;
}
.calc-card {
  max-width: 610px;
}
.card-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 20px;
  font-weight: 700;
}
.metric-sub {
  margin-top: 6px;
  color: #555;
}

.calc {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.direction-label {
  font-weight: 700;
}
.rate-display {
  padding: 8px 12px;
  background: var(--light);
  border-radius: 10px;
  font-weight: 700;
  color: var(--primary);
}
[data-theme="dark"] .rate-display {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}
[data-theme="dark"] .direction-label {
  color: #e5e7eb;
}
.calc-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 10px;
  align-items: end;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-weight: 600;
  font-size: 14px;
}
.input-group input,
.input-group select {
  padding: 12px;
  border: 1px solid var(--gray);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}
[data-theme="dark"] .input-group input,
[data-theme="dark"] .input-group select {
  background: #0b1221;
  border-color: #1f2937;
  color: var(--dark);
}
.swap-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
}
.swap-btn:hover {
  background: var(--secondary);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.step {
  padding: 10px;
  text-align: center;
  background: var(--light);
  border-radius: 10px;
  font-weight: 600;
}
.step.active {
  background: var(--primary);
  color: #fff;
}
.step-content {
  display: none;
}
.step-content.active {
  display: block;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.exchange-summary,
.payment-info {
  background: var(--light);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 10px;
  border-radius: 10px;
  color: #856404;
}

.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gray);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s;
}
[data-theme="dark"] .chip {
  background: #111827;
  border-color: #1f2937;
  color: var(--dark);
}
.chip.active,
.chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--gray);
  text-align: left;
}
.table th {
  background: var(--light);
}
[data-theme="dark"] .table th {
  background: #111827;
  color: var(--dark);
}
[data-theme="dark"] .table td {
  color: #d1d5db;
  border-color: #1f2937;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-pending {
  background: #fff7e0;
  color: #8a6d1f;
  border-color: #ffe69c;
}
.status-pending_check {
  background: #e6f0ff;
  color: #1b4f9c;
  border-color: #b6d0ff;
}
.status-completed {
  background: #d9f5e5;
  color: #156a37;
  border-color: #a5e6c3;
}
.status-cancelled {
  background: #fde2e4;
  color: #8b1d2c;
  border-color: #f5b5bc;
}

.withdraw-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
.withdraw-submit {
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.form-grid.two-cols {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.form-grid .input-group.full {
  grid-column: 1 / -1;
}

.inline {
  display: flex;
  gap: 8px;
}

.small-note {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
}

.referral-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.ref-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 8px;
  align-items: center;
}
.ref-label {
  font-weight: 600;
}
.ref-value {
  word-break: break-all;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-user-item,
.admin-exchange-item {
  background: #fff;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

/* Модалки */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 520px;
  max-width: 90vw;
  overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 16px;
}
.close-btn {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .landing-header {
    flex-direction: column;
    gap: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .dashboard-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .calc-row {
    grid-template-columns: 1fr;
  }
  .withdraw-layout {
    grid-template-columns: 1fr;
  }
  .ref-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
