/* ──────────────────────────────────────────
 * Капсула — единый стиль кабинета
 * Подключается во все страницы кабинета и накладывается
 * поверх существующих стилей. Цель — общий язык с лендингом.
 * ────────────────────────────────────────── */

:root {
  --bg: #F5F2FF;
  --bg-2: #EFEAFE;
  --white: #FFFFFF;
  --primary: #7C3AED;
  --primary-2: #6C2BD9;
  --primary-light: #A78BFA;
  --accent: #3B82F6;
  --gold: #FBBF24;
  --green: #10B981;
  --coral: #F43F5E;
  --amber: #F59E0B;
  --text: #1A0F3C;
  --muted: #7B7499;
  --grad: linear-gradient(135deg, #7C3AED 0%, #3B82F6 100%);
  --grad-text: linear-gradient(120deg, #7C3AED 0%, #3B82F6 100%);
  --border: rgba(124, 58, 237, 0.12);
  --shadow-card: 0 4px 24px rgba(124, 58, 237, 0.06);
  --shadow-card-hover: 0 12px 40px rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] {
  --bg: #0A0413;
  --bg-2: #160A26;
  --white: #1A0F30;
  --text: #F4F0FF;
  --muted: #9B95B8;
  --border: rgba(167, 139, 250, 0.18);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 16px 48px rgba(124, 58, 237, 0.25);
}

/* ── Floating orbs background (тонко, не отвлекает) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px circle at 5% -10%, rgba(124, 58, 237, 0.10), transparent 50%),
    radial-gradient(600px circle at 95% 15%, rgba(59, 130, 246, 0.08), transparent 50%),
    radial-gradient(500px circle at 50% 95%, rgba(251, 191, 36, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: cabinet-orbs 30s ease-in-out infinite;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(700px circle at 5% -10%, rgba(124, 58, 237, 0.20), transparent 50%),
    radial-gradient(600px circle at 95% 15%, rgba(59, 130, 246, 0.15), transparent 50%),
    radial-gradient(500px circle at 50% 95%, rgba(251, 191, 36, 0.08), transparent 50%);
}
@keyframes cabinet-orbs {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

/* ── Контент над фоном ──
   Не трогаем position у элементов, у которых он уже задан
   (header — sticky, mobile-menu — fixed). Только z-index.
   Header выше main, иначе main перекрывает его и дропдаун
   профиля исчезает за контентом страницы. */
main, footer { position: relative; z-index: 1; }
header { z-index: 100; }
.header-inner { position: relative; z-index: 1; }
.mobile-menu, .mob-overlay, .modal-overlay, .test-mask { z-index: 99; }

/* ── HEADER (стеклянный, sticky) ── */
header {
  background: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 30px rgba(124, 58, 237, 0.04) !important;
}
[data-theme="dark"] header {
  background: rgba(10, 4, 19, 0.7) !important;
}

/* Лого — иконка с тенью + правильная типографика */
.logo {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  font-family: 'Syne', sans-serif !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  letter-spacing: -0.4px !important;
  text-decoration: none !important;
}
.logo img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
  margin-right: 0 !important;
}

/* ── PROFILE BUTTON — мягкий gradient ── */
.profile-btn {
  background: var(--grad) !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35) !important;
}

/* ── BALANCE PILL ── */
.balance-pill {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(59,130,246,0.06)) !important;
  border-color: rgba(16,185,129,0.22) !important;
}

/* ── CARDS — все унифицированы ── */
.card,
.section-box,
.tbl-card,
.kpi,
.stat-card,
.feature,
.shop-card,
.balance-card,
.price-card {
  border-radius: 18px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-card) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.shop-card:hover,
.feature:hover,
.stat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--shadow-card-hover) !important;
  border-color: rgba(124, 58, 237, 0.22) !important;
}

/* ── BUTTONS — единый стиль ── */
.btn-save,
.action-btn.primary,
.shop-btn-primary,
.btn-payout,
.btn:not(.btn-outline):not(.btn-ghost):not(.btn-secondary) {
  background: var(--grad) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.32) !important;
  transition: transform 0.18s, box-shadow 0.25s !important;
}
.btn-save:hover:not(:disabled),
.action-btn.primary:hover,
.shop-btn-primary:hover,
.btn:not(.btn-outline):not(.btn-ghost):not(.btn-secondary):hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45) !important;
}

/* ── KPI / STAT CARDS — стеклянные ── */
.kpi, .stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.74)) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .kpi,
[data-theme="dark"] .stat-card {
  background: linear-gradient(180deg, rgba(124,58,237,0.08), rgba(124,58,237,0.02)) !important;
}

.kpi::after,
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.8;
}
.kpi.green::after { background: linear-gradient(90deg, #10B981, #34D399); }
.kpi.amber::after { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.kpi.fail::after, .kpi.red::after { background: linear-gradient(90deg, #EF4444, #F87171); }

/* ── PAGE TITLES ── */
.page-title {
  font-family: 'Syne', sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── STATUS PILLS улучшены ── */
.status-badge,
.tx-status,
.pay-status {
  letter-spacing: 0.3px;
  font-weight: 700;
}

/* ── INPUTS — мягче бордеры ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea,
.search,
.test-input,
.field input,
.filters input,
.filters select {
  border-radius: 11px !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
.search:focus,
.test-input:focus,
.field input:focus,
.filters input:focus,
.filters select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.10) !important;
  outline: none !important;
}

/* ── NAV LINKS — подчёркивание плавнее ── */
nav a {
  position: relative;
}
nav a:not(.active)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--grad);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
nav a:hover::after {
  width: 60%;
}

/* ── DROPDOWN — стеклянный ── */
.dropdown {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px !important;
  box-shadow: 0 16px 48px rgba(124, 58, 237, 0.18) !important;
}
[data-theme="dark"] .dropdown {
  background: rgba(22, 10, 38, 0.95) !important;
}

/* ── REVEAL ANIMATION для контента кабинета ── */
@keyframes cab-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
main > * {
  animation: cab-fade-up 0.5s cubic-bezier(.19,1,.22,1) backwards;
}
main > *:nth-child(1) { animation-delay: 0s; }
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(5) { animation-delay: 0.24s; }

/* ── SCROLLBAR (более тонкий и брендированный) ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.4); }

/* ── LOADING SPINNERS — единый стиль ── */
.spinner,
.loading::before {
  border-color: rgba(124, 58, 237, 0.18);
  border-top-color: var(--primary);
}

/* ── PAYMENT ROWS / TX TABLES — улучшенный hover ── */
.pay-table tr:hover td,
.tx-table tr:hover td,
table tbody tr:hover {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.04), rgba(59, 130, 246, 0.02)) !important;
}

/* ── HIGHLIGHT: успешные суммы зеленее, отказы краснее ── */
.tx-status.success,
.pay-status.success {
  background: linear-gradient(135deg, rgba(16,185,129,0.16), rgba(16,185,129,0.10)) !important;
  border: 1px solid rgba(16,185,129,0.25);
}

/* ── TOGGLE для кассы — чуть приятнее ── */
.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #10B981, #34D399) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* ── EMPTY STATES — мягче иконки ── */
.empty-icon-big,
.empty-icon {
  background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(59,130,246,0.06)) !important;
  filter: drop-shadow(0 4px 14px rgba(124, 58, 237, 0.15));
}

/* ── ICON SYSTEM ── */
i[data-i] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-style: normal;
  flex-shrink: 0;
  vertical-align: -0.15em;
}
i[data-i] svg {
  width: 1.05em;
  height: 1.05em;
  display: block;
}
/* sizes */
i.ico-sm { font-size: 14px; }
i.ico-md { font-size: 18px; }
i.ico-lg { font-size: 22px; }
i.ico-xl { font-size: 28px; }

/* sidebar / nav icons */
nav a i[data-i],
.sb-item i[data-i],
.mobile-nav a i[data-i],
.dd-item i[data-i],
.nav i[data-i] {
  font-size: 17px;
  margin-right: 10px;
  color: var(--muted);
  transition: color 0.15s;
}
nav a:hover i[data-i],
nav a.active i[data-i],
.sb-item:hover i[data-i],
.sb-item.active i[data-i],
.dd-item:hover i[data-i] {
  color: var(--primary);
}
nav a.active i[data-i] {
  color: var(--primary);
}

/* page title icons get gradient */
.page-title i[data-i],
.card-title i[data-i],
.section-title i[data-i],
.tbl-title i[data-i] {
  font-size: 1.05em;
  margin-right: 8px;
  color: var(--primary);
  vertical-align: -0.18em;
}

/* button icons */
.btn i[data-i],
.btn-save i[data-i],
.shop-btn i[data-i],
.action-btn i[data-i],
.h-cta i[data-i],
.btn-test i[data-i],
.btn-payout i[data-i] {
  font-size: 16px;
  margin-right: 6px;
}

/* status icons coloring */
.tx-status i[data-i],
.pay-status i[data-i] {
  font-size: 13px;
  margin-right: 4px;
}

/* stat-icon container should accommodate svg */
.stat-icon i[data-i] { font-size: 22px; }

/* MOBILE: лучше тапаемые элементы */
@media (max-width: 640px) {
  .btn-save, .action-btn, .shop-btn { min-height: 44px; }
  .toggle { width: 50px; height: 28px; }
}
