
:root {
  --bg: #080d1b;
  --panel: #101a30;
  --panel-light: #14213c;
  --border: rgba(130, 165, 230, .13);
  --blue: #3987ff;
  --cyan: #55c9ff;
  --text: #edf4ff;
  --muted: #8291ac;
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', 'Inter', sans-serif;
  direction: rtl;
  text-align: right;
}

button, select {
  font: inherit;
}

button {
  font-family: inherit;
}

.background-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  top: -300px;
  right: 35%;
  background: rgba(35, 105, 255, .13);
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}

.hidden {
  display: none !important;
}

/* LOGIN */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 460px);
  padding: 48px 40px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(16, 26, 48, .82);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .35);
  backdrop-filter: blur(24px);
}

.brand-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 25px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #3987ff, #1747bb);
  box-shadow: 0 10px 35px rgba(57, 135, 255, .3);
  color: white;
  font-size: 32px;
  font-weight: 800;
}

.eyebrow {
  color: #69a7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
}

.login-card h1 {
  margin: 24px 0 16px;
  font-size: 35px;
  line-height: 1.6;
  font-weight: 900;
  letter-spacing: 0;
}

.login-card h1 span {
  color: var(--blue);
}

.login-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.discord-button {
  margin-top: 32px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  background: linear-gradient(100deg, #347fff, #2363df);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: .2s;
}

.discord-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(52, 127, 255, .3);
}

.secure-note {
  margin-top: 24px;
  color: #8291ac;
  font-size: 11px;
}

/* DASHBOARD */

.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

/* SIDEBAR */

.sidebar {
  width: 265px;
  flex-shrink: 0;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  background: #0b1223;
  border-left: 1px solid var(--border);
  border-right: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 38px;
}

.brand-icon.small {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 12px;
  font-size: 22px;
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 2px;
  direction: ltr;
  text-align: right;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.nav-label {
  padding: 0 12px 13px;
  color: #586984;
  font-size: 11px;
  font-weight: 800;
}

#navigation {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #8d9bb5;
  text-align: right;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(57, 135, 255, .12);
  border-color: rgba(57, 135, 255, .17);
}

.nav-item.active {
  box-shadow: inset -3px 0 var(--blue);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 20px 8px 0;
  border-top: 1px solid var(--border);
}

.connection {
  margin-bottom: 18px;
  color: #9baac2;
  font-size: 11px;
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: #38d99b;
  box-shadow: 0 0 10px #38d99b;
}

.logout-button {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: #aab7cc;
  cursor: pointer;
  text-align: right;
  font-size: 12px;
  transition: .2s;
}

.logout-button:hover {
  background: rgba(255, 80, 100, .08);
  color: #ff8292;
}

/* MAIN CONTENT */

.main-content {
  min-width: 0;
  flex: 1;
  padding: 30px 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
  gap: 15px;
}

.topbar h2 {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c9d6ea;
  font-size: 12px;
  font-weight: 700;
}

.user-info img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel-light);
  object-fit: cover;
}

/* CONTENT */

.content {
  max-width: 1150px;
  margin: 35px auto;
}

.welcome-heading {
  margin-bottom: 28px;
}

.welcome-heading h1 {
  margin-top: 12px;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: 0;
}

.welcome-heading p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.blue-dot {
  color: var(--blue);
}

/* SERVER */

.server-panel,
.stat-card,
.section-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(145deg, #111c32, #0d172a);
}

.server-panel {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

#guildSelect {
  min-width: 230px;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: #0a1325;
  color: white;
  text-align: right;
  direction: rtl;
}

#guildSelect option {
  background: #101a30;
  color: white;
}

.server-status {
  color: #8da1bd;
  font-size: 11px;
  white-space: nowrap;
}

/* STATISTICS */

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

.stat-card {
  min-height: 130px;
  padding: 21px;
  transition: .2s;
}

.stat-card:hover {
  border-color: rgba(57, 135, 255, .35);
  transform: translateY(-2px);
}

.stat-card span {
  display: block;
  color: #7f91af;
  font-size: 11px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 15px 0 7px;
  font-size: 21px;
  font-weight: 800;
}

.stat-card small {
  color: #7586a2;
  font-size: 10px;
}

/* MODULES */

.section-card {
  padding: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-heading h3 {
  font-size: 16px;
  font-weight: 800;
}

.section-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.status-tag,
.module-state {
  color: #6caaff;
  font-size: 10px;
  font-weight: 800;
}

.status-tag {
  padding: 7px 10px;
  border: 1px solid rgba(57, 135, 255, .2);
  border-radius: 6px;
  background: rgba(57, 135, 255, .08);
  white-space: nowrap;
}

.module-row {
  min-height: 51px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  color: #c4d0e2;
  font-size: 12px;
  gap: 12px;
}

footer {
  max-width: 1150px;
  margin: 45px auto 0;
  color: #52627d;
  font-size: 10px;
  letter-spacing: .5px;
  text-align: center;
}

footer span {
  color: var(--blue);
  padding: 0 5px;
}

/* RESPONSIVE */

@media (max-width: 850px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    padding: 25px 20px;
  }
}

@media (max-width: 650px) {
  .dashboard {
    display: block;
  }

  .sidebar {
    width: 100%;
    padding: 15px;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding-bottom: 18px;
  }

  #navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    padding: 11px 10px;
    font-size: 11px;
    gap: 8px;
  }

  .sidebar-bottom {
    margin-top: 18px;
  }

  .main-content {
    padding: 20px 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 12px;
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .user-info {
    font-size: 11px;
  }

  .server-panel {
    align-items: stretch;
    flex-direction: column;
  }

  #guildSelect {
    width: 100%;
    min-width: 0;
  }

  .section-card {
    padding: 18px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-card {
    padding: 38px 24px;
  }

  .login-card h1 {
    font-size: 30px;
  }
}
