/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD ADMIN V3 - Layout
   Header, Main Layout, Sidebar, Content Panel, Preview Panel
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   Dashboard Header - Global
   ═══════════════════════════════════════════════════════════════════════ */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-5);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

/* Header Left - Brand */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.brand-link:hover {
  transform: translateY(-1px);
}

.brand-link:hover .brand-logo-img {
  filter: brightness(1.1);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.brand-logo {
  font-size: 1.5rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-suffix {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Bot Status Indicator */
.bot-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-input);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.bot-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2s infinite;
}

.bot-status.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.bot-status.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: none;
}

.bot-status.unknown .status-dot {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.bot-status .status-text {
  color: var(--text-secondary);
}

.bot-status.online .status-text {
  color: var(--success);
}

.bot-status.offline .status-text {
  color: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Tabs (Center) */
.main-tabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
}

.main-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.main-tab:hover:not(.disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.main-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.main-tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-icon {
  font-size: 1rem;
}

.tab-label {
  white-space: nowrap;
}

/* Header Right - Server Selector + User */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Server Selector Button (Header) */
.header-right .server-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.server-selector-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 200px;
}

.server-selector-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.server-selector-btn .server-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.server-selector-btn .server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-selector-btn .server-icon.placeholder {
  background: var(--bg-card);
  font-size: 0.875rem;
}

.server-selector-btn .server-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.75rem;
}

.server-selector-btn .server-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-selector-btn .server-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.super-admin-badge {
  font-size: 1rem;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

/* User Menu (Header) */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.user-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.user-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.user-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #ffd700, #ffb347);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  border: 2px solid var(--bg-input);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.user-details-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100px;
}

.user-name-small {
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.role-badge.super-admin {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #1a1a1a;
}

.role-badge.premium {
  background: var(--primary);
  color: white;
}

.btn-logout-small {
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-logout-small:hover {
  background: var(--danger);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════
   Server Selector Modal
   ═══════════════════════════════════════════════════════════════════════ */

.server-selector-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideIn var(--transition-normal);
}

.server-selector-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.server-selector-modal .modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.server-selector-modal .modal-close {
  padding: var(--space-2);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.server-selector-modal .modal-close:hover {
  background: var(--danger);
  color: white;
}

.server-selector-modal .modal-content {
  padding: var(--space-5);
  overflow-y: auto;
}

.super-admin-notice {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 179, 71, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
  text-align: center;
}

.loading-servers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-muted);
}

.loading-spinner.small {
  width: 24px;
  height: 24px;
}

.no-servers {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
}

.no-servers .hint {
  font-size: 0.8rem;
  margin-top: var(--space-2);
  opacity: 0.7;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.server-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.server-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.server-card.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.server-card.premium {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
}

.server-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

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

.server-initial-large {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.server-card-info {
  flex: 1;
  min-width: 0;
}

.server-card-name {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-premium-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: linear-gradient(135deg, var(--primary), var(--epic));
  color: white;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.server-selected-check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 20px;
  height: 20px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════
   Theme Toggle Button - Dark/Light Mode Switcher
   Modern animated toggle with sun/moon icons and decorative elements
   ═══════════════════════════════════════════════════════════════════════ */

.theme-toggle-btn {
  position: relative;
  width: 64px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.98);
}

.toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode track */
.theme-toggle-btn.light .toggle-track {
  background: linear-gradient(135deg, #87CEEB 0%, #E0F4FF 100%);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(135, 206, 235, 0.4);
}

/* Toggle Thumb */
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Light mode - thumb moves right */
.theme-toggle-btn.light .toggle-thumb {
  left: 35px;
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 100%);
  box-shadow:
    0 2px 4px rgba(251, 191, 36, 0.4),
    0 4px 12px rgba(251, 191, 36, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Icons */
.toggle-thumb .icon-sun,
.toggle-thumb .icon-moon {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode: show moon */
.toggle-thumb .icon-moon {
  color: #fcd34d;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.toggle-thumb .icon-sun {
  color: #f59e0b;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

/* Light mode: show sun */
.theme-toggle-btn.light .toggle-thumb .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.theme-toggle-btn.light .toggle-thumb .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Stars Decoration (Dark Mode) */
.toggle-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.toggle-stars .star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle 2s ease-in-out infinite;
}

.toggle-stars .star-1 {
  top: 8px;
  right: 12px;
  animation-delay: 0s;
}

.toggle-stars .star-2 {
  top: 16px;
  right: 20px;
  width: 2px;
  height: 2px;
  animation-delay: 0.5s;
}

.toggle-stars .star-3 {
  top: 22px;
  right: 10px;
  width: 2px;
  height: 2px;
  animation-delay: 1s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Hide stars in light mode */
.theme-toggle-btn.light .toggle-stars {
  opacity: 0;
}

/* Clouds Decoration (Light Mode) */
.toggle-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.toggle-clouds .cloud {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.7;
}

.toggle-clouds .cloud-1 {
  width: 12px;
  height: 8px;
  top: 10px;
  left: 8px;
  border-radius: 6px;
  box-shadow:
    4px 0 0 2px white,
    -4px 0 0 1px white;
  animation: float-cloud 3s ease-in-out infinite;
}

.toggle-clouds .cloud-2 {
  width: 8px;
  height: 6px;
  top: 18px;
  left: 16px;
  border-radius: 4px;
  box-shadow:
    3px 0 0 1px white,
    -3px 0 0 1px white;
  animation: float-cloud 3s ease-in-out infinite 0.5s;
}

@keyframes float-cloud {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

/* Show clouds in light mode */
.theme-toggle-btn.light .toggle-clouds {
  opacity: 1;
}

/* Focus state for accessibility */
.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Responsive Header */
@media (max-width: 900px) {
  .dashboard-header {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .brand-text {
    display: none;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .main-tab .tab-label {
    display: none;
  }

  .main-tab {
    padding: var(--space-2) var(--space-3);
  }

  .server-selector-btn .server-name {
    display: none;
  }

  .user-details-compact {
    display: none;
  }
}

@media (max-width: 600px) {
  .dashboard-header {
    flex-wrap: wrap;
  }

  .main-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: var(--space-2);
  }

  .header-right {
    gap: var(--space-2);
  }

  /* Reduce bot status on small screens */
  .bot-status .status-text {
    display: none;
  }

  .bot-status {
    padding: var(--space-1);
  }

  /* Reduce theme toggle size */
  .theme-toggle-btn {
    width: 48px;
    height: 26px;
  }

  .toggle-thumb {
    width: 20px;
    height: 20px;
  }

  .theme-toggle-btn.light .toggle-thumb {
    left: 25px;
  }

  .toggle-thumb .icon-sun,
  .toggle-thumb .icon-moon {
    width: 12px;
    height: 12px;
  }

  /* Reduce user menu */
  .user-menu {
    padding: var(--space-1);
  }

  .user-avatar-small {
    width: 24px;
    height: 24px;
  }

  /* Reduce server selector */
  .server-selector-btn {
    padding: var(--space-1) var(--space-2);
  }

  .server-selector-btn .server-icon {
    width: 20px;
    height: 20px;
  }
}

/* Very small screens - 400px and below */
@media (max-width: 400px) {
  .dashboard-header {
    padding: var(--space-1) var(--space-2);
    gap: var(--space-1);
  }

  .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  /* Hide bot status entirely on very small screens */
  .bot-status {
    display: none;
  }

  /* Minimal theme toggle */
  .theme-toggle-btn {
    width: 40px;
    height: 22px;
  }

  .toggle-thumb {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }

  .theme-toggle-btn.light .toggle-thumb {
    left: 21px;
  }

  .toggle-thumb .icon-sun,
  .toggle-thumb .icon-moon {
    width: 10px;
    height: 10px;
  }

  .toggle-stars .star {
    display: none;
  }

  .toggle-clouds .cloud {
    display: none;
  }

  /* Minimal main tabs */
  .main-tabs {
    padding: var(--space-1);
    gap: var(--space-1);
  }

  .main-tab {
    padding: var(--space-1) var(--space-2);
  }

  .tab-icon {
    font-size: 0.875rem;
  }

  /* Minimal user menu - only avatar */
  .user-menu {
    padding: 4px;
    gap: 4px;
  }

  .user-avatar-small {
    width: 22px;
    height: 22px;
  }

  .btn-logout-small {
    padding: 4px;
  }

  .btn-logout-small svg {
    width: 14px;
    height: 14px;
  }

  /* Minimal server selector - icon only */
  .server-selector-btn {
    padding: 4px 6px;
    max-width: none;
  }

  .server-selector-btn .server-arrow {
    display: none;
  }
}

/* Main Layout - Mobile First (Stack) */
.main-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Desktop: 3 columns */
@media (min-width: 1200px) {
  .main-layout {
    display: grid;
    grid-template-columns: 260px 1fr 380px;
    gap: var(--space-6);
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
  .main-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-5);
  }
  .preview-panel {
    grid-column: 1 / -1;
    order: -1;
  }
}

/* Mobile: Sidebar as bottom sheet */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-3) var(--space-4);
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(calc(100% - 60px));
    transition: transform var(--transition-normal);
  }

  .sidebar.expanded {
    transform: translateY(0);
  }

  .sidebar::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-3);
  }

  .content-panel {
    padding-bottom: 80px;
    min-height: calc(100vh - 200px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Sidebar Navigation
   ═══════════════════════════════════════════════════════════════════════ */

.sidebar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  height: fit-content;
}

@media (min-width: 1200px) {
  .sidebar {
    position: sticky;
    top: var(--space-5);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-full);
}

/* Navigation Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.nav-item .icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-item.active .badge {
  background: var(--primary);
  color: white;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Nav Item Disabled State - Visual feedback when no theme loaded
   ═══════════════════════════════════════════════════════════════════════ */

.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-disabled);
  background: transparent;
  border-color: transparent;
  position: relative;
  filter: grayscale(0.5);
}

.nav-item.disabled:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text-disabled);
  transform: none;
}

/* Lock icon indicator */
.nav-item.disabled::after {
  content: '🔒';
  position: absolute;
  right: 12px;
  font-size: 0.7rem;
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.nav-item.disabled:hover::after {
  opacity: 1;
  transform: scale(1.2);
}

/* Tooltip on hover for disabled items */
.nav-item.disabled::before {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.nav-item.disabled:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Arrow for tooltip */
.nav-item.disabled[title]:hover::before {
  animation: tooltipPulse 0.3s ease-out;
}

@keyframes tooltipPulse {
  0% { opacity: 0; transform: translateY(-50%) translateX(-5px); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   Nav Item Dirty State - Unsaved changes indicator
   ═══════════════════════════════════════════════════════════════════════ */

.nav-item.dirty {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  position: relative;
}

.nav-item.dirty:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--warning);
}

.nav-item.dirty.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--warning);
}

/* Dirty indicator dot */
.dirty-indicator {
  color: var(--warning);
  font-size: 10px;
  margin-left: auto;
  animation: dirtyPulse 2s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

@keyframes dirtyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* Disabled badge styling */
.nav-item.disabled .badge {
  opacity: 0.3;
  filter: grayscale(1);
}

/* Library nav special styling - always accessible */
.nav-item.library-nav {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-color: rgba(99, 102, 241, 0.2);
}

.nav-item.library-nav:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.4);
}

.nav-item.library-nav.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   Sidebar Hint - Visual guide when no theme loaded
   ═══════════════════════════════════════════════════════════════════════ */

.sidebar-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { border-color: rgba(99, 102, 241, 0.3); }
  50% { border-color: rgba(99, 102, 241, 0.6); }
}

.sidebar-hint .hint-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  animation: hintBounce 2s ease-in-out infinite;
}

@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.sidebar-hint .hint-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-hint .hint-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-hint .hint-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════════
   Main Content Panel
   ═══════════════════════════════════════════════════════════════════════ */

.content-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  animation: fadeIn var(--transition-normal);
}

@media (min-width: 768px) {
  .content-panel {
    padding: var(--space-6);
  }
}

.content-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.content-panel h2 .icon {
  font-size: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Preview Panel
   ═══════════════════════════════════════════════════════════════════════ */

.preview-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  height: fit-content;
}

@media (min-width: 1200px) {
  .preview-panel {
    position: sticky;
    top: var(--space-5);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
}

.preview-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.preview-content {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Preview Scrollbar */
.preview-content::-webkit-scrollbar {
  width: 6px;
}

.preview-content::-webkit-scrollbar-track {
  background: transparent;
}

.preview-content::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════════════════════════════════════
   Mode Switcher (Theme Builder / Server Admin)
   ═══════════════════════════════════════════════════════════════════════ */

.mode-switcher {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.mode-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.mode-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.mode-btn .icon {
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Server Selector (Mode 2)
   ═══════════════════════════════════════════════════════════════════════ */

.server-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.server-selector .server-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.server-selector .server-info {
  flex: 1;
}

.server-selector .server-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.server-selector .server-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.server-selector select {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════
   Lazy Loading Spinner & Error States
   ═══════════════════════════════════════════════════════════════════════ */

.lazy-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.lazy-loading-spinner .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.lazy-loading-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--danger);
  font-size: 0.875rem;
  text-align: center;
}

.lazy-loading-error .error-icon {
  font-size: 2rem;
}

.lazy-loading-error button {
  margin-top: var(--space-2);
}
