.segmented-dropdown--home .segmented-dropdown__trigger .segmented-dropdown__glow circle {
  fill: rgba(255, 255, 255, 0.35);
}
.page-section {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
:root {
  --header-height: 60px;
  --color-main: #00f0ff;
  --color-secondary: #43fff9;
  --color-text-light: #d6f7ff;
  --color-dark: #03070c;
  --color-success: #33ff6e;
  --color-danger: #f62217;
  --color-wait: #f78b20;
  --color-border: rgba(24, 240, 255, 0.35);
  --color-deep-dark: #050709;
  --color-surface: rgba(7, 12, 20, 0.86);
  --color-surface-alt: rgba(3, 8, 15, 0.8);
  --color-panel: rgba(8, 14, 24, 0.92);
  --color-card: rgba(5, 9, 16, 0.9);
  --color-card-alt: rgba(4, 8, 14, 0.85);
  --border-muted: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(67, 255, 249, 0.45);
  --glow-strong: 0 25px 55px rgba(3, 9, 20, 0.65);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 35px 90px rgba(0, 0, 0, 0.6);
  --sidebar-width: 260px;
  --content-max: 1440px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-card: 24px;
  --radius-pill: 999px;
  --transition-fast: 0.15s ease;
  --transition-medium: 0.25s ease;
  --transition-slow: 0.4s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Cairo", "Segoe UI", sans-serif;
  color: var(--color-text-light);
  background: radial-gradient(circle at 20% 20%, rgba(24, 240, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #05090f 0%, #090f1a 55%, #04070c 100%);
  background-attachment: fixed;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

#mainHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  background: rgba(4, 8, 15, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.55);
  z-index: 600;
  transition: transform 0.25s ease, background 0.2s ease;
}

.header-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-leading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-tagline {
  display: block;
  margin-top: -4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.app-shell {
  display: flex;
  width: 100%;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

.page-shell {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) clamp(var(--space-4), 4vw, 64px) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill);
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
  padding-inline: var(--space-4);
}

.back-home-btn .icon-back {
  font-size: 1rem;
}

.recent-server-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(7, 11, 20, 0.95), rgba(10, 15, 25, 0.85));
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
  min-width: 260px;
}

.recent-server-rail__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.recent-server-rail__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-server-card {
  width: 100%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-light);
  padding: 10px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition-fast), border var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
}

.recent-server-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.recent-server-card.is-active {
  border-color: rgba(24, 240, 255, 0.4);
  background: linear-gradient(130deg, rgba(24, 240, 255, 0.18), rgba(24, 240, 255, 0.04));
}

.recent-server-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

.recent-server-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-server-card__meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.recent-server-card__meta strong {
  font-size: 14px;
  line-height: 1.2;
}

.recent-server-card__meta small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.recent-server-card__chevron svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.server-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(120deg, rgba(13, 18, 30, 0.95), rgba(6, 10, 18, 0.85));
  box-shadow: 0 30px 65px rgba(0, 0, 0, 0.4);
  margin-bottom: 24px;
}

.server-hero__meta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.server-hero__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.server-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-plan-chip {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
}

body.server-dashboard-mode .page-shell {
  max-width: 1320px;
}

body.server-dashboard-mode #settings-section {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

body.server-dashboard-mode #settings-section .section-divider,
body.server-dashboard-mode #settings-section .settings-header,
body.server-dashboard-mode #settings-section .engagement-details {
  display: none;
}

body.server-dashboard-mode #server-hero {
  display: flex;
}

body.server-dashboard-mode .recent-server-rail {
  display: none;
}

.page-section {
  background: rgba(6, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-card);
  padding: clamp(var(--space-5), 3vw, 48px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.35s ease;
}

.section-divider {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.page-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.page-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.home-empty,
.home-loading {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.home-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.home-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-secondary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.home-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-5), 3vw, 48px);
  margin-top: var(--space-6);
}

.home-top {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-4), 2vw, 32px);
  margin-top: clamp(var(--space-6), 4vw, 56px);
}

.section-divider--compact {
  margin-top: 0;
}

.home-card {
  background: rgba(6, 12, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-card);
  padding: clamp(var(--space-4), 3vw, 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.home-card-head__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-card-note {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.home-card-head--controls {
  flex-direction: column;
  align-items: flex-start;
}

.home-card-head--controls small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.6);
}

.home-transaction-actions,
.transactions-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.transactions-controls {
  margin-bottom: var(--space-4);
}

.home-transaction-tabs,
.transactions-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-transaction-tab,
.transactions-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.home-transaction-filters,
.transactions-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.transactions-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-transaction-filters .segmented-dropdown,
.transactions-filters .segmented-dropdown {
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 260px;
  width: fit-content;
}

.transactions-filter {
  min-width: 0;
}

.transactions-filter .segmented-dropdown {
  width: 100%;
  max-width: none;
}

@supports not (width: fit-content) {
  .home-transaction-filters .segmented-dropdown,
  .transactions-filters .segmented-dropdown {
    width: auto;
  }
}

.transactions-search-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

@supports not (width: fit-content) {
  .home-transaction-filters .segmented-dropdown,
  .transactions-filters .segmented-dropdown {
    width: auto;
  }
}

.home-transaction-search,

.transactions-search-hint {
  margin: -6px 0 0;
  font-size: 0.82rem;
  color: rgba(214, 247, 255, 0.55);
}

.transactions-filter-chips {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.08);
  color: var(--color-text-light);
  font-size: 0.82rem;
}

.filter-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.filter-chip__icon {
  font-size: 0.85rem;
}

.transactions-filter-chips__empty {
  font-size: 0.82rem;
  color: rgba(214, 247, 255, 0.55);
}
.transactions-search,
.transactions-user-filter {
  width: 100%;
  max-width: 420px;
  display: flex;
  gap: var(--space-2);
}

.home-transaction-search input,
.transactions-search input,
.transactions-user-filter input {
  flex: 1;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 16px;
  color: var(--color-text-light);
}

.home-transaction-search input::placeholder,
.transactions-search input::placeholder,
.transactions-user-filter input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.home-card-link {
  width: 100%;
  margin-top: var(--space-3);
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-secondary);
  padding: var(--space-3);
  border-radius: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
}

.home-card-link:hover {
  background: rgba(24, 240, 255, 0.08);
}

.home-card-label {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.home-premium-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
}

.home-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.home-meta {
  padding: var(--space-4);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.home-meta p {
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.home-meta strong {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.home-meta small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
}

.home-progress {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  margin-top: var(--space-2);
  overflow: hidden;
}

.home-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-main));
  transition: width var(--transition-medium);
}


.home-meta-title {
  margin: 0 0 var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.home-metric-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-metric-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.home-rank-position {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
}

.home-rank-position[data-empty="true"] {
  opacity: 0.5;
}

.home-leaderboard li.leader-entry--first {
  border-color: rgba(255, 215, 0, 0.45);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 255, 255, 0.02));
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.home-leaderboard li.leader-entry--second {
  border-color: rgba(180, 198, 219, 0.4);
  background: linear-gradient(135deg, rgba(180, 198, 219, 0.15), rgba(255, 255, 255, 0.01));
}

.home-leaderboard li.leader-entry--third {
  border-color: rgba(205, 127, 50, 0.4);
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(255, 255, 255, 0.01));
}

.home-leaderboard li.leader-entry--topten {
  border-color: rgba(79, 70, 229, 0.35);
}

.home-dual-grid,
.home-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(var(--space-4), 3vw, 32px);
}

.home-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home-leaderboard li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.home-leaderboard .rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.home-leaderboard img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.home-leaderboard small {
  display: block;
  color: rgba(255, 255, 255, 0.55);
}

.home-leaderboard .leader-value {
  margin-left: auto;
  font-weight: 600;
}

.home-transaction-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home-transaction-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.home-transaction-meta {
  display: flex;
  flex-direction: column;
}

.home-transaction-meta span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  position: relative;
  padding-left: calc(var(--space-4) + 6px);
}

.home-transaction-list li::before {
  content: "";
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  bottom: var(--space-3);
  width: 3px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.5);
}

.home-transaction-list li[data-direction="credit"]::before {
  background: rgba(16, 185, 129, 0.65);
}

.home-transaction-list li[data-direction="debit"]::before {
  background: rgba(239, 68, 68, 0.6);
}

.home-transaction-amount {
  font-weight: 600;
}

.home-transaction-amount[data-direction="credit"] {
  color: var(--color-success);
}

.home-transaction-amount[data-direction="debit"] {
  color: var(--color-danger);
}

.home-transaction-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-transaction-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.home-transaction-tag--muted {
  color: rgba(255, 255, 255, 0.55);
}

.home-profile-preview {
  min-height: 260px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.home-profile-preview img {
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.45);
}

.home-card-empty {
  text-align: center;
  margin: var(--space-3) 0 0;
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
  .home-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-transaction-actions {
    width: 100%;
  }

  .home-leaderboard li,
  .home-transaction-list li {
    flex-direction: column;
    align-items: flex-start;
  }


@media (min-width: 768px) {
  .home-transaction-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .home-transaction-search {
    width: auto;
    flex: 1;
    max-width: none;
  }
}
  .home-leaderboard .leader-value {
    margin-left: 0;

  .transactions-search {
    flex: 1 1 320px;
    max-width: none;
  }

  .transactions-user-filter {
    max-width: 520px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    background: rgba(0, 240, 255, 0.03);
    align-items: center;
  }

  .transactions-user-filter input {
    background: transparent;
    border: none;
    padding-left: 4px;
  }

  .transactions-user-filter button {
    white-space: nowrap;
  }
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.page-header h2 {
  margin: 0;
}

.header-actions {
  display: flex;
  gap: var(--space-3);
}

.note-list {
  display: grid;
  gap: var(--space-3);
}

.note-card {
  padding: var(--space-4);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.note-card p {
  margin: 0 0 var(--space-2);
}

.note-card small {
  color: rgba(255, 255, 255, 0.55);
}

.note-input {
  width: 100%;
  min-height: 120px;
  border-radius: 18px;
  border: 1px solid rgba(67, 255, 249, 0.2);
  background: rgba(5, 9, 15, 0.85);
  color: var(--color-text-light);
  padding: var(--space-4);
  font-size: 1rem;
  resize: vertical;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
}

.sidebar-label {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nav-title {
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.nav-link {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-light);
  border-radius: 16px;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: border var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-link-icon svg {
  width: 20px;
  height: 20px;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--color-border-strong);
  color: var(--color-secondary);
  background: rgba(24, 240, 255, 0.08);
  transform: translateX(2px);
}

.nav-link--sub {
  padding-left: var(--space-5);
}

.nav-accordion {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  padding: var(--space-2);
}

.nav-accordion-trigger {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-3);
}

.nav-accordion-trigger--sub {
  font-size: 0.95rem;
  padding-left: var(--space-4);
}

.nav-accordion-body {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: max-height var(--transition-medium);
}

.nav-accordion[data-open="true"] .nav-accordion-body {
  max-height: 500px;
}

.nav-accordion .chevron {
  transition: transform var(--transition-fast);
}

.nav-accordion[data-open="true"] .chevron {
  transform: rotate(90deg);
}

.empty-state {
  text-align: center;
  padding: var(--space-4);
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.65);
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.commands-panel {
  background: rgba(7, 11, 18, 0.9);
  border-radius: var(--radius-card);
  border: 1px solid rgba(24, 240, 255, 0.12);
  padding: var(--space-5);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.commands-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.command-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.command-category {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  background: linear-gradient(145deg, rgba(7, 10, 18, 0.95), rgba(5, 8, 14, 0.7));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.command-category-header {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.command-category-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.command-category-text h3 {
  margin: 0;
  font-size: 1.2rem;
}

.command-category-text p {
  margin: var(--space-1) 0 0;
  color: rgba(255, 255, 255, 0.65);
}

.command-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.command-category--pulse {
  animation: glowPulse 1.2s;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 rgba(24, 240, 255, 0.4);
  }
  60% {
    box-shadow: 0 0 30px rgba(24, 240, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(24, 240, 255, 0);
  }
}

.command-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 14, 0.9);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--transition-fast), border var(--transition-fast), box-shadow var(--transition-fast);
}

.command-card:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 240, 255, 0.35);
  box-shadow: 0 18px 45px rgba(24, 240, 255, 0.18);
}

.command-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.command-card-head-meta {
  display: flex;
  gap: var(--space-3);
}

.command-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.command-card-meta-text h4 {
  margin: 0;
}

.command-card-meta-text p {
  margin: var(--space-1) 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}

.command-card-head-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.command-configure-btn {
  min-width: 120px;
}

.command-card-body {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.transaction-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.economy-context-banner {
  margin-bottom: var(--space-3);
}

.transaction-feed.is-loading::after {
  content: "";
  display: block;
  border-radius: 18px;
  height: 130px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.transaction-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.transaction-card--credit {
  background: linear-gradient(130deg, rgba(23, 167, 129, 0.25), rgba(6, 18, 12, 0.85));
  border-color: rgba(23, 167, 129, 0.45);
}

.transaction-card--debit {
  background: linear-gradient(130deg, rgba(246, 34, 23, 0.25), rgba(18, 6, 6, 0.85));
  border-color: rgba(246, 34, 23, 0.45);
}

.transaction-card__indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
}

.transaction-card__amount {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.transaction-card__meta {
  margin: var(--space-1) 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.transaction-card__actions {
  display: flex;
  align-items: center;
}

.transaction-card__details {
  border-radius: 14px;
}

.transaction-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  backdrop-filter: blur(12px);
}

.transaction-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.transaction-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(500px, 90vw);
  border-radius: 28px;
  border: 1px solid rgba(24, 240, 255, 0.35);
  background: rgba(3, 6, 12, 0.95);
  padding: var(--space-5);
  box-shadow: 0 45px 90px rgba(0, 0, 0, 0.55);
}

.transaction-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.transaction-modal__body {
  max-height: 70vh;
  overflow-y: auto;
}

.transaction-details__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.transaction-details__user img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.transaction-details__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.transaction-details__grid dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.transaction-details__grid dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .page-shell {
    padding: var(--space-5);
  }
  .command-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .recent-server-rail {
    width: 100%;
    min-width: 0;
  }

  .server-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-hero__actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: var(--space-4);
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .transaction-card {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .command-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .command-card-body {
    grid-template-columns: 1fr;
  }
}


.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.hide-header #mainHeader {
  transform: translateY(-100%);
}

[dir="rtl"] #mainHeader {
  flex-direction: row-reverse;
}

.title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--color-text-light);
}

.spacer {
  flex: 1;
}

.icon-btn {
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.auth-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-wrap: wrap;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-controls .segmented-dropdown {
  flex: 0 0 auto;
  min-width: 120px;
}

.auth-controls .lang-nav {
  flex: 0 0 auto;
}

[dir="rtl"] .auth-controls {
  margin-left: 0;
  margin-right: auto;
  flex-direction: row-reverse;
}

.lang-select {
  min-width: 0;
}

.segmented-dropdown {
  --trigger-width: 56px;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, rgba(5, 12, 20, 0.94), rgba(9, 18, 30, 0.86));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 12px 28px rgba(0, 240, 255, 0.12);
  min-height: 40px;
  min-width: 120px;
  max-width: 260px;
  width: fit-content;
  padding-right: 0;
  cursor: pointer;
  transition: border-color var(--transition-medium), box-shadow var(--transition-medium);
  isolation: isolate;
}

@supports not (width: fit-content) {
  .segmented-dropdown {
    width: auto;
  }
}

.segmented-dropdown:hover,
.segmented-dropdown:focus-within,
.segmented-dropdown.is-open {
  border-color: rgba(0, 240, 255, 0.8);
  box-shadow: 0 18px 38px rgba(0, 240, 255, 0.2);
}

.segmented-dropdown__label {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  padding-right: calc(14px + var(--trigger-width));
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  pointer-events: none;
}

.segmented-dropdown__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.segmented-dropdown__icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Language nav ----------------------------------------------------------- */

.lang-nav {
  position: relative;
  display: inline-flex;
}

.lang-nav__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.lang-nav__button:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.8);
  outline-offset: 2px;
}

.lang-nav__button:hover,
.lang-nav[data-open="true"] .lang-nav__button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-nav__flag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.lang-nav__label {
  white-space: nowrap;
}

.lang-nav__chevron {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.2s ease;
}

.lang-nav[data-open="true"] .lang-nav__chevron {
  transform: rotate(180deg);
}

.lang-nav__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  padding: 8px 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 18, 0.96);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  z-index: 40;
}

.lang-nav__menu[hidden] {
  display: none;
}

.lang-nav__option {
  width: 100%;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-nav__option:hover,
.lang-nav__option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.lang-nav__option.is-active {
  background: linear-gradient(120deg, rgba(100, 92, 255, 0.6), rgba(0, 240, 255, 0.25));
  color: #fff;
}

.lang-nav__option-flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 1rem;
}

.lang-nav__option-text {
  flex: 1;
  text-align: left;
}

.lang-select.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.segmented-dropdown__flag {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.segmented-dropdown__text {
  min-width: 0;
}

.segmented-dropdown__trigger {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--trigger-width);
  height: 100%;
  border: none;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: linear-gradient(135deg, var(--color-main), #00a8ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.segmented-dropdown__chevron {
  width: 16px;
  height: 16px;
  stroke: rgba(2, 24, 38, 0.95);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  z-index: 2;
  transition: transform 0.2s ease;
}

.segmented-dropdown__glow {
  position: absolute;
  right: -26px;
  bottom: -48px;
  width: 120px;
  height: 120px;
  opacity: 0.5;
  filter: blur(6px);
}

.segmented-dropdown__glow circle {
  fill: rgba(255, 255, 255, 0.2);
}

.segmented-dropdown[data-open="true"] .segmented-dropdown__chevron,
.segmented-dropdown.is-open .segmented-dropdown__chevron {
  transform: rotate(180deg);
}

.segmented-dropdown__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  color: transparent;
  border: none;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  z-index: 3;
  display: block;
  pointer-events: auto;
}

.segmented-dropdown__native:focus {
  color: #05121f;
}

.segmented-dropdown__native:focus-visible {
  outline: none;
}

.segmented-dropdown__native option {
  background-color: #05101b;
  color: #ecfdff;
}

.segmented-dropdown--home {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(120deg, rgba(5, 9, 14, 0.95), rgba(3, 6, 11, 0.85));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

.segmented-dropdown--home .segmented-dropdown__icon {
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35);
  color: rgba(0, 240, 255, 0.95);
}

.segmented-dropdown--home .segmented-dropdown__label {
  font-size: 0.95rem;
  color: #f5feff;
}

.segmented-dropdown--home .segmented-dropdown__trigger {
  background: linear-gradient(135deg, #4dfdff, #0095ff);
}

.segmented-dropdown--home .segmented-dropdown__glow circle {
  fill: rgba(255, 255, 255, 0.35);
}

.segmented-dropdown__native option:checked {
  background-color: #00def7;
  color: #021321;
}

[dir="rtl"] .segmented-dropdown__trigger {
  right: auto;
  left: 0;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}

[dir="rtl"] .segmented-dropdown__label {
  text-align: right;
  padding-left: calc(14px + var(--trigger-width));
  padding-right: 14px;
}

.login-btn,
.logout-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.cta-btn {
  background: linear-gradient(135deg, var(--color-main), var(--color-secondary));
  color: var(--color-dark);
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(0, 240, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.cta-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(0, 240, 255, 0.4);
}

.lang-select,
.login-btn,
.logout-btn {
  min-width: 100px;
}

.login-btn {
  background: #fff;
  color: var(--color-dark);
}
.logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--color-text-light);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 11, 18, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  transition: box-shadow var(--transition-fast), border var(--transition-fast);
}

.user-chip:focus-within {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  background: transparent;
  border: none;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
  color: var(--color-text-light);
  transition: background var(--transition-fast), color var(--transition-fast);
  border-top-left-radius: var(--radius-pill);
  border-bottom-left-radius: var(--radius-pill);
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-chip-toggle {
  align-self: stretch;
  min-width: 48px;
  padding: 0 16px;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), border var(--transition-fast);
  border-top-right-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}

.user-chip-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(255, 255, 255, 0.18);
}

.user-chip-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 150ms ease;
}

.user-chip[aria-expanded="true"] .user-chip-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(0, 240, 255, 0.45);
}

.user-chip[aria-expanded="true"] .user-chip-toggle svg {
  transform: rotate(180deg);
}

.chevron-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-chip[aria-expanded="true"] {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.55);
}

.auth-controls > * {
  flex-shrink: 0;
}

.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--color-text-light);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), border var(--transition-fast);
}

.icon-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border-strong);
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guild-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: rgba(6, 8, 12, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  max-height: min(560px, 80vh);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 550;
}

.user-menu.menu-open .guild-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.user-menu-section {
  padding: var(--space-4);
  border-radius: 18px;
  background: rgba(4, 6, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.01);
}

.user-menu-section--servers {
  padding: var(--space-4);
}

.user-menu-section--highlight {
  box-shadow: 0 0 0 2px rgba(67, 255, 249, 0.45);
}

.user-menu-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.user-menu-section-title {
  margin: 0 0 var(--space-2);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}

.user-menu-item {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-light);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border var(--transition-fast), color var(--transition-fast);
}

.user-menu-item + .user-menu-item {
  margin-top: var(--space-2);
}

.user-menu-item:hover {
  background: rgba(67, 255, 249, 0.08);
  border-color: rgba(67, 255, 249, 0.35);
}

.user-menu-item--ghost {
  border-style: dashed;
  background: transparent;
}

.user-menu-item--danger {
  color: var(--color-danger);
  border-color: rgba(246, 34, 23, 0.35);
}

.user-menu-section--servers small {
  color: rgba(255, 255, 255, 0.6);
}

.guild-dropdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.guild-dropdown-head p {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
}

.guild-dropdown-head small {
  color: rgba(255, 255, 255, 0.7);
}

.text-link {
  background: transparent;
  border: none;
  color: var(--color-secondary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.text-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.guild-dropdown-body {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guild-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.guild-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(7, 9, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  transition: border var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.guild-item--clickable {
  cursor: pointer;
}

.guild-item--clickable:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.guild-item--selected {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.45), 0 20px 35px rgba(0, 0, 0, 0.4);
}

.guild-item--disconnected {
  opacity: 0.85;
}

.guild-item--no-admin {
  cursor: not-allowed;
  opacity: 0.75;
}

.guild-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
}

.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-item--disconnected .guild-icon img {
  filter: grayscale(1);
  opacity: 0.65;
}

.guild-meta {
  flex: 1;
  min-width: 0;
}

.guild-meta strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.guild-meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.guild-status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guild-status--connected {
  background: rgba(51, 255, 51, 0.15);
  color: var(--color-success);
}

.guild-status--missing {
  background: rgba(246, 34, 23, 0.15);
  color: var(--color-danger);
}

.guild-action {
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(0, 240, 255, 0.15);
  color: var(--color-text-light);
  transition: background 0.2s ease;
}

.guild-action:hover {
  background: rgba(0, 240, 255, 0.25);
}

.guild-action--manage {
  background: rgba(51, 255, 51, 0.15);
  color: var(--color-success);
}

.guild-action--manage:hover {
  background: rgba(51, 255, 51, 0.25);
}

.guild-action--locked {
  background: rgba(246, 34, 23, 0.15);
  color: var(--color-danger);
  cursor: not-allowed;
}

.guild-action--locked:hover {
  background: rgba(246, 34, 23, 0.15);
}

.guild-item > .guild-status,
.guild-item > .guild-action {
  margin-left: auto;
}

.guild-empty {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  padding: 20px 0 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-tag {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}

.user-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

#settings-section {
  padding-bottom: 40px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.settings-subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.engagement-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.engagement-chip[data-level="low"] {
  color: var(--color-danger);
  border-color: rgba(246, 34, 23, 0.45);
  background: rgba(246, 34, 23, 0.12);
}

.engagement-chip[data-level="medium"] {
  color: var(--color-wait);
  border-color: rgba(247, 139, 32, 0.4);
  background: rgba(247, 139, 32, 0.12);
}

.engagement-chip[data-level="high"] {
  color: var(--color-success);
  border-color: rgba(51, 255, 51, 0.45);
  background: rgba(51, 255, 51, 0.12);
}

.engagement-details {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.engagement-analytics {
  margin-top: 16px;
}

.engagement-card {
  position: relative;
  padding: 18px 20px 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(7, 12, 20, 0.85), rgba(4, 6, 10, 0.6));
  border: 1px solid rgba(67, 255, 249, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.command-category {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  padding: 1.25rem 1.5rem;
  background: rgba(4, 7, 12, 0.85);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* legacy command layout overrides removed in favor of new grid */

.command-alias-section {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  background: rgba(9, 12, 18, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.command-alias-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.command-alias-limit {
  font-size: 0.85rem;
  color: rgba(214, 247, 255, 0.8);
}

.command-alias-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.5rem;
  background: rgba(3, 6, 10, 0.6);
}

.command-alias-input input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  color: #e5f7ff;
  outline: none;
}

.command-alias-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.command-alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(67, 255, 249, 0.1);
  color: #d6f7ff;
  font-size: 0.85rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.command-alias-chip:hover {
  background: rgba(67, 255, 249, 0.18);
}

.command-alias-chip button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  padding: 0.1rem;
  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.command-alias-chip button:hover,
.command-alias-chip button:focus-visible {
  color: #ffb4b4;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.15);
  outline: none;
}

.alias-error {
  color: var(--color-danger);
}

.command-custom-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.command-custom-option label {
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: block;
}

.command-custom-option-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 8, 12, 0.65);
  color: #e5f7ff;
}

@media (max-width: 900px) {
  .command-category {
    padding: 1rem;
  }
.command-custom-option.is-locked {
  opacity: 0.7;
}
.command-custom-option .plan-lock-note {
  color: #fda4af;
}
.command-custom-option-select.is-disabled,
.switch-inline.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.command-roulette-preview {
  margin-top: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(6, 11, 18, 0.6);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.command-roulette-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.command-roulette-preview-head h5 {
  margin: 0;
  font-size: 1rem;
  color: #5df0d1;
}

.command-roulette-preview-head p {
  margin: 0;
  font-size: 0.85rem;
  color: #9fb3d9;
}

.command-roulette-preview-canvas {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}

.command-roulette-preview-badge {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(93, 240, 209, 0.15);
  color: #5df0d1;
  font-size: 0.8rem;
}

.command-roulette-preview-note {
  margin: 0;
  font-size: 0.82rem;
  color: #a3bffa;
}

  .command-card {
    padding: 1.25rem;
  }
}

@media (max-width: 700px) {
  .command-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .command-card-body {
    grid-template-columns: 1fr;
  }

  .command-alias-input {
    flex-direction: column;
    align-items: stretch;
  }

  .command-alias-input input {
    min-width: auto;
    width: 100%;
  }

  .command-category-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.command-card-actions {
  display: none;
  justify-content: flex-end;
  margin-top: 1rem;
  gap: 0.75rem;
}

.command-card-actions .cancel-btn {
  min-width: 120px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(246, 34, 23, 0.6);
  background: rgba(246, 34, 23, 0.12);
  color: var(--color-danger);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.command-card-actions .cancel-btn:hover:not(:disabled) {
  border-color: rgba(246, 34, 23, 0.85);
  background: rgba(246, 34, 23, 0.18);
  color: #fff4f4;
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(246, 34, 23, 0.2);
}

.command-card-actions .cancel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.command-card-status {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  color: rgba(214, 247, 255, 0.75);
  transition: color 0.2s ease;
}

.command-card-status[data-state="success"] {
  color: #4ce0b3;
}

.command-card-status[data-state="error"] {
  color: #ff9f9f;
}

.command-card-status[data-state="loading"] {
  color: #ffdf8c;
}

.command-card[data-open="true"] .command-card-body {
  display: grid;
}

.command-card[data-open="true"] .command-card-actions {
  display: flex;
}

.command-card[data-open="true"] {
  border-color: var(--color-border-strong);
  box-shadow: 0 30px 50px rgba(24, 240, 255, 0.15);
  transform: translateY(-4px);
}

.engagement-card-value {
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.engagement-card-trend {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.engagement-card-trend #engagement-card-delta {
  font-size: 18px;
  font-weight: 600;
}

.engagement-card-trend[data-direction="up"] #engagement-card-delta {
  color: var(--color-success);
}

.engagement-card-trend[data-direction="down"] #engagement-card-delta {
  color: var(--color-danger);
}

.engagement-card-trend[data-direction="flat"] #engagement-card-delta {
  color: var(--color-wait);
}

#engagement-card-chart {
  width: 100%;
  height: 160px;
  margin-top: 12px;
  display: block;
}

.engagement-card-footer {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.engagement-card-empty {
  color: rgba(255, 255, 255, 0.45);
}

.engagement-card-tooltip {
  position: absolute;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(5, 10, 16, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  transform: translate(-50%, -100%);
  color: #fff;
  white-space: nowrap;
}

.settings-status {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
}

.settings-status[data-state="loading"] {
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--color-secondary);
}

.settings-status[data-state="error"] {
  border-color: rgba(246, 34, 23, 0.6);
  color: var(--color-danger);
}

.settings-status[data-state="warning"] {
  border-color: rgba(247, 139, 32, 0.5);
  color: var(--color-wait);
}

.settings-status[data-state="success"] {
  border-color: rgba(51, 255, 51, 0.5);
  color: var(--color-success);
}

.guild-access-loading {
  margin-top: 20px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(8, 12, 20, 0.95), rgba(3, 6, 12, 0.85));
}

.guild-access-loading__card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.guild-access-loading__spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--color-secondary);
  animation: guildAccessSpin 0.9s linear infinite;
}

.guild-access-loading__title {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
}

.guild-access-loading__subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

@keyframes guildAccessSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.settings-empty {
  margin-top: 20px;
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-size: 14px;
}

.settings-content {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.server-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(140deg, rgba(6, 10, 18, 0.9), rgba(2, 6, 12, 0.8));
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.server-summary-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.server-summary-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-summary-meta h2,
.server-summary-meta h3 {
  margin: 0;
}

.server-summary-meta p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.server-settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(7, 11, 18, 0.92), rgba(3, 6, 11, 0.85));
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.45);
}

.server-settings-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.server-settings-layout--nav-portal .server-settings-nav {
  display: none;
}

.server-settings-layout--nav-portal .server-settings-panels {
  flex: 1;
}

body.server-dashboard-mode .server-settings-layout {
  align-items: stretch;
  min-height: 600px;
}

.server-settings-nav {
  width: 260px;
  flex-shrink: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(7, 12, 20, 0.95), rgba(5, 10, 18, 0.85));
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}

body.server-dashboard-mode .server-settings-nav {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
}

.server-nav-header {
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-nav-section,
.server-nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-nav-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

.server-nav-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.server-nav-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-nav-items--commands {
  gap: 8px;
}

@media (min-width: 900px) {
  .server-nav-items--commands {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.server-nav-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
}

.server-nav-chip--soon {
  border-color: rgba(67, 255, 249, 0.4);
  color: #43fff9;
  background: rgba(67, 255, 249, 0.08);
}

.server-nav-item {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.server-nav-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-secondary);
  transform: translateX(2px);
}

.server-nav-item.active {
  background: linear-gradient(130deg, rgba(24, 240, 255, 0.25), rgba(24, 240, 255, 0.05));
  color: #18f0ff;
  border: 1px solid rgba(24, 240, 255, 0.4);
  box-shadow: inset 0 0 12px rgba(24, 240, 255, 0.18);
}

.server-nav-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.server-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 10px 16px;
  font-size: 13px;
  margin: 0;
}

.server-nav-back-icon {
  font-size: 14px;
  opacity: 0.8;
}

.server-nav-soon {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(67, 255, 249, 0.35);
  background: radial-gradient(circle at 20% 20%, rgba(67, 255, 249, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.server-nav-soon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(67, 255, 249, 0.08), rgba(67, 255, 249, 0));
  opacity: 0;
  animation: serverNavSoonPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.server-nav-soon__orb {
  width: 84px;
  height: 60px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(67, 255, 249, 0.35));
  animation: serverNavSoonFloat 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.server-nav-soon__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.server-nav-soon__title {
  margin: 0;
  font-weight: 600;
}

.server-nav-soon__hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

@keyframes serverNavSoonFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes serverNavSoonPulse {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
  }
}

.server-settings-panels {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.server-overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.overview-stat-card {
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(7, 11, 18, 0.92), rgba(4, 7, 12, 0.86));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
}

.overview-stat-card .stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 8px;
}

.overview-stat-card strong {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.stat-change {
  font-size: 0.85rem;
  color: rgba(24, 240, 255, 0.8);
}

.server-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.overview-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(155deg, rgba(6, 10, 18, 0.92), rgba(2, 5, 10, 0.88));
  padding: 24px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
}

.overview-card--wide {
  grid-column: span 2;
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.overview-card-head h4 {
  margin: 0;
}

.overview-card-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.55);
}

.overview-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overview-empty {
  margin: 40px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}

 

.switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.25);
  transition: 0.2s;
  border-radius: 999px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: rgba(24, 240, 255, 0.8);
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

@media (max-width: 1024px) {
  .server-settings-layout {
    flex-direction: column;
  }

  .server-settings-nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .server-nav-section {
    flex: 1 1 220px;
  }

  .overview-card--wide {
    grid-column: span 1;
  }
}

.settings-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px 18px;
}

.dashboard-access-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.dashboard-access-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-access-row input {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 5, 10, 0.65);
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.dashboard-access-row input:focus {
  outline: 2px solid rgba(24, 240, 255, 0.5);
  outline-offset: 2px;
}

.dashboard-access-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-access-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 9, 16, 0.8);
}

.dashboard-access-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.dashboard-access-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-access-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-access-meta strong {
  font-size: 1rem;
}

.dashboard-access-tag {
  font-size: 0.85rem;
  color: rgba(214, 247, 255, 0.7);
}

.dashboard-access-meta small {
  color: rgba(214, 247, 255, 0.5);
}

.dashboard-access-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 640px) {
  .dashboard-access-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-access-meta {
    width: 100%;
  }

  .dashboard-access-actions {
    width: 100%;
    flex-direction: column;
  }

  .dashboard-access-actions .ghost-btn {
    width: 100%;
    text-align: center;
  }
}

body.permission-drawer-open {
  overflow: hidden;
}

.permission-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
}

.permission-drawer[hidden] {
  display: none !important;
}

.permission-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(2px);
}

.permission-drawer__panel {
  position: relative;
  width: min(420px, 100%);
  max-width: 420px;
  height: 100%;
  background: var(--color-panel);
  border-left: 1px solid var(--border-muted);
  box-shadow: var(--shadow-strong);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.permission-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.permission-drawer__label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.permission-drawer__subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 4px;
}

.permission-drawer__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.permission-toggle {
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.permission-toggle label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  cursor: pointer;
}

.permission-toggle strong {
  display: block;
  font-size: 0.95rem;
}

.permission-toggle small {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.permission-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.permission-toggle--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.permission-toggle--disabled label {
  cursor: not-allowed;
}

.permission-drawer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.permission-drawer__actions .save-btn {
  min-width: 140px;
}

.permission-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.permission-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.04);
}

.ghost-btn--danger {
  border-color: rgba(255, 82, 70, 0.9);
  background: linear-gradient(135deg, #ff3b30, #ff6f61);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 62, 48, 0.25);
}

.ghost-btn--danger:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #ff5a4f, #ff867a);
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 62, 48, 0.35);
}

.ghost-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.settings-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.settings-hint {
  display: block;
  margin: 4px 0 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.settings-prefix-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#server-prefix {
  flex: 1;
  min-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-text-light);
  padding: 10px 12px;
}

#server-channel-select,
#server-role-select {
  display: none;
}

.multi-picker-host {
  position: relative;
}

.multi-picker {
  position: relative;
  border: 1px solid rgba(24, 240, 255, 0.25);
  background: rgba(6, 8, 12, 0.85);
  border-radius: 14px;
  padding: 6px;
  min-height: 52px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.multi-picker:is(:focus-within, [data-open="true"]) {
  border-color: #18f0ff;
  box-shadow: 0 0 0 2px rgba(24, 240, 255, 0.15);
}

.multi-picker.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.multi-picker.multi-picker--limit {
  border-color: #ff5c5c;
}

.multi-picker__control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  cursor: text;
}

.multi-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  align-items: center;
}

.multi-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 240, 255, 0.12);
  border: 1px solid rgba(24, 240, 255, 0.35);
  font-size: 0.9rem;
  color: #d6f7ff;
}

.multi-picker__chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.multi-picker__placeholder {
  color: rgba(214, 247, 255, 0.55);
  font-size: 0.92rem;
}

.multi-picker__input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.multi-picker__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #080c12;
  border: 1px solid rgba(24, 240, 255, 0.25);
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  max-height: 260px;
  overflow: hidden;
  z-index: 40;
}

.multi-picker[data-open="true"] .multi-picker__dropdown {
  display: block;
}

.multi-picker__options {
  max-height: 220px;
  overflow-y: auto;
}

.multi-picker__option {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 16px;
  text-align: left;
  color: #d6f7ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  cursor: pointer;
}

.multi-picker__option-check {
  font-size: 0.8rem;
  color: #18f0ff;
  margin-left: 10px;
}

.multi-picker__option[data-selected="true"] {
  background: rgba(24, 240, 255, 0.15);
  color: #18f0ff;
}

.multi-picker__option[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.multi-picker__option:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.multi-picker__empty {
  padding: 14px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(214, 247, 255, 0.65);
}

@media (max-width: 768px) {
  .multi-picker {
    min-height: 48px;
  }

  .multi-picker__input {
    min-width: 80px;
  }
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-light);
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-btn:hover {
  color: var(--color-secondary);
  border-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.ghost-btn--muted {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(214, 247, 255, 0.7);
}

.ghost-btn--muted:hover {
  color: var(--color-text-light);
  border-color: rgba(255, 255, 255, 0.35);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-actions .save-btn {
  min-width: 180px;
}

@media (max-width: 768px) {
  .server-summary-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-prefix-row {
    flex-direction: column;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions .save-btn {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-height: 100px;
    --sidebar-width: 220px;
  }
  #mainHeader {
    padding: 14px 16px;
  }
  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }
  .auth-controls {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    margin-left: 0;
    margin-right: 0;
  }
  .user-badge {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 120px;
  }
  #mainHeader {
    padding: 16px;
  }
  .header-content {
    align-items: flex-start;
    gap: 10px;
  }
  .auth-controls {
    width: 100%;
    gap: 6px;
    justify-content: space-between;
  }
  .lang-select,
  .logout-btn,
  .login-btn {
    flex: 1 1 auto;
  }
  .user-details {
    display: none;
  }
  .user-badge {
    margin-left: 0;
  }

  main,
  [dir="rtl"] main {
    margin-left: 0;
    margin-right: 0;
    padding: 32px 20px 42px;
  }
  main > section {
    padding: 24px;
    border-radius: 20px;
  }
}

.container {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

body.hide-header .container {
  margin-top: 0;
  min-height: 100vh;
}


.sidebar-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height));
  backdrop-filter: blur(6px);
  background: rgba(6, 8, 12, 0.65);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  z-index: 350;
}

body.hide-header .sidebar-overlay {
  top: 0;
  height: 100vh;
}

body.server-sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.server-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: min(420px, 100%);
  height: calc(100vh - var(--header-height));
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 400;
  pointer-events: none;
}

body.hide-header .server-sidebar {
  top: 0;
  height: 100vh;
}

body.server-sidebar-open .server-sidebar {
  transform: translateX(0);
  pointer-events: auto;
}

.server-sidebar__panel {
  height: 100%;
  background: rgba(5, 8, 15, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 18px 0 45px rgba(0, 0, 0, 0.45);
}

.server-sidebar__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.server-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.server-nav-portal {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
}

.server-sidebar.server-sidebar--nav-mode .guild-list,
.server-sidebar.server-sidebar--nav-mode #guildEmptyState {
  display: none !important;
}

.server-sidebar.server-sidebar--nav-mode .server-nav-portal {
  display: flex;
}

.server-sidebar.server-sidebar--nav-mode .server-sidebar__footer {
  display: none;
}

.server-sidebar.server-sidebar--nav-mode .server-settings-nav {
  position: static;
  top: auto;
  max-height: none;
  width: 100%;
}

.server-sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.server-sidebar__footer .user-menu-item {
  width: 100%;
}

main {
  flex: 1;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}

[dir="rtl"] main {
  margin: 0;
  padding: 0;
}

.page-section#customize-section {
  max-width: 960px;
  margin: 0 auto;
}

.newPage {
  width: 100%;
  font-weight: 600;
}

#notes-section {
  padding: 20px 0;
}

#note-input {
  width: 100%;
  min-height: 100px;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #ccc;
}

#add-note {
  margin-top: 12px;
  background: var(--color-main);
  border: none;
  color: var(--color-dark);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.customize-plan {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-text-light);
}

.notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: var(--color-text-light);
}

.notice-warning {
  background: rgba(255, 152, 0, 0.12);
  border-color: rgba(255, 152, 0, 0.35);
  color: #ffd08c;
}

.notice-error {
  background: rgba(246, 34, 23, 0.15);
  border-color: rgba(246, 34, 23, 0.35);
  color: #ffc6c2;
}

.feature-list ul {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}

.feature-list li {
  margin-bottom: 6px;
}

.feature-list {
  margin-top: 10px;
}

.customize-form {
  margin-top: 16px;
  padding: 18px 20px;
  background: rgba(6, 8, 12, 0.88);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.2);
  position: relative;
  z-index: 10;
  backdrop-filter: blur(10px);
  animation: cardFadeIn 0.4s ease;
}

.customize-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.customize-form label {
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.4px;
}

.customize-form input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.customize-form input[type="number"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(24, 240, 255, 0.35);
  font-size: 15px;
  background: rgba(11, 14, 18, 0.65);
  color: var(--color-text-light);
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.customize-form input[type="number"]:focus {
  outline: none;
  border-color: var(--color-border);
  box-shadow:
    0 0 0 3px rgba(0, 240, 255, 0.15),
    0 12px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.customize-form select,
.customize-form input[type="text"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(24, 240, 255, 0.35);
  font-size: 15px;
  background: rgba(11, 14, 18, 0.65);
  color: var(--color-text-light);
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.08);
}

.customize-form select:focus,
.customize-form input[type="text"]:focus {
  outline: none;
  border-color: var(--color-border);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

:is(select, .customize-form select) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  position: relative;

  /* السهم */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23d6f7ff' d='M7 9l5 6 5-6'/%3E%3C/svg%3E"),
    linear-gradient(120deg, var(--color-main), var(--color-secondary)),
    linear-gradient(140deg, rgba(8, 12, 16, 0.95), rgba(5, 7, 10, 0.85));

  background-repeat: no-repeat, no-repeat, no-repeat;

  /* حجم السهم */
  background-size: 16px 16px, 64px 100%, 100% 100%;

  /* مكان السهم */
  background-position: calc(100% - 22px) center, right top, left top;

  border: 1px solid rgba(24, 240, 255, 0.45);
  border-radius: 14px;
  padding: 12px 76px 12px 16px;

  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-light);
  cursor: pointer;

  box-shadow:
    0 20px 45px rgba(4, 6, 9, 0.6),
    inset 0 0 0 1px rgba(0, 240, 255, 0.12);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;

  outline: none;
}

:is(select, .customize-form select):hover {
  border-color: var(--color-main);
  box-shadow:
    0 28px 48px rgba(0, 240, 255, 0.22),
    inset 0 0 0 1px rgba(0, 240, 255, 0.25);
}

:is(select, .customize-form select):focus {
  border-color: var(--color-main);
  box-shadow:
    0 0 0 2px rgba(0, 240, 255, 0.28),
    0 0 30px rgba(0, 240, 255, 0.45);
}

:is(select, .customize-form select):disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}


select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 var(--color-text-light);
}

select option {
  background: var(--color-deep-dark);
  color: var(--color-text-light);
}

select option:hover,
select option:focus {
  background: var(--color-secondary);
  color: var(--color-dark);
}

select option:checked {
  background: var(--color-main);
  color: var(--color-dark);
}

select option:disabled {
  background: var(--color-deep-dark);
  color: var(--color-border);
}

select::-ms-expand {
  display: none;
}

select::-webkit-scrollbar {
  width: 8px;
}

select::-webkit-scrollbar-track {
  background: var(--color-deep-dark);
  border-radius: 12px;
}

select::-webkit-scrollbar-thumb {
  background: var(--color-main);
  border-radius: 12px;
}

select::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

.checkbox-row label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox-row input {
  width: auto;
  height: auto;
}

.color-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-group input[type="text"] {
  flex: 1;
  font-family: "Roboto Mono", Consolas, monospace;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.hint {
  color: rgba(214, 247, 255, 0.75);
  font-size: 12px;
  margin-top: -2px;
  display: inline-block;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.hint:hover {
  opacity: 1;
  color: var(--color-secondary);
}

.save-btn {
  background: linear-gradient(120deg, var(--color-main), var(--color-secondary));
  color: var(--color-dark);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 160px;
  box-shadow: 0 18px 30px rgba(0, 240, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.save-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.save-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(0, 240, 255, 0.35);
}

.toast-stack {
  position: fixed;
  top: clamp(16px, 8vh, 100px);
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 500;
  pointer-events: none;
}

.toast-card {
  --toast-accent: var(--color-main);
  --toast-icon-bg: rgba(0, 240, 255, 0.14);
  --toast-icon-color: var(--color-secondary);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 18px;
  width: min(360px, calc(100vw - 48px));
  border-radius: 18px;
  background: rgba(3, 8, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 55px rgba(5, 16, 37, 0.45);
  backdrop-filter: blur(8px);
  color: var(--color-text-light);
  transform: translateX(120%);
  opacity: 0;
  animation: toastSlideIn 0.35s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  pointer-events: auto;
  overflow: hidden;
}

.toast-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 120% -20%, rgba(255, 255, 255, 0.12), transparent 45%);
  pointer-events: none;
}

.toast-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--toast-icon-bg);
  color: var(--toast-icon-color);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.toast-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.toast-card__message {
  margin: 0;
  font-size: 14px;
  color: rgba(214, 247, 255, 0.92);
  line-height: 1.35;
}

.toast-card__close {
  background: transparent;
  border: none;
  color: rgba(248, 250, 252, 0.7);
  font-size: 18px;
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.2s ease;
}

.toast-card__close:hover {
  color: #fff;
}

.toast-card__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--toast-accent);
  opacity: 0.85;
  transform-origin: right;
  animation: toastProgress linear forwards;
}

.toast-card.is-leaving {
  animation: toastSlideOut 0.28s ease forwards;
}

.toast-card.toast-success {
  --toast-accent: #34f5c5;
  --toast-icon-bg: rgba(52, 245, 197, 0.18);
  --toast-icon-color: #14cba5;
}

.toast-card.toast-error {
  --toast-accent: #ff5f5f;
  --toast-icon-bg: rgba(255, 95, 95, 0.18);
  --toast-icon-color: #ff8a8a;
}

.toast-card.toast-warning {
  --toast-accent: #facc15;
  --toast-icon-bg: rgba(250, 204, 21, 0.18);
  --toast-icon-color: #fde047;
}

.toast-card.toast-info {
  --toast-accent: var(--color-secondary);
  --toast-icon-bg: rgba(67, 255, 249, 0.15);
  --toast-icon-color: var(--color-secondary);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(120%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(40%) scale(0.95);
  }
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
    opacity: 0.9;
  }
  to {
    transform: scaleX(0);
    opacity: 0.2;
  }
}

@media (max-width: 640px) {
  .toast-stack {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
    align-items: flex-end;
  }

  .toast-card {
    width: 100%;
  }
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--color-main);
}

.note-card small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination button {
  background: var(--color-main);
  border: none;
  color: var(--color-dark);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.pagination button:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

.preview-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(8, 12, 16, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 18px 40px rgba(0, 240, 255, 0.14);
  backdrop-filter: blur(10px);
  animation: cardFadeIn 0.35s ease;
}

.preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.preview-subtitle {
  display: block;
  color: rgba(214, 247, 255, 0.8);
  margin-top: 4px;
  font-size: 14px;
}

.preview-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--color-text-light);
}

.preview-mode-chip strong {
  letter-spacing: 0.2px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.preview-embed-card,
.preview-image-card {
  position: relative;
  border-radius: 14px;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(145deg, rgba(14, 18, 24, 0.9), rgba(8, 10, 14, 0.9));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 14px 28px rgba(0, 0, 0, 0.35);
}

.preview-embed-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preview-placeholder {
  color: rgba(214, 247, 255, 0.8);
  font-size: 14px;
}

.preview-embed-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.preview-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-embed-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.preview-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-name {
  font-size: 18px;
  font-weight: 700;
}

.preview-tag {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.preview-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 12px;
  color: #f7feff;
}

.preview-embed-body {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.preview-stat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.preview-stat {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-stat label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.preview-stat strong {
  font-size: 14px;
  letter-spacing: 0.2px;
}

.preview-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.preview-legend span {
  font-size: 12px;
  color: rgba(214, 247, 255, 0.85);
}

.preview-image-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, rgba(10, 14, 20, 0.92), rgba(7, 10, 14, 0.92));
}

.preview-image-card canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.preview-image-hint {
  font-size: 12px;
  color: rgba(214, 247, 255, 0.8);
}

.preview-footnote {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(214, 247, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-section {
  position: relative;
}

.reader-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 48px);
}

.reader-upload {
  padding: clamp(20px, 4vw, 32px);
  border-radius: 24px;
  background: rgba(5, 9, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(820px, 100%);
  margin: 0 auto;
  text-align: center;
  align-items: center;
}

.reader-upload-label {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.reader-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 28px 18px;
  text-align: center;
  font-weight: 600;
  color: rgba(214, 247, 255, 0.8);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  width: 100%;
}

.reader-dropzone.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.reader-dropzone:hover,
.reader-dropzone:focus-visible {
  border-color: var(--color-main);
  background: rgba(0, 240, 255, 0.08);
  transform: translateY(-1px);
}

.reader-dropzone.is-dragging {
  border-color: var(--color-secondary);
  background: rgba(67, 255, 249, 0.15);
}

.reader-status {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(214, 247, 255, 0.8);
}

.reader-stage {
  min-height: 420px;
  width: 100%;
}

.reader-table {
  position: relative;
  border-radius: 32px;
  padding: clamp(24px, 5vw, 56px);
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 55%),
    linear-gradient(135deg, #3a2616, #1a0d06 65%);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  width: min(1300px, 100%);
  margin: 0 auto;
}

.reader-table::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.reader-book-wrapper {
  position: relative;
  min-height: 300px;
  max-width: min(1200px, 100%);
  margin: 0 auto;
}

.reader-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: clamp(16px, 2vw, 36px);
  perspective: 1400px;
  align-items: center;
  width: 100%;
}

.reader-book--single {
  grid-template-columns: minmax(240px, 1fr);
  justify-items: center;
}

.reader-book--single .reader-page--right {
  display: none;
}

.reader-page {
  width: 100%;
  height: auto;
  min-height: clamp(360px, 50vw, 640px);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(242, 242, 242, 0.7));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04), 0 18px 30px rgba(0, 0, 0, 0.35);
  transform-origin: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.reader-page--left {
  transform-origin: center left;
}

.reader-page--right {
  transform-origin: center right;
}

.reader-book--dragging .reader-page {
  transition: none;
}

.reader-page[data-dragging="true"] {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05), 0 25px 45px rgba(0, 0, 0, 0.55);
}

.reader-page--hidden {
  display: none !important;
}

.reader-empty {
  margin-top: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.reader-controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.reader-page-indicator {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.reader-book.turning-next .reader-page--right {
  animation: readerFlipNext 0.6s ease;
}

.reader-book.turning-prev .reader-page--left {
  animation: readerFlipPrev 0.6s ease;
}

.reader-book.reader-book--single.turning-next .reader-page--left {
  animation: readerFlipSingleForward 0.55s ease;
}

.reader-book.reader-book--single.turning-prev .reader-page--left {
  animation: readerFlipSingleBackward 0.55s ease;
}

@keyframes readerFlipNext {
  0% {
    transform: rotateY(0deg);
  }
  45% {
    transform: rotateY(-120deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes readerFlipPrev {
  0% {
    transform: rotateY(0deg);
  }
  45% {
    transform: rotateY(120deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes readerFlipSingleForward {
  0% {
    transform: rotateY(0deg);
  }
  40% {
    transform: rotateY(-110deg) translateX(-30px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  }
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes readerFlipSingleBackward {
  0% {
    transform: rotateY(0deg);
  }
  40% {
    transform: rotateY(110deg) translateX(30px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.reader-section--locked .reader-dropzone,
.reader-section--locked #reader-upload-btn,
.reader-section--locked .reader-table {
  opacity: 0.5;
  pointer-events: none;
}

.reader-section--locked .reader-table {
  filter: grayscale(0.4);
}

.reader-locked-banner {
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .reader-table {
    padding: 24px;
  }

  .reader-page {
    min-height: clamp(320px, 65vw, 520px);
  }

  .reader-controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .reader-upload {
    padding: 20px;
  }

  .reader-page-indicator {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    transform: translateX(-100%);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  body:not(.sidebar-closed) .sidebar {
    transform: translateX(0);
  }

  main {
    margin-left: 0;
    padding: 16px;
  }

  [dir="rtl"] main {
    margin-right: 0;
  }
  body.sidebar-open main {
    filter: blur(2px);
    pointer-events: none;
  }
}

