﻿* {
  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-sm: 0 6px 16px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.15);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.2);
  --shadow: var(--shadow-md);
}
[data-theme="dark"] {
  --primary: #0f172a;
  --secondary: #9f1239;
  --accent: #f59e0b;
  --dark: #e5e7eb;
  --light: #0a1220;
  --gray: #1f2937;
  --muted: #9ca3af;
  --card: #0f172a;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.75);
  --shadow: var(--shadow-md);
}

body {
  background: var(--light);
  color: var(--dark);
  line-height: 1.5;
}
[data-theme="dark"] body {
  background: #0a1220;
  color: var(--dark);
}
/* Небольшое усиление контраста в темной теме */
[data-theme="dark"] .card {
  background: #101a30;
  border-color: #1f2937;
  box-shadow: var(--shadow-lg);
  color: #e8edf5;
}
[data-theme="dark"] .section h2 {
  color: #e8edf5;
}
[data-theme="dark"] .chip {
  background: #111827;
  border-color: #1f2937;
  color: #e8edf5;
}

.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.danger.logout-red {
  background: linear-gradient(135deg, #c21c1c, #ff5047);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: 0 12px 24px rgba(194, 28, 28, 0.3);
}
.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: var(--shadow-sm);
}
.btn:active {
  transform: scale(0.98);
}

#toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1500;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  font-size: 14px;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: linear-gradient(135deg, #16a34a, #059669);
}

.toast-error {
  background: linear-gradient(135deg, #dc2626, #991b1b);
}

.toast-info {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

[data-theme="dark"] .toast {
  box-shadow: var(--shadow-lg);
}

/* ЛЕНДИНГ */
.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 {
  --bg-main: #f3f5fb;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #3f7dff;
  --accent2: #7b3dff;
  --radius-lg: 22px;
  --shadow-card: var(--shadow-lg);
}

[data-theme="dark"] #dashboard {
  --bg-main: #0b1220;
  --bg-card: #111827;
  --text-main: #e8edf5;
  --text-muted: #9ca3af;
  --accent: #6e88ff;
  --accent2: #b85dff;
  --radius-lg: 22px;
  --shadow-card: var(--shadow-lg);
}

.dashboard {
  display: none;
}
.dashboard-header {
  background: #0f1e59;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .dashboard-header {
  background: #0a1220;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
 .header-right { position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* В админке убираем баланс/уведомления/переключатель темы из шапки */
body.admin-mode .top-balance,
body.admin-mode .notify-btn,
body.admin-mode .theme-switch {
  display: none;
}
.theme-switch {
  position: relative;
  width: 90px;
  height: 40px;
}
.theme-switch input {
  width: 0;
  height: 0;
  visibility: hidden;
  position: absolute;
}
.theme-switch label {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  background: #ebebeb;
  border-radius: 999px;
  box-shadow:
    inset 0px 10px 10px rgba(0, 0, 0, 0.25),
    inset 0px -6px 10px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: 0.3s;
}
.theme-switch label::after {
  content: "";
  width: 28px;
  height: 28px;
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(180deg, #ffcc89, #d8860b);
  border-radius: 50%;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.25);
  transition: 0.3s;
}
.theme-switch input:checked + label {
  background: #242424;
  box-shadow:
    inset 0px 10px 10px rgba(0, 0, 0, 0.35),
    inset 0px -6px 10px rgba(255, 255, 255, 0.05);
}
.theme-switch input:checked + label::after {
  left: 56px;
  transform: translateX(-100%);
  background: linear-gradient(180deg, #777, #3a3a3a);
}
.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: var(--shadow-lg);
  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: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 40px;
}
body.admin-mode .dashboard-body {
  grid-template-columns: 1fr;
}
.sidebar {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 10px 0;
  border: 1px solid #e6e8f0;
  position: relative;
  z-index: 3;
  min-height: 380px;
  transition: transform 0.3s ease;
}
body.admin-mode .sidebar {
  display: none;
}
body.admin-mode .main-content {
  width: 100%;
}
[data-theme="dark"] .sidebar {
  background: #0f172a;
  border-color: #1f2937;
  color: var(--dark);
}
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-menu li {
  list-style: none;
}
.sidebar-menu li button {
  width: 100%;
  border-radius: 12px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: #111;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.sidebar-menu li button:not(.active):hover {
  color: var(--primary);
}
.sidebar-menu li button.active {
  background: linear-gradient(135deg, #5a7bff, #a14eff);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .sidebar-menu li button {
  color: #f1f5ff;
}
[data-theme="dark"] .sidebar-menu li button.active {
  background: linear-gradient(135deg, #6e88ff, #b85dff);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.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-lg);
  padding: 16px;
  border: 1px solid #eef1f7;
}
[data-theme="dark"] .card {
  background: #0f172a;
  border-color: #1f2937;
  color: var(--dark);
  box-shadow: var(--shadow-lg);
}
.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);
}
#history-table {
  table-layout: fixed;
}
#history-table th,
#history-table td {
  width: 16.66%;
  word-break: break-word;
}
#history-table th:nth-child(4),
#history-table td:nth-child(4) {
  width: 16%;
}
#history-table th:nth-child(5),
#history-table td:nth-child(5),
#history-table th:nth-child(6),
#history-table td:nth-child(6) {
  width: 17%;
}
[data-theme="dark"] .table th {
  background: #111827;
  color: var(--dark);
}
[data-theme="dark"] .table td {
  color: #e8edf5;
  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;
}
.history-receipt-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-receipt-cell .receipt-status {
  font-weight: 600;
  font-size: 13px;
}
.history-receipt-cell .receipt-status.success {
  color: #17682d;
}
.history-receipt-cell .receipt-status.warning {
  color: #b45309;
}
.history-receipt-cell .receipt-status.muted {
  color: #6b7280;
}
.history-receipt-cell .upload-receipt-btn {
  align-self: flex-start;
  padding: 6px 12px;
}

.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-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}
.admin-user-item,
.admin-exchange-item {
  background: var(--card);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  color: var(--dark);
  position: relative;
}
[data-theme="dark"] .admin-user-item,
[data-theme="dark"] .admin-exchange-item {
  background: #101a30;
  border-color: #1f2937;
  color: #e8edf5;
}
[data-theme="dark"] #admin-completed-search {
  background: #0f172a;
  color: #e8edf5;
  border: 1px solid #1f2937;
}
#admin-completed-search {
  float: right;
  width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gray);
  background: #fff;
  color: var(--dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .admin-exchange-item .admin-exchange-date {
  background: #1f2937;
  color: #e8edf5;
}

#admin-users-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-exchange-date {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #1f2937;
  font-weight: 700;
  margin-bottom: 8px;
}
[data-theme="dark"] .admin-exchange-date {
  background: #1e293b;
  color: #e5e7eb;
}

.admin-day-header {
  margin: 14px 0 8px;
  font-weight: 700;
  color: var(--dark);
}
[data-theme="dark"] .admin-day-header {
  color: #e5e7eb;
}
[data-theme="dark"] .admin-user-item,
[data-theme="dark"] .admin-exchange-item {
  background: #101a30;
  border-color: #1f2937;
  color: #e8edf5;
}
[data-theme="dark"] .admin-exchange-item p,
[data-theme="dark"] .admin-user-item p,
[data-theme="dark"] .admin-exchange-item strong,
[data-theme="dark"] .admin-user-item strong {
  color: #e8edf5;
}

/* Модалки */
.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: var(--shadow-lg);
  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;
  }
}

.admin-day-tile {
  display: inline-block;
  background: #fff;
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  border: 1px solid #e5e7eb;
}
[data-theme="dark"] .admin-day-tile {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #1f2937;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}

.admin-exchange-date.plain-date {background: transparent!important; border: none!important; padding: 0!important; box-shadow: none!important;}
.admin-exchange-item .status-badge {display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-weight: 700; border: 1px solid transparent;}


.admin-withdrawals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.admin-withdrawals-grid .admin-exchange-item {
  height: 100%;
}



.admin-withdrawals-grid .admin-day-header {
  grid-column: 1 / -1;
  display: block;
  margin: 12px 0 8px;
  font-weight: 700;
  color: var(--dark);
}
[data-theme=\"dark\"] .admin-withdrawals-grid .admin-day-header {
  color: #e5e7eb;
}
/* Mobile header controls */
.header-inner { position: relative; }
.icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--dark);
}
.dashboard-header .icon-btn { color: #fff; }
[data-theme="dark"] .icon-btn { color: #e5e7eb; }
.hamburger { display: none; }
.settings-btn { display: inline-flex; align-items: center; justify-content: center; }
.settings-menu {
  position: absolute;
  right: 0;
  top: 52px;
  background: #fff;
  border: 1px solid var(--gray);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow-md);
  display: none;
  min-width: 170px;
  z-index: 30;
}
.settings-menu.show { display: block; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9;
}
.sidebar.open { transform: translateX(0); }
.sidebar-footer { display: none; }
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 10;
    height: 100vh;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    max-width: 80%;
    display: flex;
    flex-direction: column;
  }
  .sidebar-overlay.show { display: block; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; margin-right: 10px; }
  .settings-btn { display: none; }
  .header-right { position: relative; gap: 8px; }
  .theme-btn, .header-right .btn.ghost:not(.notify-btn) { display: none; }
  .notify-btn { padding: 8px 10px; }
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding: 12px 18px 16px;
  }
  .sidebar-footer .btn { width: 100%; }
  .sidebar-footer .logout-btn {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    border: none;
  }
}
@media (max-width: 768px) { .container { padding: 0 12px; } }

@media (max-width: 840px) {
  .dashboard-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px;
    max-width: 80%;
    height: 100vh;
    transform: none;
    transition: left 0.3s ease;
    z-index: 12;
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
  }
  .sidebar-overlay.show,
  .sidebar.open + .sidebar-overlay {
    display: block;
  }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ RusichPay ===== */
@media (max-width: 768px) {

  body {
    font-size: 14px;
    line-height: 1.4;
    background: #050815; /* темный фон будет смотреться аккуратно */
  }

  /* Основной контейнер, чтобы всё не прилипало к краям */
  .container,
  .section,
  .section-inner {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
  }

  /* Шапка */
  header,
  .navbar {
    padding: 10px 16px !important;
  }

  .logo {
    font-size: 18px !important;
  }

  /* Если в шапке есть меню из нескольких пунктов — пусть они не жмутся в одну линию */
  .nav-links,
  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    font-size: 13px;
  }

  /* Крупные кнопки (зарегистрироваться / войти) на телефоне во всю ширину */
  .btn,
  button,
  .btn-primary,
  .btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    padding: 10px 14px;
  }

  /* HERO-блок (главный экран с заголовком и картой) */
  .hero,
  .hero-inner,
  .hero-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    text-align: left;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-title,
  h1 {
    font-size: 22px !important;
    line-height: 1.25;
  }

  .hero-subtitle,
  .hero-description {
    font-size: 14px !important;
    margin-top: 8px;
  }

  /* Карта RusichPay на главной — сделать компактнее и во всю ширину */
  .hero-card,
  .card-visual,
  .bank-card,
  .promo-card {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    transform: none !important;
  }

  /* Иконки + подписи (мгновенная выдача, защита, управление) в одну колонку */
  .features,
  .features-grid,
  .advantages-grid,
  .cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .feature-card,
  .card,
  .metric-card {
    width: 100% !important;
    margin: 0 !important;
  }

  .feature-title,
  .card-title {
    font-size: 14px !important;
  }

  .feature-text,
  .card-text {
    font-size: 13px !important;
  }

  /* Блоки "шагов" / "как это работает" */
  .steps,
  .steps-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .step {
    width: 100% !important;
  }

  /* Формы (регистрация, вход, выписка, детали обмена) */
  form {
    width: 100%;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100%;
    font-size: 14px;
    padding: 10px 12px;
  }

  .form-row,
  .form-group-inline,
  .filters-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  label {
    font-size: 13px;
  }

  /* Модальные окна (детали обмена, авторизация и т.п.) */
  .modal,
  .dialog {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .modal-content,
  .dialog-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 14px 14px 0 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none !important;
  }

  /* Таблицы (выписка, список обменов) — прокрутка по горизонтали внутрь блока */
  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
    font-size: 12px;
  }

  /* Личный кабинет (если есть двухколоночная сетка) */
  .layout,
  .dashboard-layout,
  .lk-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .sidebar,
  .lk-sidebar {
    order: 2;
  }

  .main-panel,
  .lk-main {
    order: 1;
  }

  /* Футер — в колонку */
  footer {
    padding: 16px;
    text-align: left;
  }

  .footer-columns,
  .footer-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .footer-columns > * {
    width: 100%;
  }

}
/* Прячем переключатель темы на мобильных устройствах */
@media (max-width: 768px) {
  .theme-toggle,
  .theme-switch,
  #theme-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}
/* Скрываем БАЛАНС только в шапке (dashboard topbar) на мобильных */
@media (max-width: 768px) {
  #dashboard .topbar-right .balance-lines {
    display: none !important;
  }
}
/* Скрываем кнопку "Выйти" только в шапке */
#dashboard .topbar-right button[data-action="logout"] {
    display: none !important;
}
@media (max-width: 900px) {
  #dashboard .sidebar {
    overflow-y: auto !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  #dashboard .sidebar.open {
    left: 0 !important;
  }

  #dashboard .sidebar:not(.open) {
    left: -300px !important;
  }
}
@media (max-width: 900px) {
  #dashboard .sidebar {
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
  }
}
@media (max-width: 900px) {
  #dashboard .sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* распределяем блоки */
    height: calc(100vh - 60px); /* ровно по экрану, исключая topbar */
    overflow: hidden !important; /* запрет прокрутки */
    padding-bottom: 20px; /* чтобы кнопка не липла к низу */
  }

  #dashboard .sidebar-menu {
    flex: 1; 
    overflow: visible; /* меню не скроллится */
  }

  #dashboard .sidebar-footer {
    margin-top: auto; /* кнопка всегда внизу */
  }
}
/* Спрятать карточку "Наши контакты" только на мобильных */
@media (max-width: 768px) {
  #main-section .cards-grid .card:nth-child(3) {
    display: none !important;
  }
}
/* Скрываем элементы на мобильных */
@media (max-width: 768px) {

  /* Скрыть заголовок "Добро пожаловать" */
  #main-section h2#welcome-title {
    display: none !important;
  }

  /* Скрыть текст под заголовком */
  #main-section > p {
    display: none !important;
  }

  /* Скрыть карточку "Наши контакты" (3-я карточка в cards-grid) */
  #main-section .cards-grid .card:nth-child(3) {
    display: none !important;
  }
}
/* Мобильная версия — скрываем "Всего обменов" в блоке Ваш баланс */
@media (max-width: 768px) {
  #main-section .cards-grid .card.metric .metric-sub {
    display: none !important;
  }
}

/* Мобильная история обменов:
   оставляем Дата / Отправлено / Получено
   без горизонтального скролла и обрезаний */
@media (max-width: 768px) {

  /* Скрываем Направление, Статус, Чек */
  #history-section table.history-table th:nth-child(2),
  #history-section table.history-table td:nth-child(2),
  #history-section table.history-table th:nth-child(5),
  #history-section table.history-table td:nth-child(5),
  #history-section table.history-table th:nth-child(6),
  #history-section table.history-table td:nth-child(6) {
    display: none !important;
  }

  /* Карточка с таблицей — меньше боковых отступов,
     чтобы таблица имела больше места */
  #history-section .card.full {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
  }

  /* Таблица на всю доступную ширину, без фиксированных ширин */
  #history-section table.history-table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
  }

  /* Ячейки — компактные, разрешаем перенос строк */
  #history-section table.history-table th,
  #history-section table.history-table td {
    padding: 4px 2px !important;
    font-size: 11px !important;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }
}
/* Мобилка: история обменов без горизонтального скролла */
@media (max-width: 768px) {

  /* Скрываем Направление, Статус и Чек */
  #history-section table.history-table th:nth-child(2),
  #history-section table.history-table td:nth-child(2),
  #history-section table.history-table th:nth-child(5),
  #history-section table.history-table td:nth-child(5),
  #history-section table.history-table th:nth-child(6),
  #history-section table.history-table td:nth-child(6) {
    display: none !important;
  }

  /* ВАЖНО: отменяем min-width:600px и растягиваем по экрану */
  #history-section table.history-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
  }

  /* Ячейки делаем компактнее, чтобы всё влезало */
  #history-section table.history-table th,
  #history-section table.history-table td {
    padding: 4px 2px !important;
    font-size: 11px !important;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }

  /* Чуть ужимаем сам белый блок с таблицей */
  #history-section .card.full {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
  }
}
/* Мобильная версия — реферальная система */
@media (max-width: 768px) {

  /* Отключаем горизонтальный скроллинг */
  #referral-section .card.full {
    overflow-x: hidden !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Скрываем лишние колонки:
     2-я — например Имя/Email,
     3-я — Количество обменов
  */
  #referral-section table th:nth-child(2),
  #referral-section table td:nth-child(2),
  #referral-section table th:nth-child(3),
  #referral-section table td:nth-child(3) {
    display: none !important;
  }

  /* Делаем таблицу под мобильный экран */
  #referral-section table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  /* Уменьшаем текст и отступы, чтобы всё влезало */
  #referral-section table th,
  #referral-section table td {
    font-size: 12px !important;
    padding: 6px 2px !important;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }
}
/* Мобильная версия — растянуть таблицу Реферальной системы */
@media (max-width: 768px) {

  #referral-section .card.full {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Таблица ровно на всю ширину */
  #referral-section table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
  }

  /* Две колонки — по 50% */
  #referral-section table th,
  #referral-section table td {
    width: 50% !important;
    text-align: center;
    padding: 10px 4px !important;
    font-size: 14px !important;
    white-space: nowrap;
  }
}
/* === МОБИЛЬНАЯ ВЕРСИЯ: ВЫВОД СРЕДСТВ === */
@media (max-width: 768px) {

  /* Все поля формы в один столбец */
  #withdraw-section form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  #withdraw-section form input,
  #withdraw-section form select,
  #withdraw-section form button {
    width: 100% !important;
  }


  /* === ИСТОРИЯ ВЫВОДОВ — убираем горизонтальный скролл === */

  /* Скрываем лишние колонки, оставляем только:
     1 — Дата
     3 — Сумма
     5 — Статус
  */

  /* Скрываем колонку №2 */
  #withdraw-section table th:nth-child(2),
  #withdraw-section table td:nth-child(2) {
    display: none !important;
  }

  /* Скрываем колонку №4 */
  #withdraw-section table th:nth-child(4),
  #withdraw-section table td:nth-child(4) {
    display: none !important;
  }

  /* Скрываем колонку №6 если есть (например чек / комментарий) */
  #withdraw-section table th:nth-child(6),
  #withdraw-section table td:nth-child(6) {
    display: none !important;
  }

  /* Таблица должна растянуться под экран */
  #withdraw-section table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
  }

  /* Ячейки делаем компактными */
  #withdraw-section table th,
  #withdraw-section table td {
    padding: 6px 2px !important;
    font-size: 12px !important;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }

  /* Как и в других секциях — убираем скроллинг карточки */
  #withdraw-section .card.full {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
  }
}
/* МОБИЛЬНАЯ ВЕРСИЯ: окно подключения 2FA */
@media (max-width: 768px) {

  /* Окно влезает в экран, но логика открытия/закрытия не трогаем */
  #twofaSetupModal .modal-content {
    width: calc(100% - 24px);   /* почти во всю ширину, с небольшими полями */
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0 auto;             /* по центру по горизонтали */
  }

  /* Перестраиваем содержимое в один столбик */
  #twofaSetupModal .modal-body {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* QR-блок по центру, на всю ширину */
  #twofaSetupModal .qr-column {
    width: 100%;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
  }

  #twofaSetupModal .qr-column img {
    width: 70%;
    max-width: 240px;
    height: auto;
  }

  /* Текстовая колонка тоже на всю ширину */
  #twofaSetupModal .info-column {
    width: 100%;
  }

  /* Инпут и кнопки во всю ширину — удобнее на телефоне */
  #twofaSetupModal input,
  #twofaSetupModal button {
    width: 100%;
  }
}
/* Единый красивый крестик для всех модальных окон */
.modal-content .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 300;
  color: #333;
  background: #ffffffcc;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}

/* Ховер (для ПК) и тап-анимация */
.modal-content .modal-close:hover {
  background: #fff;
  transform: scale(1.1);
}

.modal-content {
  position: relative; /* важно, чтобы крестик позиционировался внутри */
}
@media (max-width: 768px) {
  .modal-content .modal-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 28px;
  }
}
@media (max-width: 768px) {

  /* Колонка с QR на всю ширину и по центру */
  #twofaSetupModal .qr-column {
    width: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Сам QR строго по центру */
  #twofaSetupModal .qr-column img {
    margin: 0 auto !important;
    width: 75% !important;
    max-width: 240px !important;
    height: auto !important;
  }
}
/* === Центровка QR-кода в модалке 2FA (мобильная версия) === */
@media (max-width: 768px) {

  /* Делаем тело модалки вертикальным */
  #twofaSetupModal .modal-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding: 0 !important;
  }

  /* Колонка с QR */
  #twofaSetupModal .qr-column {
    width: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }

  /* Сам QR-код */
  #twofaSetupModal .qr-column img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 260px !important;
    width: 80% !important;
    height: auto !important;
  }
}
/* === Мобильная перестройка кнопки 2FA под поле ввода === */
@media (max-width: 768px) {

  /* Перестраиваем actions в столбик */
  #twofaSetupModal .actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 12px;
  }

  /* Поле ввода кода на всю ширину */
  #twofaSetupModal .input-group,
  #twofaSetupModal input {
    width: 100% !important;
  }

  /* Кнопка "Подтвердить и включить" */
  #twofaSetupModal .actions .btn.primary {
    width: 100% !important;
  }

  /* Кнопка "Отмена" */
  #twofaSetupModal .actions .btn.ghost {
    width: 100% !important;
  }
}

/* === 2FA setup modal: без живого кода, широкая кнопка "Отмена" === */

/* прячем блок с текущим кодом и подписью */
#twofaLiveWrap {
  display: none !important;
}

/* прячем соседний "растягивающий" div, чтобы не мешал кнопке */
#twofaLiveWrap + div {
  display: none !important;
}

/* делаем кнопку "Отмена" широкой */
#twofaSetupCancel {
  width: 100% !important;
  flex: 1 1 auto !important;
  text-align: center;
  justify-content: center;
}
/* Полностью выключаем подсказку "Открыт раздел ..." */
#dashboard .section-hint {
  display: none !important;
}


