:root {
  --bg-void: #08080a;
  --bg-surface: rgba(18, 18, 22, 0.65);
  --bg-surface-solid: #131318;
  --bg-elevated: rgba(26, 26, 31, 0.85);
  --bg-inset: rgba(255, 255, 255, 0.03);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #ff8800;
  --accent-deep: #ff5100;
  --accent-soft: rgba(255, 136, 0, 0.08);
  --accent-soft-border: rgba(255, 136, 0, 0.18);
  --success: #9bca3e;
  --success-soft: rgba(155, 202, 62, 0.12);
  --danger: #ff4747;
  --danger-soft: rgba(255, 71, 71, 0.12);
  --discord: #5865f2;
  --text-primary: #f4f4f6;
  --text-secondary: #8a8a93;
  --text-tertiary: #55555e;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 100px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --header-h: 68px;
  --upper-menu-h: 56px;
  --sidebar-w: 272px;
  --cmds-w: 300px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 0.15s;
  --normal: 0.25s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg-void: #f2f2f4;
  --bg-surface: rgba(255, 255, 255, 0.72);
  --bg-surface-solid: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.92);
  --bg-inset: rgba(10, 10, 15, 0.04);
  --border-subtle: rgba(10, 10, 15, 0.07);
  --border-default: rgba(10, 10, 15, 0.11);
  --border-strong: rgba(10, 10, 15, 0.18);
  --text-primary: #1a1a1d;
  --text-secondary: #5c5c66;
  --text-tertiary: #8d8d97;
}

:root[data-theme='light'] body::before {
  opacity: 0.5;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 102, 0, 0.05) 0%, rgba(255, 51, 0, 0.015) 45%, transparent 75%);
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.panel {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-5);
}

.logo-box {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.logo-box .logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.logo-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.logo-info h1 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-menu > a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--fast) var(--ease);
}

.nav-menu > a:hover {
  color: var(--text-primary);
}

.theme-switch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--bg-inset);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.theme-switch:hover {
  border-color: var(--accent-soft-border);
  color: var(--accent);
}

.user {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.user:hover,
.user.open {
  border-color: var(--border-default);
  background: var(--bg-inset);
}

.header-usr-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
}

.header-usr-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), visibility var(--fast);
  z-index: 30;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.user-dropdown a i {
  width: 16px;
  text-align: center;
  color: var(--text-tertiary);
}

.user-dropdown a:hover {
  background: var(--bg-inset);
  color: var(--text-primary);
}

.user-dropdown a.danger-dropdown {
  color: var(--danger);
}

.user-dropdown a.danger-dropdown i {
  color: var(--danger);
}

.user-dropdown a.danger-dropdown:hover {
  background: var(--danger-soft);
}

.burger-menu {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.burger-menu:hover {
  border-color: var(--accent-soft-border);
  color: var(--accent);
}

.burger-menu.open {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.site-footer {
  padding: var(--space-4) var(--space-5);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.site-footer .copy {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.toast-notifications {
  position: fixed;
  top: calc(var(--header-h) + var(--space-4));
  right: var(--space-5);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(320px, calc(100vw - 2 * var(--space-5)));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  animation: toast-in var(--normal) var(--ease);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.leaving {
  animation: toast-out var(--normal) var(--ease) forwards;
}

.toast i {
  margin-top: 2px;
  color: var(--accent);
}

.toast.success i {
  color: var(--success);
}

.toast.error i {
  color: var(--danger);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toast-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent);
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--text-tertiary);
}

.empty-state i {
  font-size: 1.3rem;
  color: var(--text-tertiary);
}

.empty-state span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: skeleton-sheen 1.4s infinite;
}

@keyframes skeleton-sheen {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}