:root {
  --bg-main: #080c14;
  --bg-sidebar: #0d121c;
  --card-bg: #111724;
  --card-hover: #151d2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-main: #ffffff;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --cyan: #38bdf8;
  --blue: #2563eb;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* САЙДБАР */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 28px 12px;
}
.brand-diamond {
  width: 24px;
  height: 24px;
  color: var(--cyan);
  flex-shrink: 0;
}
.brand-text {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.brand-text span { color: var(--cyan); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-sub);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #ffffff;
  background: #1e293b;
  font-weight: 600;
}
.nav-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.nav-pill {
  margin-left: auto;
  background: var(--yellow);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.download-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 11px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.download-sidebar-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* ПРАВЫЙ КОНТЕНТ */
.content-wrapper {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 68px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.crumb {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.user-info-text {
  display: flex;
  flex-direction: column;
}
.user-name { font-size: 13px; font-weight: 700; }
.user-roblox { font-size: 11px; color: var(--text-muted); }

.logout-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}
.logout-icon-btn:hover { color: var(--red); }

/* РАБОЧАЯ ОБЛАСТЬ */
.main-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tab-section { display: none; }
.tab-section.active { display: block; }

/* 3 КАРТОЧКИ КРИПТЕКС */
.k-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.k-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  position: relative;
}
.k-card-title {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.k-card-big-val {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--mono);
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.k-cur {
  font-family: var(--sans);
  font-size: 22px;
  color: var(--cyan);
}
.text-cyan { color: var(--cyan) !important; }

.k-balance-sub {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.k-sub-item { display: flex; align-items: center; gap: 6px; }
.k-sub-item strong { color: #ffffff; }
.k-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.k-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.k-dot.yellow { background: var(--yellow); }

.k-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ГРАФИК */
.chart-card {
  margin-bottom: 24px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.chart-legend {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-box {
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 2px;
}

.chart-container {
  display: flex;
  align-items: flex-end;
  height: 180px;
  gap: 16px;
  padding-top: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
}
.bar-fill {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-height: 4px;
}
.bar-fill:hover {
  filter: brightness(1.2);
}
.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}
.bar-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.bar-fill:hover .bar-tooltip { opacity: 1; }

/* АКТИВНОСТЬ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.activity-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-title { font-weight: 600; font-size: 13px; }
.activity-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-val { font-family: var(--mono); font-weight: 700; color: var(--green); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px;
  font-size: 13px;
}

/* ВЫПЛАТЫ */
.payout-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}
.form-group input {
  background: #090d15;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.form-group input:focus { border-color: var(--cyan); }
.form-help { font-size: 11px; color: var(--text-muted); }
.form-help a { color: var(--cyan); text-decoration: none; }

.calc-alert-box {
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.calc-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.submit-payout-btn {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.submit-payout-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ТАБЛИЦЫ */
.k-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.k-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.k-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.empty-cell { text-align: center; color: var(--text-muted); padding: 30px; }

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.status-badge.pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-badge.processing { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.status-badge.completed { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-badge.rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* РЕФЕРАЛЫ */
.referral-box {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-input-wrap {
  display: flex;
  gap: 10px;
}
.ref-input-wrap input {
  flex: 1;
  background: #090d15;
  border: 1px solid var(--border);
  padding: 10px 14px;
  color: #fff;
  border-radius: 8px;
  font-family: var(--mono);
}
.copy-btn {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border);
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-btn:hover { background: #334155; }

/* АВТОРИЗАЦИЯ МОДАЛКА САЙТА */
.site-auth-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.site-auth-modal.active { display: flex; }
.site-auth-card {
  width: 400px;
  background: #111726;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-title { font-family: 'Unbounded', sans-serif; font-size: 20px; font-weight: 900; }
.auth-title span { color: var(--cyan); }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 4px; margin-bottom: 16px; }
.auth-tab { text-align: center; padding: 8px; font-size: 13px; font-weight: 600; color: var(--text-sub); cursor: pointer; border-radius: 6px; }
.auth-tab.active { background: #1e293b; color: #fff; }
.auth-error-banner { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 14px; display: none; }

@media (max-width: 900px) {
  .sidebar { width: 70px; padding: 18px 8px; }
  .brand-text, .nav-item span, .download-sidebar-btn span { display: none; }
  .content-wrapper { margin-left: 70px; }
  .payout-layout { grid-template-columns: 1fr; }
}
