:root {
  --bg: #0e0b16;
  --bg-elevated: #14101e;
  --bg-soft: #1c1728;
  --bg-overlay: #09070fe6;
  --ink: #f7f5fa;
  --ink-dim: #c9c4d4;
  --ink-faint: #8e879c;
  --ink-mute: #625c6e;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(167, 139, 250, 0.18);
  --border-focus: #a78bfa;
  --brand: #8b5cf6;
  --brand-hover: #a78bfa;
  --brand-active: #7c3aed;
  --brand-ink: #f7f5fa;
  --brand-glow: rgba(139, 92, 246, 0.28);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --info: #818cf8;
  --info-bg: rgba(129, 140, 248, 0.12);
  --dur-instant: 80ms;
  --dur-fast: 0.16s;
  --dur-base: 0.18s;
  --dur-slow: 0.32s;
  --dur-page: 0.42s;
}

html {
  --font-sans: "Inter", "Inter Fallback", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

html,
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
}

body {
  background-image: radial-gradient(
    circle at 50% -20%,
    rgba(124, 58, 237, 0.12),
    transparent 45%
  );
  background-attachment: fixed;
}

::selection {
  background: rgba(139, 92, 246, 0.35);
  color: var(--ink);
}

::-webkit-scrollbar-track {
  background: #09070f;
}

::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.18);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 139, 250, 0.32);
}

@keyframes gd-page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gd-page-enter {
  animation: gd-page-in var(--dur-page) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .gd-page-enter {
    animation: none;
  }
}

/* --- Layout layers --- */
.min-h-dvh.bg-bg {
  background: transparent;
}

aside.fixed.inset-y-0.left-0,
#gd-mobile-menu aside {
  background: #09070f !important;
  border-right-color: rgba(167, 139, 250, 0.1) !important;
}

header.sticky.top-0 {
  background: rgba(14, 11, 22, 0.78) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

aside .border-b,
header.sticky.top-0 {
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* --- Navigation --- */
aside nav a[aria-current="page"] > div {
  color: var(--ink) !important;
}

aside nav a[aria-current="page"] .absolute.inset-0,
aside nav a[aria-current="page"] .gd-nav-pill {
  background: rgba(139, 92, 246, 0.12) !important;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: inset 2px 0 0 0 #a78bfa;
}

aside nav a[aria-current="page"] svg {
  color: #a78bfa !important;
}

aside nav a[aria-current="page"] .font-medium,
aside nav a[aria-current="page"] .text-brand-ink {
  color: var(--ink) !important;
}

aside nav a:not([aria-current="page"]) svg {
  color: var(--ink-faint);
}

aside nav a:not([aria-current="page"]):hover > div {
  background: rgba(255, 255, 255, 0.035);
}

aside nav a,
aside nav a > div {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease;
}

/* --- Cards --- */
.rounded-xl.border,
.rounded-2xl.border {
  background: rgba(20, 16, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.shadow-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 28px rgba(0, 0, 0, 0.28) !important;
}

a:hover .rounded-xl.border,
.rounded-xl.border:hover,
[data-card]:hover,
[data-card]:hover .rounded-xl.border {
  background: rgba(28, 23, 40, 0.92);
  border-color: rgba(167, 139, 250, 0.25) !important;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.08), 0 12px 28px rgba(0, 0, 0, 0.32);
}

[data-card] {
  cursor: pointer;
}

[aria-current="page"] .rounded-xl.border,
[data-state="open"] .rounded-xl.border {
  border-color: rgba(167, 139, 250, 0.55) !important;
  background-image: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.08),
    transparent 42%
  );
}

[class*="bg-brand/10"].rounded-xl,
[class*="bg-success/10"].rounded-xl,
[class*="bg-warning/10"].rounded-xl,
[class*="bg-danger/10"].rounded-xl,
[class*="bg-info/10"].rounded-xl {
  background-color: rgba(20, 16, 30, 0.85) !important;
}

.rounded-xl[class*="border-brand/30"],
.rounded-xl[class*="border-success/25"] {
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* KPI hierarchy */
.text-xs.uppercase.tracking-wide {
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.text-2xl.font-bold.tabular-nums,
.text-2xl.tabular-nums {
  font-weight: 600 !important;
  letter-spacing: -0.03em;
  color: var(--ink);
}

h1.font-bold,
h1.text-xl,
h1.text-2xl {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --- Buttons --- */
button.bg-brand,
.bg-brand.text-brand-ink {
  background-color: #8b5cf6 !important;
  background-image: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #f7f5fa !important;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.18);
  transition: filter 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button.bg-brand:hover,
.bg-brand.text-brand-ink:hover,
.hover\:bg-brand-hover:hover.bg-brand {
  background-color: #a78bfa !important;
  background-image: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
  filter: brightness(1.04);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.22);
}

button.border-border-strong.bg-transparent,
a .border-border-strong.bg-transparent {
  background: rgba(18, 16, 26, 0.7);
  border-color: rgba(255, 255, 255, 0.08) !important;
}

button.border-border-strong.bg-transparent:hover,
.hover\:bg-bg-soft:hover {
  background: rgba(139, 92, 246, 0.08) !important;
}

.hover\:shadow-glow:hover,
.focus-visible\:shadow-glow:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18) !important;
}

.hover\:border-brand:hover,
.hover\:border-brand\/50:hover,
[class*="hover:border-brand"]:hover {
  border-color: rgba(167, 139, 250, 0.5) !important;
}

.hover\:text-brand:hover {
  color: #c4b5fd !important;
}

/* Yellow leftovers from original dump */
.border-yellow-300\/20,
.border-yellow-300\/25,
.hover\:border-yellow-300\/35:hover,
.text-yellow-300,
.bg-yellow-300\/\[0\.06\],
.accent-yellow-400 {
  border-color: rgba(167, 139, 250, 0.22) !important;
  color: #c4b5fd !important;
  background-color: rgba(139, 92, 246, 0.08) !important;
  accent-color: var(--brand);
}

/* --- Inputs --- */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  background: #12101a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--ink);
  border-radius: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
.focus\:border-brand:focus,
.focus\:ring-2:focus {
  border-color: rgba(167, 139, 250, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
  outline: none;
}

.form-checkbox,
.form-radio {
  color: var(--brand);
  background-color: #12101a;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.form-checkbox:focus,
.form-radio:focus {
  --tw-ring-color: rgba(139, 92, 246, 0.45);
}

input.form-checkbox {
  accent-color: var(--brand);
}

/* --- Badges --- */
.rounded-full.border.px-2\.5,
span.inline-flex.items-center.gap-1.rounded-full.border {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.18) !important;
  color: #c4b5fd;
}

.border-success,
.text-success + .rounded-full,
.bg-success-bg {
  background: var(--success-bg) !important;
}

.border-warning,
.bg-warning-bg {
  background: var(--warning-bg) !important;
}

.border-danger,
.bg-danger-bg {
  background: var(--danger-bg) !important;
}

.text-success {
  color: #6ee7b7;
}

.text-warning {
  color: #fcd34d;
}

.text-danger {
  color: #fca5a5;
}

.text-info {
  color: #a5b4fc;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
}

thead th {
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  background: rgba(14, 11, 22, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

tbody tr {
  transition: background-color 160ms ease;
}

tbody tr:hover {
  background: rgba(139, 92, 246, 0.06);
}

tbody tr[aria-selected="true"],
tbody tr.is-selected {
  background: rgba(139, 92, 246, 0.1);
}

/* --- Charts --- */
.gd-chart {
  width: 100%;
  height: 220px;
  overflow: visible;
}

.gd-chart text {
  fill: #777080;
  font-size: 10px;
}

.gd-chart .gd-grid {
  stroke: rgba(255, 255, 255, 0.045);
}

.gd-bars-host {
  width: 100%;
}

.gd-bars {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 220px;
  padding-top: 4px;
}

.gd-bars__col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  outline: none;
}

.gd-bars__col:hover .gd-bars__track,
.gd-bars__col:focus-visible .gd-bars__track {
  background: rgba(167, 139, 250, 0.08);
}

.gd-bars__track {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px 6px 0 0;
}

.gd-bars__stack {
  width: min(18px, 70%);
  min-height: 0;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px 4px 1px 1px;
  overflow: hidden;
}

.gd-bars__seg {
  display: block;
  width: 100%;
  min-height: 2px;
}

.gd-bars__label {
  margin-top: 6px;
  height: 14px;
  font-size: 10px;
  line-height: 14px;
  color: #777080;
  white-space: nowrap;
}

.gd-bars__col.is-active .gd-bars__label,
.gd-bars__col:hover .gd-bars__label {
  color: #f4f1f8;
}

.gd-bars__seg--empty {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.12);
}

.gd-bars__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 36px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #d9d4e0;
}

.gd-bars__panel-date {
  font-weight: 600;
  color: #f4f1f8;
}

.gd-bars__panel-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #f4f1f8;
}

.gd-bars__panel-caption {
  color: #c4b5fd;
}

.gd-bars__panel-item,
.gd-bars__panel-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gd-bars__panel-item i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
}

.gd-bars__panel b {
  font-variant-numeric: tabular-nums;
  color: #f4f1f8;
}

.gd-bars__panel-total {
  margin-left: auto;
  padding-left: 12px;
}

.gd-bars__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
  color: #a39eae;
}

.gd-bars__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gd-bars__legend i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
}

/* --- Mobile menu --- */
.gd-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.gd-mobile-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.gd-mobile-overlay__dim {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.gd-mobile-overlay.is-open .gd-mobile-overlay__dim {
  opacity: 1;
}

.gd-mobile-overlay aside {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex !important;
  width: 14rem;
  height: 100%;
  max-height: 100dvh;
  transform: translateX(-100%);
  transition: transform var(--dur-base) var(--ease-out);
  pointer-events: auto;
}

.gd-mobile-overlay.is-open aside {
  transform: none;
}

@media (min-width: 768px) {
  .gd-mobile-overlay {
    display: none !important;
  }
}

body.gd-menu-open {
  overflow: hidden;
}

/* --- Toasts --- */
.gd-toast-wrap {
  position: fixed;
  z-index: 80;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.gd-toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: #171320;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: gd-page-in var(--dur-fast) var(--ease-out);
}

.gd-toast.is-danger {
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}

/* --- Login --- */
.gd-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% -10%, rgba(124, 58, 237, 0.16), transparent 42%),
    #09070f;
  color: var(--ink);
}

.gd-login__card {
  width: min(420px, 100%);
  border: 1px solid rgba(167, 139, 250, 0.16);
  background: rgba(20, 16, 30, 0.92);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 48px rgba(0, 0, 0, 0.45);
}

.gd-login__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.gd-brand__logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.gd-brand__logo--login {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.gd-hidden {
  display: none !important;
}

/* --- Support widget: yellow → violet --- */
.ExpertContactWidget-module__soABqW__message {
  background:
    radial-gradient(circle at 88% 12%, rgba(139, 92, 246, 0.16), transparent 34%),
    linear-gradient(145deg, #171320f5, #0e0b16fa) !important;
  border-color: rgba(167, 139, 250, 0.18) !important;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.14), 0 24px 70px #00000085,
    inset 0 1px #ffffff12 !important;
}

.ExpertContactWidget-module__soABqW__consult {
  color: #f7f5fa !important;
  background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.22) !important;
}

.ExpertContactWidget-module__soABqW__consult:hover {
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.32) !important;
}

.ExpertContactWidget-module__soABqW__contacts {
  background: #12101cfa !important;
}

.ExpertContactWidget-module__soABqW__contacts.ExpertContactWidget-module__soABqW__open,
.ExpertContactWidget-module__soABqW__contacts.ExpertContactWidget-module__soABqW__visible {
  border-color: rgba(167, 139, 250, 0.22) !important;
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.16), inset 0 1px #ffffff0f !important;
}

.ExpertContactWidget-module__soABqW__contacts a:hover {
  border-color: rgba(167, 139, 250, 0.35) !important;
}

.ExpertContactWidget-module__soABqW__contacts em {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.22) !important;
}

.ExpertContactWidget-module__soABqW__contacts strong {
  color: #c4b5fd !important;
}

.ExpertContactWidget-module__soABqW__orb {
  color: #c4b5fd !important;
  background: radial-gradient(circle at 34% 24%, rgba(139, 92, 246, 0.28), transparent 34%),
    #0e0b16f0 !important;
  border-color: rgba(167, 139, 250, 0.28) !important;
}

.ExpertContactWidget-module__soABqW__orb:hover {
  border-color: rgba(167, 139, 250, 0.5) !important;
  box-shadow: 0 0 36px rgba(139, 92, 246, 0.28), 0 24px 52px #00000080 !important;
}

.ExpertContactWidget-module__soABqW__phone {
  color: #a78bfa !important;
}

.ExpertContactWidget-module__soABqW__widget.is-open .ExpertContactWidget-module__soABqW__message {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.ExpertContactWidget-module__soABqW__widget.is-open .ExpertContactWidget-module__soABqW__contacts {
  pointer-events: auto;
}

/* Hamburger */
header button[aria-label="Открыть меню"] {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(18, 16, 26, 0.8) !important;
}

header button[aria-label="Открыть меню"]:hover {
  border-color: rgba(167, 139, 250, 0.4) !important;
  color: #c4b5fd !important;
}

@media (max-width: 767px) {
  main.gd-page-enter {
    padding-left: 16px;
    padding-right: 16px;
  }
}
