/* ===========================================
   NEW DASHBOARD STYLES - Sidebar Layout
   =========================================== */

/* Dashboard Body - Full screen, no scroll */
.dashboard-body {
  background: #050608;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  --dash-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --dash-t-fast: 150ms;
  --dash-t-med: 320ms;
  --dash-t-slow: 420ms;
  --dash-surface: rgba(22, 24, 30, 0.62);
  --dash-surface-hover: rgba(22, 24, 30, 0.72);
  --dash-border: rgba(255, 255, 255, 0.03);
  --dash-border-hover: rgba(211, 214, 241, 0.20);
  --dash-border-strong: rgba(255, 255, 255, 0.10);
  --dash-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --dash-shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.35);
}

 .dashboard-body .nav {
   position: relative;
   z-index: 100001;
 }

 .dash-mobile-block {
   display: none;
   position: fixed;
   inset: 0;
   z-index: 100000;
   background: linear-gradient(180deg, #050608 0%, #020204 100%);
   align-items: center;
   justify-content: center;
   padding: 24px;
 }

 .dash-mobile-block-card {
   width: 100%;
   max-width: 520px;
   border: 1px solid rgba(255, 255, 255, 0.08);
   background: rgba(10, 12, 18, 0.7);
   backdrop-filter: blur(16px);
   border-radius: 16px;
   padding: 24px;
   text-align: center;
 }

 .dash-mobile-block-card h1 {
   margin: 0 0 10px;
   font-size: 1.25rem;
   font-weight: 700;
   color: #fff;
 }

 .dash-mobile-block-card p {
   margin: 0;
   color: var(--muted);
   font-size: 0.95rem;
 }

 @media (max-width: 900px) {
   .dash-mobile-block {
     display: flex;
   }

   .dash-mobile-block {
     background: var(--bg);
   }

   .dash-mobile-block-card {
     background: rgba(10, 12, 18, 0.82);
     border: 1px solid rgba(255, 255, 255, 0.10);
   }
 }

/* Loading state - shown while checking session on deep link */
.dashboard-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dash-t-med) ease;
}

.dashboard-body.loading::before {
  opacity: 1;
  pointer-events: all;
}

.dashboard-body #page-header {
  display: none !important;
}

.dashboard-body .page-wrapper {
  padding: 0;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

/* Hide nav when inside actual dashboard app (after selecting a server) */
.dashboard-body.dash-in-app .nav {
  display: none !important;
}

/* =========================================== 
   LOGIN SCREEN 
   =========================================== */
.dash-login-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(180deg, #050608 0%, #020204 100%);
  background-color: #050608;
  position: relative;
  padding: 112px 24px 40px;
  overflow-y: auto;
}

/* Star particles disabled for performance */
.dash-login-screen::before {
  display: none;
}

.dash-login-screen::after {
  display: none;
}

@keyframes dashFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* New page container */
.dash-page-container {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 980px;
  width: 100%;
  animation: dashSlideUp 600ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

/* Hero section */
.dash-hero {
  margin-bottom: 32px;
}

.dash-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dash-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

 .dash-hero-brand,
 .dash-hero-brand:visited,
 .dash-hero-brand:hover,
 .dash-hero-brand:active,
 .dash-hero-brand:focus {
  text-decoration: none;
 }

.dash-hero-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.dash-hero-brand span {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.dash-hero-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.dash-hero-title {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}

.dash-hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Ghost button */
.dash-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--dash-t-fast) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease, color var(--dash-t-med) ease;
}

.dash-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

/* Features row */
.dash-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.dash-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.dash-feature svg {
  color: var(--accent);
  opacity: 0.8;
}

/* Back link */
.dash-back-link {
  display: inline-block;
  margin-top: 40px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--dash-t-med) ease;
}

.dash-back-link:hover {
  color: var(--text);
}

/* Legacy support */
.dash-login-container {
  text-align: center;
  padding: 40px;
  position: relative;
  z-index: 1;
  animation: dashSlideUp 600ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.dash-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.dash-login-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.dash-login-brand span {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.dash-login-card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 22px;
  padding: 40px 36px;
  max-width: 420px;
  margin: 0 auto;
  transition: transform var(--dash-t-med) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease;
  will-change: transform;
}

.dash-login-card:hover {
  transform: translateY(-2px);
  border-color: var(--dash-border-hover);
  background: var(--dash-surface-hover);
}

.dash-login-icon {
  color: var(--accent);
  margin-bottom: 20px;
}

.dash-login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.dash-login-card p {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.dash-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dash-t-fast) var(--dash-ease), box-shadow var(--dash-t-med) ease, filter var(--dash-t-med) ease;
  width: 100%;
}

.dash-login-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(109, 140, 255, 0.35);
}

.dash-login-home {
  display: inline-block;
  margin-top: 32px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 150ms ease;
}

.dash-login-home:hover {
  color: var(--text);
}

/* =========================================== 
   SERVER SELECTION SCREEN 
   =========================================== */
.dash-servers-container {
  max-width: 800px;
}

.dash-servers-header {
  margin-bottom: 32px;
}

.dash-servers-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.dash-servers-header p {
  color: var(--muted);
  margin-bottom: 20px;
}

.dash-servers-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dash-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--dash-t-fast) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease, color var(--dash-t-med) ease;
}

.dash-btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.dash-btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dash-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
  margin: 0 auto;
}

.dash-server-grid.dash-server-grid--no-scroll {
  overflow-y: hidden;
  max-height: none;
}

.dash-server-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform var(--dash-t-med) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease, box-shadow var(--dash-t-med) ease;
  will-change: transform;
}

.dash-server-card:hover {
  transform: translateY(-2px);
  border-color: var(--dash-border-hover);
  background: var(--dash-surface-hover);
  box-shadow: var(--dash-shadow-soft);
}

.dash-server-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.dash-server-card-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5865f2, #7289da);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.dash-server-card-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.dash-server-card-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.dash-server-card-members {
  font-size: 0.8rem;
  color: var(--muted);
}

/* =========================================== 
   MAIN DASHBOARD LAYOUT 
   =========================================== */
.dash-layout {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #050608;
  isolation: isolate;
}

/* Star particles - static for performance */
.dash-layout::before {
  display: none;
}

/* Gradient overlay - disabled for performance */
.dash-layout::after {
  display: none;
}

@keyframes starDrift {
  0% { background-position: 0 0; }
  100% { background-position: 240px 320px; }
}

/* Dashboard entering animation */
.dash-layout.dash-entering {
  animation: dashEnter 400ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.dash-layout.dash-entering .dash-sidebar {
  animation: dashSidebarEnter 450ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.dash-layout.dash-entering .dash-main {
  animation: dashMainEnter 500ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes dashEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dashSidebarEnter {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

/* Sidebar */
.dash-sidebar {
  width: 260px;
  background: rgba(10, 10, 12, 0.82);
  border-right: 1px solid var(--dash-border-strong);
  box-shadow: var(--dash-shadow);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: relative;
  z-index: 10;
}

.dash-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.dash-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

 .dash-sidebar-brand,
 .dash-sidebar-brand:visited,
 .dash-sidebar-brand:hover,
 .dash-sidebar-brand:active,
 .dash-sidebar-brand:focus {
  text-decoration: none;
 }

.dash-sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.dash-sidebar-brand span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Server Selector */
.dash-server-select {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dash-border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--dash-t-fast) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease;
}

.dash-server-select:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(211, 214, 241, 0.22);
}

.dash-server-select-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.dash-server-select-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-server-select svg {
  color: #6d7a99;
  flex-shrink: 0;
}

/* Navigation */
.dash-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.dash-nav-section {
  margin-bottom: 10px;
}

.dash-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(154, 164, 191, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform var(--dash-t-fast) var(--dash-ease), background var(--dash-t-med) ease, border-color var(--dash-t-med) ease, color var(--dash-t-med) ease;
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
}

.dash-nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.06);
}

.dash-nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(230, 233, 240, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: default;
}

.dash-nav-item svg {
  flex-shrink: 0;
}

/* Sidebar Footer */
.dash-sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.dash-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.dash-user-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-user-logout {
  padding: 6px;
  background: none;
  border: none;
  color: #6d7a99;
  cursor: pointer;
  border-radius: 6px;
  transition: all 150ms ease;
}

.dash-user-logout:hover {
  background: rgba(5, 6, 8, 0.8);
  color: #fff;
}

/* =========================================== 
   MAIN CONTENT AREA 
   =========================================== */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  height: 100vh;
  position: relative;
  z-index: 1;
  background: rgba(10, 10, 12, 0.12);
}

/* Header */
.dash-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 32px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
  text-align: center;
  position: relative;
  background: rgba(10, 10, 12, 0.18);
}

.dash-header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  background: linear-gradient(135deg, #fff 0%, #c7d2ff 50%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-header-title p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.dash-header-actions {
  display: flex;
  gap: 10px;
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 1200px) {
  .dash-header {
    padding: 24px 20px 20px;
  }

  .dash-header-actions {
    right: 20px;
  }

  .dash-content {
    padding: 20px;
    padding-top: 26px;
    padding-bottom: 26px;
  }
}

@media (max-width: 980px) {
  .dash-header-actions {
    position: static;
    transform: none;
    margin-top: 14px;
  }
}

 .dash-header-actions .dash-btn-outline,
 .dash-header-actions .dash-btn-primary {
  transition: none;
 }

 .dash-header-actions .dash-action-visible {
  transition: none;
 }

.dash-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(109, 140, 255, 0.12);
  border: 1px solid rgba(109, 140, 255, 0.45);
  border-radius: 10px;
  color: rgba(230, 233, 240, 0.92);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.dash-btn-primary:hover {
  filter: none;
  background: rgba(109, 140, 255, 0.16);
  border-color: rgba(109, 140, 255, 0.42);
}

/* Content Area */
.dash-content {
  flex: 1;
  padding: 28px 32px;
  padding-top: 34px;
  padding-bottom: 34px;
  overflow: hidden;
  border-radius: 0 16px 0 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(10, 10, 12, 0.16);
  min-height: 0;
}


/* Pages */
.dash-page {
  display: none;
}

.dash-page.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Overview page - scroll within the content area */
#page-overview.active {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 8px;
}

body.dash-overview #page-overview.active > .dash-panel,
body.dash-overview #page-overview.active > .dash-stats-grid {
  margin-bottom: 0;
}

body.dash-overview .dash-content {
  padding-top: 22px;
  padding-bottom: 18px;
}

/* Let the last panel (Quick Actions) consume remaining space, and scroll inside it if needed */
body.dash-overview #page-overview.active > .dash-panel:last-of-type {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.dash-overview #page-overview.active > .dash-panel:last-of-type > .dash-panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.dash-overview #page-overview.active > .dash-panel:last-of-type .dash-panel-desc {
  margin-bottom: 12px;
}

body.dash-overview #page-overview.active > .dash-panel:last-of-type > .dash-panel-body {
  padding-top: 14px;
  padding-bottom: 14px;
}

body.dash-overview #page-overview.active > .dash-panel:last-of-type .dash-quick-btn {
  padding: 10px 16px;
  font-size: 0.85rem;
}

/* Prevent horizontal overflow inside panels/content */
.dash-panel,
.dash-panel-body,
.dash-panel-header {
  min-width: 0;
}

/* For pages with single panel (logs, transactions, settings pages) - scroll inside the panel body */
.dash-page.active:not(#page-overview) > .dash-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dash-page.active:not(#page-overview) > .dash-panel > .dash-panel-header {
  flex-shrink: 0;
}

.dash-page.active:not(#page-overview) > .dash-panel > .dash-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}



/* =========================================== 
   STATS CARDS 
   =========================================== */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.dash-stat-card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.dash-stat-card:hover {
  transform: none;
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
}

 body:not(.dash-overview) .dash-stat-card:hover {
  transform: none;
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
 }

.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.dash-stat-icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.dash-stat-icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.dash-stat-icon-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.dash-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.dash-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* =========================================== 
   PANELS 
   =========================================== */
.dash-panel {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.dash-page.active .dash-panel:last-child {
  margin-bottom: 0;
}

.dash-panel:hover {
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
  transform: none;
}

 body:not(.dash-overview) .dash-panel:hover {
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
  transform: none;
 }

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

/* Logs header layout: match other pages (flex), keep subtitle centered in the middle */
#page-logs .dash-panel-header {
  position: relative;
}

#page-logs .dash-panel-title {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
}

#page-logs .dash-transactions-actions {
  margin-left: auto;
}

/* Center subtitle without affecting layout (so title stays aligned like other pages) */
#page-logs .dash-panel-subtitle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  pointer-events: none;
  max-width: calc(100% - 420px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  padding: 2px 0;
}

 .dash-panel-subtitle {
  margin-top: 2px;
  font-size: 0.78rem;
  color: rgba(154, 164, 191, 0.8);
  font-weight: 600;
 }

.dash-panel-title svg {
  color: var(--accent);
  opacity: 0.8;
  display: block;
}

.dash-panel-badge {
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dash-panel-body {
  padding: 24px;
}

/* Transaction Roles (autorole) page: reduce extra scroll space */
#page-autorole .dash-panel-body {
  padding-bottom: 16px;
  overscroll-behavior: contain;
}

.dash-panel-desc {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Quick Actions */
.dash-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .dash-quick-actions {
    flex-wrap: wrap;
    overflow: hidden;
  }

  .dash-quick-btn {
    flex: 1 1 220px;
    white-space: normal;
  }
}

.dash-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dash-t-med) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease, box-shadow var(--dash-t-med) ease;
}

.dash-quick-btn:hover {
  transform: none;
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
}

 body:not(.dash-overview) .dash-quick-btn:hover {
  transform: none;
  border-color: var(--dash-border);
  background: var(--dash-surface);
  box-shadow: none;
 }

/* Info Grid */
.dash-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.dash-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-info-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.dash-info-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ===========================================
   SERVER MODAL OVERLAY
   =========================================== */
.dash-server-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.dash-server-modal.open {
  opacity: 1;
  visibility: visible;
}

.dash-server-modal-content {
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.92), rgba(10, 10, 12, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  box-shadow: var(--dash-shadow);
  transition: transform var(--dash-t-med) var(--dash-ease);
}

.dash-server-modal.open .dash-server-modal-content {
  transform: scale(1) translateY(0);
}

.dash-server-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dash-server-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.dash-server-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: transform var(--dash-t-fast) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease, color var(--dash-t-med) ease;
}

 .dash-server-modal-close svg {
  display: block;
 }

.dash-server-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.dash-server-modal-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding-right: 8px;
}

.dash-server-modal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: transform var(--dash-t-fast) var(--dash-ease), border-color var(--dash-t-med) ease, background var(--dash-t-med) ease;
}

.dash-server-modal-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.dash-server-modal-item.active {
  background: rgba(109, 140, 255, 0.1);
  border-color: rgba(109, 140, 255, 0.3);
}

.dash-server-modal-item img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.dash-server-modal-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), rgba(139, 92, 246, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dash-server-modal-item-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.dash-server-modal-item-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.dash-server-modal-item-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

 /* ===========================================
    SERVER SELECTOR DROPDOWN (legacy)
    =========================================== */
 .dash-server-dropdown {
  margin: 0 16px 10px;
  padding: 8px;
  background: rgba(10, 10, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: var(--dash-shadow);
  max-height: 360px;
  overflow: hidden;
  transform: translateY(-6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dash-t-fast) ease, transform var(--dash-t-fast) var(--dash-ease), visibility var(--dash-t-fast) ease;
 }

 .dash-server-dropdown.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
 }

 .dash-server-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
 }

 .dash-server-dropdown-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.85rem;
 }

 .dash-server-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background var(--dash-t-med) ease, border-color var(--dash-t-med) ease;
 }

 .dash-server-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
 }

 .dash-server-option.active {
  background: rgba(109, 140, 255, 0.12);
  border-color: rgba(109, 140, 255, 0.26);
 }

 .dash-server-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
 }

 .dash-server-option-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), rgba(139, 92, 246, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
 }

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

 .dash-server-option-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
 }

 .dash-server-option-meta {
  font-size: 0.75rem;
  color: var(--muted);
 }

 .dash-server-dropdown-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
  padding-top: 8px;
 }

 .dash-server-option-all {
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
 }

/* =========================================== 
   SETTINGS FORMS 
   =========================================== */
.dash-settings-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6d7a99;
}

.dash-settings-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}


.dash-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: rgba(230, 233, 240, 0.92);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  margin-top: 16px;
}

.dash-add-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Settings Item */
.dash-setting-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 12px;
}


.dash-setting-item:last-child {
  margin-bottom: 0;
}

.dash-setting-fields {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.dash-setting-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-setting-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5d6b8a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-setting-input,
.dash-setting-select {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

.dash-setting-input:focus,
.dash-setting-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.dash-setting-input::placeholder {
  color: rgba(154, 164, 191, 0.4);
}

.dash-setting-remove {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #ef4444;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  transform: translateY(-1px);
}

.dash-setting-remove svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.dash-setting-remove:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Custom Select Dropdown */
.dash-select-wrapper {
  position: relative;
}

.dash-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 150ms ease;
  width: 100%;
  text-align: left;
}

.dash-select-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.dash-select-btn .placeholder {
  color: rgba(154, 164, 191, 0.5);
}

.dash-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1a1f2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 150ms ease;
}

.dash-select-wrapper.open .dash-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dash-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 100ms ease;
  color: #9aa4bf;
}

.dash-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.dash-select-option.selected {
  background: rgba(109, 140, 255, 0.15);
  color: #fff;
}

/* Loading Spinner */
.dash-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #6d7a99;
  gap: 16px;
}

.dash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.dash-toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  pointer-events: none;
}

.dashboard-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.9rem;
  animation: slideIn var(--dash-t-med) var(--dash-ease) forwards;
  min-width: 280px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.dash-btn-primary:disabled,
.dash-btn-outline:disabled,
.dash-btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Transaction actions */
.dash-transactions-actions,
.dash-logs-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Ensure consistent sizing/spacing for header action buttons */
.dash-transactions-actions .dash-btn-ghost,
.dash-logs-actions .dash-btn-ghost {
  height: 36px;
  padding: 0 14px;
}

/* Filter input styles */
.dash-filter-search {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.dash-filter-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}

.dash-filter-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.dash-filter-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

/* Improved filter dropdown */
.dash-filter-dropdown {
  position: relative;
}

.dash-filter-dropdown.open .dash-filter-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dash-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  background: rgba(22, 24, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 8px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dash-filter-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.dash-filter-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dash-filter-option.active {
  background: rgba(139, 92, 246, 0.18);
  color: rgba(230, 233, 240, 0.95);
}

/* Logs list: prevent broken wrapping/alignment */
.dash-logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.dash-log-content {
  min-width: 0;
  flex: 1;
}

.dash-log-message {
  color: rgba(230, 233, 240, 0.92);
  line-height: 1.35;
  word-break: break-word;
}

.dash-log-meta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  color: rgba(154, 164, 191, 0.85);
  font-size: 0.8rem;
}

/* Improved button colors */
.dash-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.dash-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.dashboard-toast.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.dashboard-toast.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.dashboard-toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dashboard-toast-icon svg {
  width: 100%;
  height: 100%;
}

.dashboard-toast-message {
  flex: 1;
}

.dashboard-toast-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: opacity var(--dash-t-med) ease, background var(--dash-t-med) ease, border-color var(--dash-t-med) ease;
}

@media (prefers-reduced-motion: reduce) {
  .dash-layout::before {
    animation: none;
  }

  .dash-page {
    transition: none;
    transform: none;
  }

  .dash-page.active {
    transform: none;
  }
}

.dashboard-toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}

/* =========================================== 
   RESPONSIVE 
   =========================================== */

/* Tablet */
@media (max-width: 900px) {
  .dash-sidebar {
    width: 220px;
  }
  
  .dash-content {
    padding: 24px;
  }
  
  .dash-login-screen {
    padding: 100px 20px 40px;
  }
  
  .dash-hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }
  
  .dash-features {
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Login/Server Selection Screens */
  .dash-login-screen {
    padding: 90px 16px 32px;
  }
  
  .dash-page-container {
    max-width: 100%;
  }
  
  .dash-hero {
    margin-bottom: 24px;
  }
  
  .dash-hero-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 12px;
  }
  
  .dash-hero-subtitle {
    font-size: 0.95rem;
    padding: 0 8px;
  }
  
  .dash-hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
  }
  
  .dash-btn-ghost {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
  
  .dash-login-card {
    padding: 28px 20px;
    border-radius: 18px;
  }
  
  .dash-login-card h2 {
    font-size: 1.3rem;
  }
  
  .dash-login-card p {
    font-size: 0.9rem;
  }
  
  .dash-login-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .dash-features {
    gap: 16px;
    margin-top: 28px;
  }
  
  .dash-feature {
    font-size: 0.85rem;
    gap: 8px;
  }
  
  .dash-feature svg {
    width: 20px;
    height: 20px;
  }
  
  .dash-back-link {
    margin-top: 28px;
  }
  
  /* Server Grid */
  .dash-server-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 55vh;
    padding: 4px;
  }
  
  .dash-server-card {
    padding: 14px;
  }
  
  .dash-server-card-icon,
  .dash-server-card-placeholder {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  
  .dash-server-card-name {
    font-size: 0.95rem;
  }
  
  .dash-server-card-members {
    font-size: 0.75rem;
  }
  
  /* Main Dashboard Layout */
  .dash-layout {
    flex-direction: column;
  }

  .dash-layout::after {
    background:
      radial-gradient(900px 520px at 50% 0%, rgba(255, 255, 255, 0.03), transparent 65%),
      radial-gradient(1200px 900px at 50% 120%, rgba(0, 0, 0, 0.72), transparent 60%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.45) 100%);
  }
  
  .dash-sidebar {
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
    position: relative;
  }
  
  .dash-sidebar-header {
    padding: 12px 16px;
  }
  
  .dash-sidebar-brand img {
    width: 32px;
    height: 32px;
  }
  
  .dash-sidebar-brand span {
    font-size: 1rem;
  }
  
  /* Mobile nav - horizontal scroll */
  .dash-nav {
    display: flex;
    flex-direction: row;
    padding: 0 12px 12px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .dash-nav::-webkit-scrollbar {
    display: none;
  }
  
  .dash-nav-item {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 8px;
  }
  
  .dash-server-select {
    padding: 0 12px 12px;
  }
  
  .dash-sidebar-footer {
    display: none;
  }
  
  .dash-main {
    height: auto;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
  }
  
  .dash-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  
  .dash-header-title h1 {
    font-size: 1.35rem;
  }
  
  .dash-header-title p {
    font-size: 0.85rem;
  }
  
  .dash-header-actions {
    position: static;
    transform: none;
    margin-top: 12px;
    width: 100%;
    justify-content: flex-start;
  }
  
  .dash-content {
    padding: 16px;
  }
  
  .dash-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .dash-stat-card {
    padding: 14px;
  }
  
  .dash-stat-icon {
    width: 36px;
    height: 36px;
  }
  
  .dash-stat-value {
    font-size: 1.3rem;
  }
  
  .dash-stat-label {
    font-size: 0.75rem;
  }
  
  .dash-panel {
    border-radius: 14px;
  }
  
  .dash-panel-header {
    padding: 14px 16px;
  }
  
  .dash-panel-body {
    padding: 16px;
  }
  
  .dash-quick-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .dash-quick-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  
  /* Toast repositioning */
  .dash-toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  
  .dashboard-toast {
    min-width: auto;
    width: 100%;
  }
  
  /* Setting slots */
  .dash-setting-slot {
    padding: 14px;
  }
  
  .dash-setting-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .dash-setting-row > * {
    width: 100% !important;
    flex: none !important;
  }
  
  /* Server modal */
  .dash-server-modal-content {
    width: 95%;
    max-width: none;
    max-height: 80vh;
    margin: 10vh auto;
  }
  
  .dash-server-modal-header {
    padding: 16px;
  }
  
  .dash-server-modal-list {
    padding: 12px;
    gap: 8px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .dash-login-screen {
    padding: 80px 12px 24px;
  }
  
  .dash-hero-title {
    font-size: 1.5rem;
  }
  
  .dash-hero-subtitle {
    font-size: 0.9rem;
  }
  
  .dash-login-card {
    padding: 24px 16px;
    border-radius: 14px;
  }
  
  .dash-login-icon svg {
    width: 40px;
    height: 40px;
  }
  
  .dash-login-card h2 {
    font-size: 1.2rem;
  }
  
  .dash-login-card p {
    font-size: 0.85rem;
    margin-bottom: 20px;
  }
  
  .dash-login-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
  
  .dash-features {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  
  .dash-feature {
    width: 100%;
    justify-content: center;
  }
  
  .dash-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dash-header-actions {
    flex-direction: column;
  }
  
  .dash-header-actions .dash-btn-primary,
  .dash-header-actions .dash-btn-secondary {
    width: 100%;
    justify-content: center;
  }
  
  .dash-nav-item {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .dash-server-select {
    padding: 0 10px 10px;
  }
  
  #server-selector {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* ===========================================
   TABLE STYLES
   =========================================== */
.dash-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dash-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.dash-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-table-row {
  transition: background 150ms ease;
}

.dash-table-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dash-table-row-highlight {
  background: rgba(109, 140, 255, 0.05);
}

.dash-table-row-highlight:hover {
  background: rgba(109, 140, 255, 0.08);
}

.dash-table-cell {
  padding: 14px 16px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-table-rank {
  font-size: 1.1rem;
  font-weight: 700;
  width: 60px;
}

.dash-table-amount {
  font-weight: 600;
  color: #10b981;
}

.dash-table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dash-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.dash-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.dash-icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ===========================================
   LOGS STYLES
   =========================================== */
.dash-logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-log-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: background var(--dash-t-med) ease, border-color var(--dash-t-med) ease, transform var(--dash-t-med) ease;
}

.dash-log-item:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.dash-log-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-log-content {
  flex: 1;
  min-width: 0;
}

.dash-log-message {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.4;
}

.dash-log-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-log-user {
  font-weight: 500;
}

.dash-log-time {
  opacity: 0.7;
}

/* ===========================================
   LOADING STATE
   =========================================== */
.dash-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  gap: 16px;
}

.dash-loading-state p {
  margin: 0;
  font-size: 0.95rem;
}

/* ===========================================
   LOGS HEADER & FILTER
   =========================================== */
.dash-logs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-filter-dropdown {
  position: relative;
}

.dash-filter-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 140px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dash-filter-dropdown.open .dash-filter-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-filter-option {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}

.dash-filter-option:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.dash-filter-option.active {
  background: var(--accent);
  color: #fff;
}

/* ===========================================
   HIDE ALL SCROLLBARS
   =========================================== */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Mobile adjustments for tables */
@media (max-width: 768px) {
  .dash-table-container {
    margin: 0 -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .dash-table th,
  .dash-table-cell {
    padding: 12px;
    font-size: 0.85rem;
  }
  
  .dash-table-actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .dash-log-item {
    padding: 12px;
  }
  
  .dash-log-meta {
    flex-direction: column;
    gap: 4px;
  }
}

/* ===========================================
   PERMISSION & ROLE HIERARCHY WARNINGS
   =========================================== */

/* Warning state for setting items */
.dash-setting-item-warning {
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

/* Warning button state */
.dash-select-btn-warning {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Role warning message */
.dash-role-warning,
.dash-channel-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 500;
}

.dash-channel-warning-info {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

/* Disabled option in dropdown */
.dash-select-option-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

.dash-select-option-disabled:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Permission indicators in dropdowns */
.dash-perm-ok {
  color: #10b981;
  font-size: 0.75rem;
  margin-left: 4px;
}

.dash-perm-warn {
  color: #f59e0b;
  font-size: 0.75rem;
  margin-left: 4px;
}

/* Disabled icon for roles */
.dash-role-disabled-icon {
  color: #ef4444;
  font-size: 0.8rem;
}
