/**
 * Premium dashboard: glassmorphism + dark theme + gradients + motion
 * Scoped under .dash-premium to avoid clashes with legacy .dashboard-* in style.css
 */

.dash-premium {
  --dash-bg-0: #080c14;
  --dash-bg-1: #0a1018;
  --dash-shell: #0c121a;
  --dash-glass: rgba(255, 255, 255, 0.06);
  --dash-glass-border: rgba(255, 255, 255, 0.12);
  --dash-text: #f1f5f9;
  --dash-muted: #94a3b8;
  --dash-accent: #38bdf8;
  --dash-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  position: relative;
  isolation: isolate;
  color: var(--dash-text);
  padding: 0 !important;
  margin: -1rem !important;
  margin-top: 0 !important;
  min-height: calc(100vh - 52px);
  overflow: hidden;
  border-radius: 0;
  background: var(--dash-shell);
}

/* Variant 1: тёмный glassmorphism для ВСЕЙ страницы app.html, когда активен .dash-premium */

/* Полный reset для HTML и body */
html:has(.dash-premium) {
  background: #0c121a !important;
  color: #f1f5f9;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  height: 100%;
  overflow-x: hidden;
  color-scheme: dark;
}

body:has(.dash-premium) {
  background: #0c121a !important;
  color: #f1f5f9;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  position: relative;
  top: 0 !important;
  min-height: 100vh;
  overflow-x: hidden;
  color-scheme: dark;
}

/* Убираем ВСЕ верхние отступы для прямых потомков body */
body:has(.dash-premium) > * {
  margin-top: 0 !important;
}

body:has(.dash-premium) > *:first-child {
  margin-top: 0 !important;
  padding-top: 0.75rem !important;
}

body:has(.dash-premium) *::before,
body:has(.dash-premium) *::after {
  margin-top: 0 !important;
}

/* Нативные select/option в тёмной теме (Chrome/Edge частично подхватывает color-scheme; доп. страховка) */
body:has(.dash-premium) select:not([multiple]) {
  background-color: rgba(15, 23, 42, 0.92);
  color: var(--dash-text, #f1f5f9);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body:has(.dash-premium) select option {
  background-color: #0f172a;
  color: #f1f5f9;
}

body:has(.dash-premium) .layout {
  background: var(--dash-shell);
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body:has(.dash-premium) .main {
  background: var(--dash-shell);
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Убираем светлые отступы/рамки каркаса (style.css), чтобы premium не "ломал" геометрию */

body:has(.dash-premium) .panel {
  padding: 0 !important;
  margin: 0 !important;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:has(.dash-premium) #extra {
  padding: 0 !important;
  margin: 0 !important;
}

body:has(.dash-premium) pre.data#out {
  display: none;
}

/* Шапка */
body:has(.dash-premium) .app-header {
  background: #0c121a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dash-text);
  margin: 0 !important;
  padding: 0.75rem 1rem !important;
  position: relative;
  top: 0 !important;
}

body:has(.dash-premium) .app-header strong {
  color: var(--dash-text);
}

body:has(.dash-premium) .app-header .user {
  color: var(--dash-muted);
}

body:has(.dash-premium) .app-header .header-logout-btn {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(241, 245, 249, 0.94);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body:has(.dash-premium) .app-header .header-logout-btn:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecdd3;
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.22) 0%,
    rgba(239, 68, 68, 0.08) 100%
  );
  box-shadow:
    0 12px 32px rgba(239, 68, 68, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

body:has(.dash-premium) .app-header .header-logout-btn:active {
  transform: translateY(0);
}

body:has(.dash-premium) .app-header .header-logout-btn:focus-visible {
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

body:has(.dash-premium) .app-header .header-lang-btn {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(241, 245, 249, 0.94);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body:has(.dash-premium) .app-header .header-lang-btn:hover {
  border-color: rgba(129, 140, 248, 0.55);
  color: #f8fafc;
  background: linear-gradient(
    180deg,
    rgba(129, 140, 248, 0.22) 0%,
    rgba(129, 140, 248, 0.08) 100%
  );
  transform: translateY(-1px);
}

/* Левое меню */
body:has(.dash-premium) .nav {
  background: #0c121a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

body:has(.dash-premium) .nav button {
  color: rgba(226, 232, 240, 0.92);
}

body:has(.dash-premium) .nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.96);
}

body:has(.dash-premium) .nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 250, 252, 0.96);
}

/* Toolbar в тёмной теме (иначе кнопки остаются белыми из style.css) */
body:has(.dash-premium) .toolbar {
  background: transparent !important;
  padding: 0;
  margin: 0;
}

body:has(.dash-premium) #section-title {
  display: none;
}

body:has(.dash-premium) .panel h2 {
  display: none;
}

body:has(.dash-premium) .toolbar button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--dash-text);
}

body:has(.dash-premium) .toolbar button:hover {
  background: rgba(255, 255, 255, 0.12);
}

body:has(.dash-premium) .muted {
  color: var(--dash-muted);
}

@media (prefers-reduced-motion: reduce) {
  .dash-premium *,
  .dash-premium *::before,
  .dash-premium *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Лёгкий шум поверх общего цвета (без резких пятен) */
.dash-premium-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(99, 102, 241, 0.07), transparent 55%);
  opacity: 1;
  filter: none;
  pointer-events: none;
}

.dash-premium-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.55) 0%, var(--dash-shell) 38%, var(--dash-shell) 100%);
  pointer-events: none;
}

.dash-premium-inner {
  position: relative;
  z-index: 2;
  padding: 1.35rem 1.25rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  min-width: 0;
}

/* Hero */
.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  animation: dashFadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff 0%, #c7d2fe 45%, #f5d0fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-hero-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--dash-muted);
}

/* Виджет времени */
.dash-clock-widget {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
  padding: 0.85rem 1.05rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.12),
    0 14px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  animation: dashFadeInUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}

.dash-clock-day {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 0.35rem;
}

.dash-clock-row {
  display: flex;
  align-items: baseline;
  gap: 0.08em;
  font-variant-numeric: tabular-nums;
}

.dash-clock-hms,
.dash-clock-minutes {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 12%, #a5b4fc 52%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-clock-colon {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: rgba(148, 163, 184, 0.75);
}

.dash-clock-sec-wrap {
  margin-top: 0.45rem;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.dash-clock-seconds {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dash-accent);
  text-shadow:
    0 0 20px rgba(56, 189, 248, 0.45),
    0 0 32px rgba(56, 189, 248, 0.2);
  animation: dashSecGlow 2s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}

.dash-clock-sec-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.8);
}

@keyframes dashSecGlow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}


@keyframes dashFadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes dashShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Stat grid */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 1199px) {
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 559px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }
}

.dash-stat-card {
  position: relative;
  border-radius: 18px;
  padding: 1.15rem 1.2rem;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid var(--dash-glass-border);
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--c1) 88%, transparent) 0%,
    rgba(255, 255, 255, 0.04) 48%,
    color-mix(in srgb, var(--c2) 55%, transparent) 110%
  );
  backdrop-filter: blur(22px);
  box-shadow:
    var(--dash-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.38s ease,
    border-color 0.35s ease;
  animation: dashFadeInUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-stat-card[data-dash-delay='1'] {
  animation-delay: 0.08s;
}

.dash-stat-card[data-dash-delay='2'] {
  animation-delay: 0.16s;
}

.dash-stat-card[data-dash-delay='3'] {
  animation-delay: 0.24s;
}

.dash-stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.5),
    0 0 40px color-mix(in srgb, var(--c2) 22%, transparent);
  border-color: color-mix(in srgb, var(--c2) 45%, white);
}

.dash-stat-card::before {
  content: '';
  position: absolute;
  inset: -30%;
  background: radial-gradient(
    circle at 20% 20%,
    color-mix(in srgb, var(--c2) 28%, transparent),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0.9;
}

.dash-stat-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  z-index: 1;
}

.dash-stat-icon {
  font-size: 1.55rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.dash-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(241, 245, 249, 0.85);
}

.dash-stat-value {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.dash-stat-hint {
  position: relative;
  z-index: 1;
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.35;
}

.dash-spark {
  width: 100%;
  height: 40px;
  margin-top: 0.65rem;
  display: block;
  border-radius: 8px;
  opacity: 0.92;
}

/* Charts row */
.dash-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 992px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

.dash-chart-panel {
  position: relative;
  border-radius: 18px;
  padding: 1rem 1.05rem;
  border: 1px solid var(--dash-glass-border);
  background: var(--dash-glass);
  backdrop-filter: blur(26px);
  box-shadow: var(--dash-shadow);
  animation: dashFadeInUp 0.82s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.dash-chart-panel h3 {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.dash-chart-canvas-wrap {
  position: relative;
  height: 240px;
}

@media (max-width: 559px) {
  .dash-chart-canvas-wrap {
    height: 200px;
  }
}

.dash-chart-canvas-wrap canvas {
  max-height: 100%;
}

/* Glass panels: quick stats + devices */
.dash-glass-panel {
  position: relative;
  border-radius: 18px;
  padding: 1rem 1.05rem;
  margin-bottom: 1rem;
  border: 1px solid var(--dash-glass-border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  box-shadow: var(--dash-shadow);
  animation: dashFadeInUp 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.dash-glass-panel h3 {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #cbd5f5;
}

/* Quick stats (Karaya): двухколоночный блок glassmorphism */
.dash-qs-title {
  margin: 0 0 1rem;
}

.dash-qs-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-height: 200px;
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@media (max-width: 992px) {
  .dash-qs-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.dash-qs-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  background: transparent;
}

.dash-qs-col-billing {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-right: 1.5rem;
}

@media (max-width: 992px) {
  .dash-qs-col-billing {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-right: 0;
    padding-bottom: 1rem;
  }
}

.dash-qs-col-billing img {
  vertical-align: middle;
  filter: saturate(1.08);
}

.dash-qs-month-stat {
  margin-bottom: 1rem;
}

.dash-qs-month-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.dash-qs-month-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.dash-qs-month-number {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
  color: #f3f4f6;
  font-variant-numeric: tabular-nums;
}

.dash-qs-month-unit {
  font-size: 0.875rem;
  color: #6b7280;
}

.dash-qs-duration-block {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-qs-duration-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.dash-qs-duration-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e0f2fe;
  font-variant-numeric: tabular-nums;
}

.dash-premium .dash-qs-col-billing table {
  display: none;
}

.dash-qs-empty {
  margin: 0;
  padding: 1rem 0;
  color: #9ca3af;
}

.dash-qs-bal-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.dash-qs-balance-canvas {
  display: block;
  width: 100%;
  height: 64px;
  margin: 0 0 1rem;
  border-radius: 8px;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.3));
}

.dash-qs-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: #e2e8f0;
}

.dash-qs-meta-lbl {
  color: #6b7280;
}

.dash-qs-meta-val {
  font-weight: 500;
  color: #f3f4f6;
}

.dash-qs-balance-row .dash-qs-meta-lbl {
  font-weight: 400;
}

.dash-qs-balance-big {
  font-size: 0.875rem;
  font-weight: 400;
  color: #60a5fa;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  color: #bae6fd;
  letter-spacing: -0.01em;
}

/* Устройства: сетка карточек (дашборд) */
.dash-dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.35rem;
}

.dash-dev-card {
  position: relative;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    158deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 48%,
    rgba(129, 140, 248, 0.06) 100%
  );
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s ease,
    border-color 0.3s ease;
}

.dash-dev-card:hover {
  transform: translateY(-5px);
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(99, 102, 241, 0.2);
}

.dash-dev-status-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dash-dev-status-tag.is-on {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.42);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.2);
}

.dash-dev-status-tag.is-off {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.32);
}

.dash-dev-ext-num {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #eef2ff;
  margin-bottom: 0.45rem;
  padding-right: 5rem;
}

.dash-dev-card-sub {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.dash-dev-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
  font-size: 0.76rem;
  padding: 0.35rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.dash-dev-card-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.dash-dev-k {
  color: rgba(148, 163, 184, 0.9);
  flex-shrink: 0;
}

.dash-dev-v {
  font-weight: 600;
  color: #f1f5f9;
  text-align: right;
  word-break: break-word;
}


/* Совместимость старых вложений .dash-quick-inner внутри дашборда */
.dash-premium .dash-quick-inner {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
}

/* Toolbar refresh */
/* (removed empty hook rule) */

body .main .toolbar .dash-btn-refresh {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(236, 72, 153, 0.35));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

body .main .toolbar .dash-btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35);
}

/* Skeleton */
.dash-skeleton {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dash-glass-border);
  overflow: hidden;
  position: relative;
  min-height: 120px;
}

.dash-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: dashShimmer 1.4s infinite;
}

.dash-skel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1199px) {
  .dash-skel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 559px) {
  .dash-skel-grid {
    grid-template-columns: 1fr;
  }
}

.dash-empty-charts {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--dash-muted);
  font-size: 0.88rem;
}

/* Devices table dark premium theme */
.dash-devices-table-wrap {
  margin-top: 1rem;
  border-radius: 16px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Пагинация «Последние звонки» / записи: один ряд, без «лестницы» из десятков кнопок */
.lc-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  min-width: 0;
}

.lc-page-jump-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
}

.lc-page-jump-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.88rem;
}

.lc-page-jump {
  min-width: 3.25rem;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
}

.lc-page-jump-input {
  box-sizing: border-box;
  width: 4.35rem;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--dash-text, #f1f5f9);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.lc-page-jump-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

.lc-page-jump-input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.lc-page-jump-input::-webkit-outer-spin-button,
.lc-page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lc-page-jump-input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.lc-page-btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
}


/* Записи: «Результаты» на всю ширину панели; таблица как у «Последние звонки» (те же padding/раскладка колонок) */
.rec-results-host {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#rec-export-table th,
#rec-export-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Таблица «Записи»: ширина колонок, шапка над данными, действия узкие по центру */
#rec-export-table {
  min-width: 0;
}

#rec-export-table col.rec-col-action {
  width: 3.25rem;
}

#rec-export-table col.rec-col-data {
  width: auto;
}

#rec-export-table th,
#rec-export-table td {
  padding: 0.55rem 0.65rem;
  box-sizing: border-box;
}

#rec-export-table th.rec-th-data,
#rec-export-table td.rec-td-data {
  text-align: left;
  min-width: 0;
}

#rec-export-table th.rec-th-action,
#rec-export-table td.rec-td-action {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

#rec-export-table td.rec-td-action {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* Перебиваем поведение «последней колонки» у общей dash-devices-table */
#rec-export-table th:last-child,
#rec-export-table td:last-child {
  text-align: inherit;
}

#rec-export-table th.rec-th-action:last-child,
#rec-export-table td.rec-td-action:last-child {
  text-align: center;
}

#rec-export-table th.rec-th-data:last-child,
#rec-export-table td.rec-td-data:last-child {
  text-align: left;
}

#rec-export-table .rec-cell-text {
  display: block;
  max-width: 100%;
}

#rec-export-table td.rec-td-wrap .rec-cell-text {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#rec-export-table td.rec-td-ellipsis .rec-cell-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rec-export-table th.rec-th-data {
  vertical-align: bottom;
}

#rec-export-table th.rec-th-action {
  vertical-align: middle;
}

.dash-devices-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: fixed;
}

.dash-devices-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.dash-devices-table thead tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-devices-table th {
  text-align: left;
  padding: 0.45rem 0.4rem;
  font-weight: 500;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: bottom;
}

.dash-devices-table th:last-child {
  text-align: right;
}

.dash-devices-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease;
}

.dash-devices-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dash-devices-table td {
  padding: 0.5rem 0.4rem;
  color: rgba(226, 232, 240, 0.95);
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}


.dash-devices-table td:last-child {
  text-align: right;
}

.dash-table-id {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: rgba(203, 213, 225, 0.85);
  font-size: 0.85rem;
}

.dash-table-ext {
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.dash-table-login {
  color: rgba(148, 163, 184, 0.9);
}

/* Платежи: колонка «Адрес» + копирование */
.payments-address-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.payments-address-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  color: rgba(226, 232, 240, 0.95);
}

.payments-copy-btn {
  flex-shrink: 0;
  appearance: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.payments-copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
}

.payments-copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.dash-table-status-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-table-status-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.dash-table-status-icon.online {
  color: #22c55e;
}

.dash-table-status-icon.offline {
  color: #6b7280;
}

.dash-table-status-text {
  color: rgba(203, 213, 225, 0.9);
  font-size: 0.85rem;
}

.dash-table-online-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dash-table-online-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.dash-table-online-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.dash-table-online-dot.offline {
  background: #374151;
}

.dash-table-online-text {
  font-weight: 500;
  font-size: 0.85rem;
}

.dash-table-online-text.online {
  color: #22c55e;
}

.dash-table-online-text.offline {
  color: #6b7280;
}

/* 3 колонки для статистики устройств */
body:has(.dash-premium) .dash-stats.devices-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 992px) {
  body:has(.dash-premium) .dash-stats.devices-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body:has(.dash-premium) .dash-stats.devices-stats {
    grid-template-columns: 1fr;
  }
}

.dash-stat-icon img {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

/* Космический дизайн для фильтров */
.cosmic-filter-panel {
  backdrop-filter: blur(24px) saturate(180%);
}

.cosmic-date-row select,
.cosmic-date-row input {
  background: rgba(17, 24, 39, 0.8) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(10px);
}

.cosmic-date-row select:focus,
.cosmic-date-row input:focus {
  outline: none !important;
  border-color: rgba(139, 92, 246, 0.8) !important;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(99, 102, 241, 0.3) !important;
  background: rgba(30, 41, 59, 0.9) !important;
}

.cosmic-date-row select:hover,
.cosmic-date-row input:hover {
  border-color: rgba(139, 92, 246, 0.5) !important;
  background: rgba(30, 41, 59, 0.85) !important;
}

/* Анимация для электрической линии */
@keyframes electric-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.05);
  }
}

/* Анимация блика на кнопке */
@keyframes sparkle-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* Стили для других полей фильтра */
.lc-filters select,
.lc-filters input {
  background: rgba(17, 24, 39, 0.7) !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 0.6rem 0.9rem !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(8px);
}

.lc-filters select:focus,
.lc-filters input:focus {
  outline: none !important;
  border-color: rgba(139, 92, 246, 0.7) !important;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.4) !important;
  background: rgba(30, 41, 59, 0.85) !important;
}

.lc-filters select:hover,
.lc-filters input:hover {
  border-color: rgba(139, 92, 246, 0.4) !important;
  background: rgba(30, 41, 59, 0.75) !important;
}

/* Placeholder для инпутов */
.lc-filters input::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-style: italic;
}

/* Стили для таблиц статистики */
.us-summary-row {
  margin-bottom: 1.5rem;
}

.us-summary-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 0;
  align-items: stretch;
}

.us-summary-tables > .dash-glass-panel {
  min-height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
}

.us-summary-tables > .dash-glass-panel > .us-summary-inline {
  flex: 1 1 auto;
  min-height: 0;
}

/* Таблица и кольцевая диаграмма в одной карточке: сверху таблица, снизу график */
.us-summary-inline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

.us-summary-inline-table {
  min-width: 0;
  width: 100%;
}

/* Одинаковая сетка колонок между «Направление звонков» (Type·Count·%) и «Статус» (Disp·Out·In·Total) */
.us-summary-tables .us-summary-table-direction .dash-devices-table,
.us-summary-tables .us-summary-table-disposition .dash-devices-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

/* Первая колонка текстовых подписей — одинаковая доля под Disposition ↔ Type */
.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(1),
.us-summary-tables .us-summary-table-direction .dash-devices-table td:nth-child(1),
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(1),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(1) {
  width: 42%;
}

/* Направление: Count (~как сумма узких числовых в статусе — Out+In занимают почти те же два «слота» по ширине) */
.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(2),
.us-summary-tables .us-summary-table-direction .dash-devices-table td:nth-child(2) {
  width: 29%;
}
.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(3),
.us-summary-tables .us-summary-table-direction .dash-devices-table td:nth-child(3) {
  width: 29%;
}

/* Статус: узкие Out / In как у пары узких полей сверху, Total дополняет ряд как «третья цифра» */
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(2),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(2) {
  width: 19%;
}
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(3),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(3) {
  width: 19%;
}
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(4),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(4) {
  width: 20%;
}

.us-summary-tables .us-summary-table-direction .dash-devices-table td:nth-child(2),
.us-summary-tables .us-summary-table-direction .dash-devices-table td:nth-child(3),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(2),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(3),
.us-summary-tables .us-summary-table-disposition .dash-devices-table td:nth-child(4) {
  text-align: right;
}

.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(2),
.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(3),
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(2),
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(3),
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(4) {
  text-align: right;
}

.us-summary-tables .us-summary-table-direction .dash-devices-table th:nth-child(1),
.us-summary-tables .us-summary-table-disposition .dash-devices-table th:nth-child(1) {
  text-align: left;
}

.us-summary-tables .us-summary-inline-table td,
.us-summary-tables .us-summary-inline-table th {
  overflow-wrap: anywhere;
}

.us-summary-inline-chart {
  min-width: 0;
  max-width: min(260px, 100%);
  width: 100%;
  align-self: center;
  box-sizing: border-box;
}

/* Donut-сводки: те же акценты и hover, что у «Графики и визуализация», чуть компактнее */
.us-summary-inline-chart.user-stats-chart-wrapper {
  width: 100%;
  max-width: min(300px, 100%);
  padding: 1rem 1.1rem 1.2rem;
}

.us-summary-inline-chart.user-stats-chart-wrapper canvas {
  max-height: min(260px, 58vw);
  width: 100% !important;
}

@media (max-width: 992px) {
  .us-summary-tables > .dash-glass-panel > .us-summary-inline {
    min-height: unset;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }

  .us-summary-inline-chart,
  .us-summary-inline-chart.user-stats-chart-wrapper {
    width: min(300px, 100%);
    max-width: min(300px, 100%);
  }
}

@media (max-width: 768px) {
  .us-summary-tables {
    grid-template-columns: 1fr;
  }

  .us-summary-inline-chart {
    max-width: min(288px, 100%);
  }
}

/* Стили для мини-таблиц статистики - используем те же стили что и dash-devices-table */
.us-mini-table .dash-devices-table-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.us-mini-table .dash-devices-table {
  width: 100%;
  font-size: 0.85rem;
  table-layout: auto;
}

.us-mini-table .dash-devices-table thead {
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.us-mini-table .dash-devices-table th {
  padding: 0.7rem 0.9rem;
  font-size: 0.75rem;
  color: rgba(196, 181, 253, 0.95);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.us-mini-table .dash-devices-table td {
  padding: 0.8rem 0.9rem;
  color: rgba(226, 232, 240, 0.95);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.us-mini-table .dash-devices-table tbody tr {
  transition: all 0.2s ease;
}

.us-mini-table .dash-devices-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateX(2px);
}

/* Стили для графиков статистики с 3D эффектами */
.user-stats-chart-root {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-stats-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.user-stats-bar-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.user-stats-chart-wrapper {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  
  /* 3D эффект - объемная тень */
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 50px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  
  /* 3D трансформация */
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0px);
  transform-style: preserve-3d;
}

/* 3D эффект при наведении */
.user-stats-chart-wrapper:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.6),
    0 25px 70px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(99, 102, 241, 0.3),
    0 0 120px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(20px) translateY(-8px);
}

/* Псевдо-элемент для создания 3D глубины */
.user-stats-chart-wrapper::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.3) 0%,
    rgba(99, 102, 241, 0.2) 50%,
    rgba(168, 85, 247, 0.3) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.user-stats-chart-wrapper:hover::before {
  opacity: 1;
}

/* 3D эффект отражения снизу */
.user-stats-chart-wrapper::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 10%;
  right: 10%;
  height: 20px;
  background: radial-gradient(ellipse at center, 
    rgba(139, 92, 246, 0.2) 0%, 
    transparent 70%
  );
  filter: blur(10px);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -2;
}

.user-stats-chart-wrapper:hover::after {
  opacity: 1;
}

.user-stats-chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(196, 181, 253, 0.95);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(139, 92, 246, 0.4);
  position: relative;
  padding-bottom: 0.5rem;
}

/* Подчеркивание заголовка с градиентом */
.user-stats-chart-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(139, 92, 246, 0.6) 0%,
    rgba(99, 102, 241, 0.4) 50%,
    rgba(139, 92, 246, 0.6) 100%
  );
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Canvas внутри wrapper с дополнительным 3D эффектом */
.user-stats-chart-wrapper canvas {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s ease;
}

.user-stats-chart-wrapper:hover canvas {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

@media (max-width: 768px) {
  .user-stats-charts,
  .user-stats-bar-charts {
    grid-template-columns: 1fr;
  }
  
  /* Упрощаем 3D эффекты на мобильных */
  .user-stats-chart-wrapper {
    transform: none;
  }
  
  .user-stats-chart-wrapper:hover {
    transform: translateY(-4px);
  }
}

/* —— Страница входа клиента (визуально как dash-premium / боковой brand-meta) —— */

body.login-body--premium {
  --login-shell: #0c121a;
  --login-glass: rgba(255, 255, 255, 0.06);
  --login-glass-border: rgba(255, 255, 255, 0.12);
  --login-text: #f1f5f9;
  --login-muted: #94a3b8;
  --login-accent: #38bdf8;
  margin: 0;
  min-height: 100vh;
  color: var(--login-text);
  background: var(--login-shell);
  color-scheme: dark;
  font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html:has(body.login-body--premium) {
  background: var(--login-shell);
  color-scheme: dark;
}

body.login-body--premium.login-body {
  display: block;
}

.login-premium-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.35rem 1rem 2rem;
  box-sizing: border-box;
}

.login-premium-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, rgba(18, 148, 109, 0.14), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(91, 124, 255, 0.1), transparent 36%),
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(99, 102, 241, 0.07), transparent 55%);
  opacity: 0.85;
}

.login-premium-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 15, 24, 0.55) 0%,
    var(--login-shell) 42%,
    var(--login-shell) 100%
  );
}

.login-premium-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  animation: dashFadeInUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-panel-premium {
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1.15rem;
  border: 1px solid var(--login-glass-border);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.09) 0%,
    var(--login-glass) 45%,
    rgba(15, 23, 42, 0.35) 100%
  );
  backdrop-filter: blur(22px);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-brand-meta {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 0 0 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.login-brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  transform: scale(1.38);
  transform-origin: center center;
}

.login-brand-copy {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
}

.login-brand-title {
  margin: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(90deg, #fff 0%, #c7d2fe 45%, #e9d5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-brand-sub {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--login-muted);
  line-height: 1.35;
}

.login-form-premium label {
  display: block;
  margin: 0.85rem 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}

.login-form-premium label:first-of-type {
  margin-top: 0;
}

.login-form-premium input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.62rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.55);
  color: var(--login-text);
  font: inherit;
  font-size: 0.95rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.login-form-premium input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.login-form-premium input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.login-form-premium input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
  background: rgba(15, 23, 42, 0.72);
}

.login-submit-premium {
  margin-top: 1.15rem;
  width: 100%;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #0c121a;
  background: linear-gradient(180deg, #7dd3fc 0%, var(--login-accent) 48%, #0ea5e9 100%);
  box-shadow:
    0 10px 28px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.login-submit-premium:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 36px rgba(56, 189, 248, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.login-submit-premium:active {
  transform: translateY(0);
}

.login-submit-premium:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.login-error-premium {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fecaca;
  text-shadow: 0 0 24px rgba(248, 113, 113, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .login-premium-inner {
    animation: none;
  }

  .login-submit-premium,
  .login-submit-premium:hover,
  .login-submit-premium:active {
    transform: none;
    transition: none;
  }
}