:root {
  --bg-main: #06070a;
  --bg-sidebar: #0c0a15;
  --bg-topbar: #080710;
  --bg-card: #121022;
  --bg-card-hover: #191630;
  
  --border-color: #221d3f;
  --border-glow: #7000FF;
  
  --accent-purple: #7000FF;
  --accent-purple-light: #9842FF;
  --accent-purple-glow: rgba(112, 0, 255, 0.35);
  
  --color-green: #10B981;
  --color-red: #EF4444;
  --color-blue: #3B82F6;
  --color-amber: #F59E0B;
  
  --text-main: #f8fafc;
  --text-muted: #8492a6;
  --text-dim: #475569;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(112, 0, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(0, 240, 255, 0.06) 0%, transparent 50%);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 14px;
}

.sidebar-top-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.nav-strip-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-strip-icon:hover, .nav-strip-icon.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple-light);
  box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.guild-pill-icon img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.server-selector-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.server-selector-card:hover {
  border-color: var(--accent-purple);
  background: rgba(112, 0, 255, 0.08);
}

.server-avatar-wrapper {
  width: 38px;
  height: 38px;
  position: relative;
}

.server-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

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

.server-selector-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-selector-info p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.server-selector-info p span {
  color: #a78bfa;
  font-weight: 600;
}

.server-selector-arrow {
  color: var(--text-muted);
}

/* CATEGORY MENU */
.sidebar-categories {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-category {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 4px;
  padding-left: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, #7000FF, #8b42ff);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(112, 0, 255, 0.4);
}

.badge-tag {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.04em;
}

.tag-new {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.tag-update {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-check-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--color-green);
  margin-left: auto;
  position: relative;
}

.status-check-dot::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: var(--color-green);
  font-weight: 900;
}

/* SIDEBAR FOOTER USER CARD */
.sidebar-user-card {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-card-avatar {
  position: relative;
  width: 36px;
  height: 36px;
}

.user-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--color-green);
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
}

.user-card-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-handle {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-icon-dots {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
}

.btn-icon-dots:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ================= TOPBAR ================= */
.dashboard-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: var(--bg-topbar);
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-breadcrumb .slash {
  color: #475569;
}

.topbar-breadcrumb .current-page {
  color: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-action-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.topbar-action-link:hover {
  color: #fff;
}

.topbar-lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.topbar-lang-selector:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #141126;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px;
  width: 130px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.topbar-lang-selector.open .lang-dropdown {
  display: block;
}

.lang-option {
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.lang-option:hover {
  background: rgba(112, 0, 255, 0.2);
}

.topbar-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.user-avatar-small img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name-small {
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar-logout-btn {
  color: #ef4444;
  display: flex;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.topbar-logout-btn:hover {
  transform: scale(1.15);
}

/* ================= MAIN VIEW ================= */
.main-content {
  flex: 1;
  padding: 36px 42px;
  overflow-y: auto;
}

.overview-header {
  margin-bottom: 32px;
}

.overview-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.overview-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* SECTION TITLE */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 18px;
}

/* ================= MODERN KPI STAT CARDS ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(112, 0, 255, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(112, 0, 255, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.kpi-subtext {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ================= PLUGIN CARDS GRID ================= */
.plugins-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.plugins-category-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-header-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.plugins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) {
  .plugins-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .plugins-grid {
    grid-template-columns: 1fr;
  }
}

.plugin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  position: relative;
  transition: all 0.25s ease;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, rgba(112,0,255,0.04) 100%);
}

.plugin-card:hover {
  border-color: rgba(112, 0, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(112, 0, 255, 0.15);
}

.plugin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.plugin-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plugin-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(112, 0, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a78bfa;
  font-size: 1.1rem;
}

.plugin-title-row h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.plugin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pin {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.btn-pin:hover {
  color: #fff;
}

.plugin-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

.btn-explore:hover {
  color: #a78bfa;
  gap: 10px;
}

/* ================= SWITCH TOGGLE ================= */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #2a244d;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(90deg, #7000FF, #9842FF);
  box-shadow: 0 0 12px rgba(112, 0, 255, 0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ================= GLASS CARDS & TABLES ================= */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.chip-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(90deg, #7000FF, #8b42ff);
  color: #fff;
  box-shadow: 0 4px 14px rgba(112, 0, 255, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(112, 0, 255, 0.6);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--color-red);
  color: #fff;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* TABLES */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.rank-badge {
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
}

.rank-1 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.rank-2 { background: rgba(255, 255, 255, 0.15); color: #fff; }
.rank-3 { background: rgba(205, 127, 50, 0.2); color: #e09f67; }

.level-tag {
  background: rgba(112, 0, 255, 0.18);
  color: #c084fc;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
}

.xp-mini-bar {
  width: 120px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #7000FF, #00F0FF);
}

/* FORMS */
.form-control {
  width: 100%;
  padding: 11px 14px;
  background: #0d0c18;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.2);
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #231e42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}
