:root {
  --bg: #0b0d10;
  --panel: #111316;
  --panel-2: #0c0e11;
  --text: #e9eef5;
  --muted: #9aa4b2;
  --accent: #4cc9f0;
  --accent-2: #3a86ff;
  --orb-1: #1f8ef1;
  --orb-1b: #00f5d4;
  --orb-2: #7209b7;
  --orb-2b: #4895ef;
  --danger: #ef476f;
  --shadow: rgba(0, 0, 0, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --topbar-h: 64px;
  --sidenav-w: 220px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.bg-orb.one {
  top: -180px;
  right: -180px;
  background: radial-gradient(circle, var(--orb-1), var(--orb-1b));
}

.bg-orb.two {
  bottom: -200px;
  left: -200px;
  background: radial-gradient(circle, var(--orb-2), var(--orb-2b));
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  z-index: 10;
  overflow: visible;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.6px;
}

.sidenav-banner {
  display: block;
  width: 100%;
  max-width: 180px;
  max-height: 44px;
  object-fit: contain;
  border-radius: 8px;
  margin: 2px 0 8px;
}

.actions {
  display: flex;
  gap: 12px;
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.center {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px 16px 24px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.grid.admin {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

.card.wide {
  grid-column: span 2;
}

.grid.admin .card.wide {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 40px;
  margin: 10px 0 8px 0;
}

.hero p {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 22px;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(76, 201, 240, 0.1);
  border: 1px solid rgba(76, 201, 240, 0.3);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d10;
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.chart-btn.active {
  background: rgba(76, 201, 240, 0.16);
  border-color: rgba(76, 201, 240, 0.4);
}

.btn.danger {
  background: rgba(239, 71, 111, 0.2);
  border-color: rgba(239, 71, 111, 0.4);
  color: #ffd6df;
}

.meta {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.profile {
  display: flex;
  gap: 16px;
  align-items: center;
}

.avatar img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: #0b0d10;
}

.profile-meta .name {
  font-size: 18px;
  font-weight: 600;
}

.profile-meta .sub {
  color: var(--muted);
  font-size: 12px;
}

.btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Larger CTA sizing for auth pages */
.center .hero .btn-row .btn {
  padding: 10px 16px;
  min-height: 40px;
  font-size: 14px;
}

.btn-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.btn-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.file-input {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 12px;
}

.role {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px;
}

.stat.big {
  text-align: center;
  padding: 18px;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
}

.stat .value {
  font-size: 22px;
  font-weight: 700;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chart-wrap {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  min-height: 160px;
}

.chart-placeholder {
  height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.list {
  display: grid;
  gap: 10px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.stat-card .stat-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
}

.stat-card .stat-meta {
  color: var(--muted);
  font-size: 12px;
}

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

.guild-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  overflow: hidden;
}

.guild-card-head {
  padding: 12px 14px 8px;
}

.guild-hero {
  height: 140px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

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

.guild-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px 14px;
}

.guild-id {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.guild-id img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: 0 0 auto;
}

.guild-name {
  font-weight: 800;
  font-size: 16px;
  max-width: 320px;
}

.guild-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
  word-break: break-word;
}

.guild-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.friends-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.friends-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.friends-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friends-add input {
  width: 180px;
  max-width: 46vw;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  height: 34px;
  padding: 0 10px;
}

.friends-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}

.friend-main {
  min-width: 0;
}

.friend-name {
  font-weight: 700;
}

.friend-sub {
  color: var(--muted);
  font-size: 12px;
}

.friend-send {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-send input {
  width: 90px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  height: 30px;
  padding: 0 8px;
}

.chat-modal {
  width: min(720px, 92vw);
}

.chat-box {
  min-height: 280px;
  max-height: 44vh;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.chat-msg {
  display: flex;
}

.chat-msg.mine {
  justify-content: flex-end;
}

.chat-msg.other {
  justify-content: flex-start;
}

.chat-text {
  max-width: min(80%, 460px);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  word-break: break-word;
  font-size: 13px;
}

.chat-msg.mine .chat-text {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.chat-send-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-send-row input[type="text"] {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 0 10px;
}

.leaderboard-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leaderboard-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.leader-tab {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.leader-tab.active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.leader-panel {
  display: none;
  margin-top: 10px;
}

.leader-panel.active {
  display: block;
}

.leader-list {
  display: grid;
  gap: 8px;
}

.leader-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.leader-rank {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.leader-user {
  font-weight: 700;
  font-size: 13px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-score {
  font-weight: 800;
  font-size: 13px;
}

.service-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.01);
  overflow: hidden;
  margin-top: 8px;
}

.service-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.service-details {
  display: grid;
  gap: 6px;
}

.service-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.service-line strong {
  color: var(--text);
  font-weight: 700;
  min-width: 0;
}

.service-head-actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

.service-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.service-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.service-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.service-tab.active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.inline-form {
  margin: 0;
}

.service-overview {
  padding: 16px 18px 18px;
  display: grid;
  gap: 10px;
}

.service-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.service-overview-title {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  min-width: 0;
  max-width: min(100%, 560px);
}

.truncate-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
}

.service-meta {
  color: var(--muted);
  font-size: 12px;
}

.live-state {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.server-specs-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-box {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.service-box span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.service-box strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.service-box.limits {
  margin-top: 2px;
}

.limits-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.limits-grid > div {
  display: grid;
  gap: 4px;
}

.limits-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.limits-grid strong {
  color: var(--text);
  font-size: 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(560px, 92vw);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px var(--shadow);
  display: grid;
  gap: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-weight: 700;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.modal .stat {
  min-width: 0;
}

.modal .stat .label {
  line-height: 1.2;
}

.modal .stat .value {
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clamp-list {
  max-height: 260px;
  overflow: hidden;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.server-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.server-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  display: grid;
  gap: 10px;
}

.server-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.server-name {
  font-size: 17px;
  font-weight: 700;
}

.server-meta {
  font-size: 12px;
  color: var(--muted);
}

.server-specs {
  display: grid;
  gap: 8px;
}

.server-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.server-spec-item strong {
  font-size: 12px;
  color: var(--text);
}

.server-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.server-actions form {
  margin: 0;
}

.login-help-card .card-title {
  margin-bottom: 10px;
}

.login-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.login-help-grid div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 6px;
}

.login-help-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-help-grid strong {
  color: var(--text);
  font-size: 12px;
  word-break: break-word;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

.layout > main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidenav-w);
}

.menu-overlay {
  display: none;
}

.sidenav {
  width: var(--sidenav-w);
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: 0;
  height: auto;
  padding: 18px 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  z-index: 3;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 14px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d10;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-text strong {
  font-size: 14px;
  letter-spacing: 0.4px;
}

.logo-text span {
  font-size: 11px;
  color: var(--muted);
}

.nav-item {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 13px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.nav-item.active {
  background: rgba(76, 201, 240, 0.16);
  color: var(--text);
}

.nav-spacer {
  flex: 1;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.hidden {
  display: none;
}

.inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.bulk {
  margin-bottom: 12px;
}

.line {
  margin-bottom: 8px;
}

.warn {
  margin-top: 10px;
  color: #ffd166;
}

.empty {
  color: var(--muted);
}

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row input, .row select, .row textarea {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.row textarea {
  resize: vertical;
  min-height: 110px;
  font: inherit;
}

.row input::placeholder,
.row textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, white 12%);
}

.row .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-actions.compact .btn {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.1;
}

.row select {
  appearance: none;
}

.row option {
  background: var(--panel);
  color: var(--text);
}

.row.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.row.check.plan-check {
  justify-content: space-between;
}

/* Admin settings switches */
.row.check.setting-switch {
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.row.check.setting-switch label {
  font-weight: 600;
}

.row.check.setting-switch .setting-toggle {
  width: 46px;
  height: 25px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border) 65%);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.row.check.setting-switch .setting-toggle::after {
  content: "";
  width: 19px;
  height: 19px;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  position: absolute;
  top: 2px;
  left: 2px;
  transform: none;
  transition: left 0.18s ease, background 0.18s ease;
}

.row.check.setting-switch .setting-toggle:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.row.check.setting-switch .setting-toggle:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.row.check.setting-switch .setting-toggle:checked::after {
  left: 23px;
  background: #ffffff;
  transform: none;
}

/* Themed tick/checkbox controls */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border) 60%);
  background: rgba(255, 255, 255, 0.03);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
  vertical-align: middle;
}

input[type="checkbox"]::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #0b0d10;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.14s ease;
}

input[type="checkbox"]:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, white 30%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white 30%);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Admin plans: "Enabled" toggle */
.row.check.plan-check .plan-enabled-toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border) 65%);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transform: translateY(1px);
}

.row.check.plan-check .plan-enabled-toggle::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  position: absolute;
  top: 2px;
  left: 2px;
  transform: none;
  transition: left 0.18s ease, background 0.18s ease;
}

.row.check.plan-check .plan-enabled-toggle:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.row.check.plan-check .plan-enabled-toggle:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.row.check.plan-check .plan-enabled-toggle:checked::after {
  left: 20px;
  background: #ffffff;
  transform: none;
}

.table {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  width: 100%;
}

.thead, .trow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.thead div, .trow div {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-cell,
.action-cell {
  overflow: visible;
  white-space: normal;
}

.role-cell .role-edit {
  flex-wrap: nowrap;
}

.action-cell .action-row {
  flex-wrap: nowrap;
}

.table-users .action-row .btn,
.table-users .role-edit .btn {
  padding: 3px 6px;
  font-size: 10px;
}

.thead {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.trow {
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
}

.user-row {
  cursor: pointer;
}

.action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Admin categories form: keep save/cancel compact on small widths */
.cat-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-form-actions .btn {
  width: auto !important;
  min-width: 0;
  white-space: nowrap;
  padding: 4px 9px;
}

.role-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.role-edit select {
  min-width: 90px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge.on {
  color: #b7f7ce;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
}

.badge.off {
  color: #ffd6df;
  border-color: rgba(239, 71, 111, 0.4);
  background: rgba(239, 71, 111, 0.12);
}

.link-small {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-left: 6px;
}

.link-small:hover {
  color: var(--text);
}

.sidenav .nav-item.search-hit {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.btn.sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn.xs {
  padding: 3px 6px;
  font-size: 10px;
}

.btn.tight {
  padding: 2px 6px;
  font-size: 10px;
}

.table-users .thead, .table-users .trow {
  grid-template-columns: 60px 1.3fr 1.2fr 1.6fr 0.8fr 0.9fr 1.2fr;
}

.table-panel-users .thead, .table-panel-users .trow {
  grid-template-columns: 80px 1.2fr 1.6fr 1.2fr 1.2fr 0.8fr;
}

.table-logs .thead, .table-logs .trow {
  grid-template-columns: 70px 160px 160px 1.4fr 140px 20px;
}

.table-servers .thead, .table-servers .trow {
  grid-template-columns: 44px 72px 170px minmax(280px, 1.6fr) 180px 96px 110px 84px;
}

.table-servers .thead {
  font-size: 11px;
}

.table-servers .trow {
  padding: 8px 6px;
  gap: 6px;
}

.table-servers .trow > div {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.table-plans .thead, .table-plans .trow {
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 1fr 1.1fr 1.4fr;
}

.plan-groups {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.plan-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.plan-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 10px;
}

.plan-group-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.table {
  overflow-x: auto;
}

.table-users .detail-row {
  display: grid;
  grid-template-columns: 1fr;
  background: rgba(255, 255, 255, 0.02);
}

.table-users .detail-row.hidden {
  display: none;
}

.detail-card {
  display: grid;
  gap: 8px;
}

.detail-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-users .trow > div {
  font-size: 12px;
}

.table-users .action-cell .action-row {
  justify-content: flex-end;
}

.table-users .trow.user-row {
  align-items: center;
}

.table-servers .action-cell {
  overflow: visible;
  white-space: nowrap;
}

.table-servers .action-cell .btn {
  white-space: nowrap;
  display: inline-flex;
  justify-content: center;
  min-width: 56px;
}

.table-servers .col-userid,
.table-servers .col-owner,
.table-servers .col-created,
.table-servers .col-action {
  overflow: visible;
  text-overflow: clip;
}

.table-servers .col-userid,
.table-servers .col-owner {
  font-variant-numeric: tabular-nums;
}

.table-servers .col-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-servers .col-action {
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.log-time {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.page-header .actions .btn {
  margin-top: 6px;
}

.per-page-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.per-page-form label {
  color: var(--muted);
  font-size: 12px;
}

.per-page-form select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.per-page-form select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white 30%);
  outline-offset: 1px;
}

.per-page-form select option {
  background: var(--panel);
  color: var(--text);
}

.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}

.table-controls .searchbar {
  flex: 1;
  min-width: 160px;
}

.table-controls .per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.table-controls select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.table-controls select option {
  background: var(--panel);
  color: var(--text);
}

.table-controls.right-controls {
  justify-content: flex-end;
  padding-right: 6px;
}

.table-controls.right-controls .searchbar {
  flex: 0 1 260px;
  min-width: 200px;
}

.table-controls.right-controls .searchbar input {
  width: 100%;
}

.table-controls.right-controls .per-page {
  margin-left: 6px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pager button {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.site-footer {
  position: relative;
  z-index: 0;
  margin: 0;
  padding: 34px 0 18px;
  min-height: 220px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--muted);
  font-size: 13px;
  width: 100%;
}

.site-footer .footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  width: 100%;
  padding-left: 64px;
  padding-right: 64px;
}

body.has-sidenav .site-footer .footer-inner {
  padding-left: calc(var(--sidenav-w) + 64px);
  padding-right: 64px;
}

body.has-sidenav .site-footer::before {
  content: "";
  position: absolute;
  left: var(--sidenav-w);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 48px;
  align-items: start;
}

.footer-brand-col {
  display: grid;
  gap: 14px;
}

.footer-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  margin-bottom: 2px;
}

.footer-banner {
  display: block;
  width: auto;
  max-width: 260px;
  max-height: 64px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b0d10;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.footer-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.site-footer .footer-brand {
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text);
  line-height: 1.2;
}

.site-footer .footer-copy {
  line-height: 1.45;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 34px;
}

.footer-col {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-col-title {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 2px;
}

.footer-col-link {
  color: color-mix(in srgb, var(--text) 88%, #9ca3af);
  text-decoration: none;
  line-height: 1.4;
  font-size: 14px;
  display: inline-flex;
  width: fit-content;
  justify-self: start;
}

.footer-col-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-links-pages {
  max-width: none;
  row-gap: 0;
}

.footer-link.page {
  font-size: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.footer-links-social {
  gap: 14px;
}

.footer-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

.footer-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-made {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 760px) {
  .site-footer .footer-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.has-sidenav .site-footer .footer-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
  }

  .footer-top {
    gap: 30px;
  }

  .footer-brand-col,
  .footer-brand-row {
    justify-items: center;
    justify-content: center;
  }

  .footer-banner {
    max-width: 220px;
    max-height: 56px;
  }

  .footer-col {
    justify-items: center;
    text-align: center;
    gap: 12px;
    padding: 6px 0;
  }

  .footer-col-title {
    margin-bottom: 6px;
  }

  .footer-col-link {
    justify-self: center;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer-bottom-right {
    justify-content: center;
    width: 100%;
  }
}

.store-grid {
  display: grid;
  gap: 18px;
}

.store-group {
  display: grid;
  gap: 12px;
}

.store-title {
  font-size: 15px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text);
  padding-bottom: 4px;
}

.store-shell {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

.store-categories-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  align-self: start;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}

.store-categories-hero {
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--panel-2) 80%, transparent));
}

.store-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, var(--accent), var(--accent-2) 65%);
}

.store-cat-title {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
}

.store-cat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.store-categories-list {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.store-cat-btn {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255,255,255,0.01);
  cursor: pointer;
  font-size: 13px;
}

.store-cat-btn:last-child {
  border-bottom: 0;
}

.store-cat-btn.active {
  background: linear-gradient(90deg, rgba(103, 54, 217, 0.35), rgba(103, 54, 217, 0.06));
  color: #e6ddff;
}

.store-main-panel {
  display: grid;
  gap: 14px;
}

.store-toolbar {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}

.store-search input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.store-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.store-metric {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
}

.store-metric.all {
  border-color: rgba(127, 57, 255, 0.45);
  background: linear-gradient(120deg, rgba(93, 27, 189, 0.35), rgba(37, 16, 72, 0.36));
}

.store-metric.available {
  border-color: rgba(29, 161, 92, 0.45);
  background: linear-gradient(120deg, rgba(18, 91, 57, 0.35), rgba(7, 44, 26, 0.35));
}

.store-metric.locked {
  border-color: rgba(191, 43, 54, 0.45);
  background: linear-gradient(120deg, rgba(112, 23, 29, 0.35), rgba(53, 10, 14, 0.35));
}

.store-metric-count {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.store-metric-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.store-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.06), rgba(255,255,255,0.01) 45%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  min-height: 240px;
  aspect-ratio: 1 / 1;
}

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.product-name {
  font-weight: 700;
}

.product-specs {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.price {
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 90%, #7d21ff);
}

.product-stock {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
}

.product-stock.ok {
  color: #2ad977;
  border-color: rgba(42, 217, 119, 0.34);
  background: rgba(9, 78, 43, 0.2);
}

.product-stock.bad {
  color: #ff6376;
  border-color: rgba(255, 99, 118, 0.34);
  background: rgba(120, 14, 29, 0.22);
}

.product-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-claim {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-btn {
  min-width: 170px;
  justify-content: center;
  text-align: center;
}

.product-claim input {
  width: 140px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .store-shell {
    grid-template-columns: 1fr;
  }

  .store-categories-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .store-metrics {
    grid-template-columns: 1fr;
  }

  .store-products {
    grid-template-columns: 1fr;
  }

  .product-card {
    aspect-ratio: auto;
    min-height: 220px;
  }
}

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.cmd-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  display: grid;
  gap: 6px;
}

.cmd-name {
  font-weight: 700;
}

.form .btn,
.bulk .btn,
.page-header .actions .btn {
  padding: 5px 9px;
  font-size: 11px;
}

.profile-menu {
  z-index: 90;
}

.sub-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.crumbs {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.searchbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  min-width: 220px;
}

.searchbar input {
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  width: 180px;
}

.kpi {
  position: relative;
  padding-bottom: 18px;
}

.kpi .mini {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.2);
  overflow: hidden;
}

.kpi .mini span {
  display: block;
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.title-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.title-inline .card-title {
  margin: 0;
}

.compact-row {
  align-items: center;
}

.compact-row .ellipsis {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-compact-panel {
  min-height: 260px;
  max-height: 260px;
  overflow: auto;
}

.compact-list .list-row {
  padding-top: 6px;
  padding-bottom: 6px;
  gap: 8px;
}

.compact-list .muted {
  font-size: 11px;
  white-space: nowrap;
}

.dash-summary {
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.dashboard-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dashboard-bottom .dash-summary {
  min-height: 340px;
  height: 100%;
}

.dashboard-bottom .dash-summary .list,
.dashboard-bottom .dash-summary .leader-list {
  flex: 1;
  align-content: start;
  grid-auto-rows: min-content;
}

.dashboard-bottom .dash-summary .list-row {
  align-items: center;
}

.dashboard-bottom .dash-summary .list-row > div:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bottom .dash-summary .list-row > .muted {
  white-space: nowrap;
  font-size: 11px;
  flex-shrink: 0;
}

.new-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
}

.new-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-user-time {
  margin-left: 10px;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-users-list {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-content: flex-start;
  align-content: flex-start;
  flex: 0 0 auto !important;
}

.dashboard-bottom .dash-summary .new-users-list {
  flex: 0 0 auto !important;
  min-height: 0;
}

.dashboard-bottom .dash-summary .new-users-list .list-row {
  min-height: 42px;
}

.dash-summary .leaderboard-card {
  flex: 1;
}

.dashboard-bottom .dash-summary .leaderboard-card {
  margin-top: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

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

  .dashboard-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .bg-orb {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .layout {
    flex-direction: column;
  }

  .layout > main {
    margin-left: 0;
  }

  .sidenav {
    position: fixed;
    left: calc(var(--sidenav-w) * -1);
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    width: var(--sidenav-w);
    flex-direction: column;
    flex-wrap: nowrap;
    transition: left 0.2s ease;
    z-index: 40;
  }

  .sidenav.open {
    left: 0;
  }

  .menu-overlay {
    display: none;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 30;
  }

  .menu-overlay.show {
    display: block;
  }

  body.has-sidenav .site-footer {
    margin-left: 16px;
    margin-right: 16px;
  }

  body.has-sidenav .site-footer .footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .admin-top {
    backdrop-filter: none;
  }

  .card,
  .panel,
  .site-footer,
  .sidenav {
    box-shadow: none;
  }

  .thead, .trow {
    grid-template-columns: 1fr 1fr;
  }

  .chart-wrap {
    padding: 8px;
  }

  .service-head {
    grid-template-columns: 1fr;
  }

  .server-specs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .service-overview-title {
    font-size: 26px;
  }

  .guild-info-row {
    grid-template-columns: 1fr;
  }

  .guild-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .friends-head {
    flex-direction: column;
    align-items: stretch;
  }

  .friends-add input {
    width: 100%;
    max-width: none;
  }

  .friend-row {
    grid-template-columns: 1fr;
  }

  .friend-send {
    width: 100%;
  }

  .friend-send input {
    width: 100%;
  }

  .chat-send-row {
    grid-template-columns: 1fr;
  }

  .leaderboard-head {
    flex-direction: column;
    align-items: stretch;
  }

  .title-inline {
    flex-wrap: wrap;
  }

  .leaderboard-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .leader-tab {
    flex: 1;
  }
}

.settings-form .panel {
  margin-bottom: 12px;
}

.settings-form > .tab-panel,
.settings-form > button {
  grid-column: 1 / -1;
}

.settings-form > button {
  justify-self: start;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 18px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.tab-btn.active {
  background: rgba(76, 201, 240, 0.16);
  border-color: rgba(76, 201, 240, 0.4);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.admin-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 80;
  overflow: visible;
}

.admin-top .top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-banner {
  height: 32px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  border-radius: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-top .top-center {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  z-index: 1;
}

.admin-top .top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
}

.top-search {
  width: min(240px, 100%);
  min-width: 0;
}

.top-search input {
  width: 100%;
}

.profile-wrap {
  position: relative;
  z-index: 80;
}

.notif-bell {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 90%, var(--accent) 10%);
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.notif-bell:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--panel) 75%, var(--accent) 25%);
}

.notif-bell svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #0b0d10;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.profile-btn .meta {
  margin: 0;
  font-size: 12px;
}

.profile-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
  line-height: 1.1;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d10;
  font-weight: 700;
  font-size: 14px;
}

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

.chev {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 20px 40px var(--shadow);
  display: none;
  pointer-events: auto;
  z-index: 90;
}

.profile-menu.open {
  display: block;
}


.profile-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}

.profile-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.toast {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 18px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 16px 30px var(--shadow);
  z-index: 70;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  max-width: min(92vw, 560px);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.45);
  background: color-mix(in srgb, var(--panel) 84%, #10b981 16%);
}

.toast.error {
  border-color: rgba(239, 71, 111, 0.5);
  background: color-mix(in srgb, var(--panel) 84%, #ef476f 16%);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: color-mix(in srgb, var(--panel) 84%, #f59e0b 16%);
}

.toast .muted {
  font-size: 14px;
}

.toast.hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.profile-head .muted {
  margin-top: 2px;
}

.grid {
  gap: 14px;
  padding: 20px 24px 28px;
}

.chart-wrap canvas {
  width: 100%;
  display: block;
}

@media (max-width: 900px) {
  .admin-top {
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
  }

  .top-search {
    width: 100%;
  }

  .profile-btn .profile-name {
    display: none;
  }

  .admin-top .logo {
    display: none;
  }

  .grid {
    padding: 18px 16px 24px;
  }
}

/* Mobile layout hardening */
@media (max-width: 900px) {
  .admin-top .top-left,
  .admin-top .top-center,
  .admin-top .top-right {
    min-width: 0;
  }

  .admin-top .top-center {
    justify-content: stretch;
  }

  .top-banner {
    height: 28px;
    max-width: 180px;
  }

  .top-search,
  .top-search.searchbar,
  .admin-top .searchbar {
    width: 100%;
    min-width: 0;
  }

  .admin-top .searchbar input {
    width: 100%;
    min-width: 0;
  }

  .page-header,
  .table-controls,
  .table-controls.right-controls {
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
  }

  .page-header .actions,
  .table-controls .searchbar,
  .table-controls.right-controls .searchbar,
  .table-controls .per-page {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .table-controls .searchbar input,
  .table-controls.right-controls .searchbar input {
    width: 100%;
  }

  .actions {
    flex-wrap: wrap;
  }

  .action-row,
  .role-edit,
  .service-btns,
  .service-tabs-row {
    flex-wrap: wrap;
  }

  .btn,
  .btn.sm,
  .btn.xs {
    max-width: 100%;
    white-space: nowrap;
  }

  .table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table .thead,
  .table .trow {
    min-width: 760px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .table-users .thead, .table-users .trow {
    min-width: 980px;
    grid-template-columns: 60px 1.3fr 1.2fr 1.6fr 0.8fr 0.9fr 1.2fr;
  }
  .table-panel-users .thead, .table-panel-users .trow {
    min-width: 860px;
    grid-template-columns: 80px 1.2fr 1.6fr 1.2fr 1.2fr 0.8fr;
  }
  .table-logs .thead, .table-logs .trow {
    min-width: 860px;
    grid-template-columns: 70px 160px 160px 1.4fr 140px 20px;
  }
  .table-servers .thead, .table-servers .trow {
    min-width: 1120px;
    grid-template-columns: 44px 72px 170px minmax(280px, 1.6fr) 180px 96px 110px 84px;
  }
  .table-plans .thead, .table-plans .trow {
    min-width: 980px;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 1fr 1.1fr 1.4fr;
  }

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

  .stats,
  .server-specs-grid,
  .limits-grid,
  .guild-meta,
  .store-metrics,
  .store-products {
    grid-template-columns: 1fr;
  }

  .friend-row {
    grid-template-columns: 1fr;
  }

  .friend-send,
  .friend-send input,
  .friends-add input {
    width: 100%;
    max-width: none;
  }

  .modal {
    width: min(94vw, 94vw);
    max-height: 84vh;
    overflow: auto;
  }

  .toast {
    right: 10px;
    left: 10px;
  }
}

@media (max-width: 640px) {
  .admin-top {
    gap: 8px;
    padding: 0 10px;
  }

  .menu-btn {
    padding: 7px;
  }

  .profile-btn {
    padding: 6px 8px;
  }

  .avatar-sm {
    width: 28px;
    height: 28px;
  }

  .grid {
    padding: 14px 10px 20px;
    gap: 10px;
  }

  .card,
  .panel {
    padding: 12px;
  }

  .site-footer .footer-inner {
    padding-left: 14px;
    padding-right: 14px;
    gap: 16px;
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    width: 100%;
  }

  .form-actions .btn {
    width: auto;
    min-width: 0;
  }

  .product-actions,
  .product-claim {
    width: 100%;
    justify-content: stretch;
  }

  .product-btn {
    width: 100%;
    min-width: 0;
  }

  .product-claim input {
    width: 100%;
  }
}

/* Global responsive hardening: prevents overlap on small + medium screens */
img,
canvas,
svg,
video,
iframe {
  max-width: 100%;
}

.card,
.panel,
.list-row,
.page-header,
.table-controls,
.action-row,
.service-head,
.service-head-actions,
.service-btns,
.service-tabs-row,
.friends-head,
.leaderboard-head,
.footer-top,
.footer-cols {
  min-width: 0;
}

.list-row > div,
.stat .value,
.service-line strong,
.service-overview-title,
.leader-user,
.new-user-name {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .searchbar {
    min-width: 0;
    max-width: 100%;
  }

  .admin-top {
    padding: 0 12px;
    gap: 8px;
  }

  .admin-top .top-left,
  .admin-top .top-center,
  .admin-top .top-right {
    min-width: 0;
  }

  .top-search {
    width: min(200px, 100%);
  }

  .profile-btn .profile-name {
    display: none;
  }

  .page-header,
  .table-controls,
  .table-controls.right-controls,
  .action-row {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .page-header .actions,
  .table-controls .searchbar,
  .table-controls.right-controls .searchbar,
  .table-controls .per-page {
    min-width: 0;
  }

  .table-controls .searchbar input,
  .table-controls.right-controls .searchbar input {
    width: 100%;
    min-width: 0;
  }

  .form {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .title-inline {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .list-row,
  .new-user-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
  }

  .new-user-time {
    margin-left: 0;
    max-width: none;
  }

  .dashboard-bottom .dash-summary .list-row > div:first-child,
  .dashboard-bottom .dash-summary .list-row > .muted,
  .compact-list .muted,
  .new-user-name,
  .new-user-time,
  .leader-user,
  .leader-score,
  .list-row > div {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .leader-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .dashboard-bottom {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .grid {
    padding: 16px 14px 22px;
  }

  .dashboard-bottom,
  .split {
    grid-template-columns: 1fr;
  }

  .service-head,
  .store-shell {
    grid-template-columns: 1fr;
  }

  .service-overview-title {
    font-size: 24px;
  }

  .server-specs-grid,
  .limits-grid,
  .guild-meta,
  .store-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .guild-name,
  .guild-sub {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .friends-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .friends-add {
    width: 100%;
    flex-wrap: wrap;
  }

  .friends-add input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .friend-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .friend-send {
    width: 100%;
    flex-wrap: wrap;
  }

  .friend-send input {
    width: 100%;
    min-width: 0;
  }

  .friend-row > form .btn,
  .friend-row > .btn {
    width: 100%;
  }

  .leaderboard-head {
    flex-direction: column;
    align-items: stretch;
  }

  .leaderboard-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .leader-tab {
    flex: 1;
  }

  .service-line {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .service-overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .service-btns > .btn,
  .service-btns > form,
  .service-btns > form .btn {
    width: 100%;
  }

  .service-tabs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .service-tabs-row .service-tab,
  .service-tabs-row .inline-form,
  .service-tabs-row .inline-form .service-tab {
    width: 100%;
  }
}

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

  .stat-card .stat-actions {
    justify-content: flex-start;
  }

  .list-row,
  .leader-row,
  .new-user-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .leader-rank,
  .leader-score {
    justify-self: start;
  }

  .server-specs-grid,
  .limits-grid,
  .guild-meta,
  .store-metrics,
  .store-products {
    grid-template-columns: 1fr;
  }

  .product-btn,
  .product-claim input,
  .friends-add input,
  .friend-send,
  .friend-send input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .service-btns,
  .service-tabs-row {
    grid-template-columns: 1fr;
  }

  .server-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .server-actions form,
  .server-actions form .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .server-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .bg-orb {
    display: none;
  }
}
