html, body { height: 100%; }
body { margin: 0; overflow: hidden; }

/* Guest: centered */
.guest-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  height: 100vh;
  overflow-y: auto;
}

/* Logged-in: left / right */
.app-shell {
  display: flex;
  height: 100%;
  overflow: hidden;
  --app-topbar-height: 3.75rem;
}
.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
.app-sidebar-brand,
.app-main-header {
  height: var(--app-topbar-height);
  min-height: var(--app-topbar-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-sidebar-brand {
  padding: 0 1.25rem;
}
.app-brand {
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.1;
}
.app-brand i {
  font-size: 1.5rem;
}
.guest-brand {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
}
.guest-brand i {
  font-size: 2rem;
}
.guest-auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#guestTabs {
  flex-wrap: wrap;
  gap: 0.15rem;
}
#guestTabs .nav-link {
  cursor: pointer;
}
.app-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
  overflow-y: auto;
}
.app-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.15rem;
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  cursor: pointer;
}
.app-sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.app-sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(32, 107, 196, 0.35);
}
.app-sidebar-nav .nav-link i {
  width: 1.4rem;
  font-size: 1.3rem;
  text-align: center;
  opacity: 0.9;
}
.app-sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.app-sidebar-foot .btn-logout {
  color: rgba(255, 255, 255, 0.42);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.app-sidebar-foot .btn-sidebar-action {
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.app-sidebar-foot .btn-sidebar-action:hover,
.app-sidebar-foot .btn-sidebar-action:focus,
.app-sidebar-foot .btn-logout:hover,
.app-sidebar-foot .btn-logout:focus {
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.04);
  border: 0;
  box-shadow: none;
}
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-main-header {
  justify-content: space-between;
  padding: 0 1.75rem;
}
.app-main-header #panelTitle {
  line-height: 1.1;
}
.app-main-body {
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1.75rem 2rem;
  overflow-y: auto;
}
.app-main-body .panel {
  max-width: 820px;
}
.user-app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.user-app .app-shell {
  flex: 1;
  min-height: 0;
}
.app-bottom-nav {
  display: none;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.92);
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
}
.app-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3.25rem;
  padding: 0.25rem 0.15rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.65rem;
  line-height: 1.1;
  cursor: pointer;
}
.app-bottom-nav-item i {
  font-size: 1.25rem;
}
.app-bottom-nav-item.active {
  color: #fff;
  background: rgba(32, 107, 196, 0.25);
}
.app-mobile-actions {
  display: none;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 991.98px) {
  .app-sidebar {
    display: none !important;
  }
  .app-bottom-nav {
    display: flex;
    position: relative;
    z-index: 1030;
  }
  .app-mobile-actions {
    display: flex;
  }
  .app-main-header {
    padding: 0 1rem;
  }
  .app-main-body {
    padding: 1rem 1rem 1.25rem;
  }
  .app-main-body .panel {
    max-width: none;
  }
  .guest-wrap {
    padding: 1.5rem 1.25rem 2rem;
  }
  .guest-auth-card {
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }
  #guestTabs .nav-link {
    font-size: 0.8rem;
    padding: 0.45rem 0.55rem;
  }
  .guide-os-option {
    flex: 1 1 100%;
  }
  #certTabs .nav-link {
    font-size: 0.8rem;
    padding: 0.45rem 0.55rem;
  }
}
#supportTabs .nav-link {
  cursor: pointer;
}
.scroll-x,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table-responsive > .table {
  margin-bottom: 0;
}
.guide-os-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.guide-os-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 7rem;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--tblr-border-radius, 0.375rem);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.guide-os-option:hover {
  border-color: rgba(255, 255, 255, 0.35);
}
.guide-os-option:has(.guide-os-radio:checked) {
  border-color: var(--tblr-primary, #206bc4);
}
.guide-os-radio {
  margin: 0;
  flex-shrink: 0;
  float: none;
}
.guide-os-text {
  display: flex;
  align-items: center;
}
.guide-step-label {
  margin-bottom: 1rem;
}
#supportBadge {
  color: #000;
}
#payOrdersList .badge {
  color: #000;
}
#guideServerList .form-check-input {
  margin: 0;
  float: none;
}
#guideServerList .server-status-progress {
  position: relative;
  width: 4rem;
  height: 1rem;
  margin: 0;
  background: rgba(255, 255, 255, 0.08);
}
#guideServerList .server-status-progress .progress-bar {
  height: 100%;
}
#guideServerList .server-status-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}
#guideServerList.table-responsive > .table {
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
}
.cert-install-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-align: left;
  background: #f76707;
  border-color: #f76707;
  color: #fff;
}
.cert-install-alert i {
  flex-shrink: 0;
  margin-top: 0.12rem;
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
}
.guide-intro-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-align: left;
  background: var(--tblr-primary) !important;
  background-image: none !important;
  border-color: var(--tblr-primary) !important;
  color: var(--tblr-primary-fg, #fff) !important;
}
.guide-intro-alert i {
  flex-shrink: 0;
  margin-top: 0.12rem;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--tblr-primary-fg, #fff);
}
.cert-install-note {
  display: block !important;
  text-align: left;
}
.cert-install-note::before,
.cert-install-note::after {
  display: none !important;
  content: none !important;
}
.cert-install-note .cert-install-note-title {
  font-weight: 600;
  margin: 1.25rem 0 0.35rem;
}
.cert-install-note .cert-install-note-body {
  margin: 0;
  line-height: 1.6;
}
.cert-download-btn {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2rem auto 2rem;
  color: #000;
}
.cert-download-btn i {
  color: #000;
}
#certTabs {
  flex-wrap: wrap;
  gap: 0.15rem;
}
#certTabs .nav-link {
  cursor: pointer;
}
.cert-steps {
  padding-left: 1.25rem;
  margin-bottom: 0;
}
.cert-steps li + li {
  margin-top: 0.5rem;
}
.cert-guide-title {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 1.5rem;
}
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}
.app-confirm-dialog {
  width: 100%;
  max-width: 24rem;
  padding: 1.25rem;
  border-radius: 0.5rem;
  background: var(--tblr-bg-surface, #1f2937);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.35);
}
.app-confirm-dialog .app-confirm-title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.app-confirm-dialog .app-confirm-body {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.72);
}
.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.cert-guide-carousel {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.cert-guide-carousel-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #1a1d21;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cert-guide-carousel-slide {
  display: none;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  vertical-align: middle;
}
.cert-guide-carousel-slide.active {
  display: block;
}
.cert-guide-carousel-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.cert-guide-step {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cert-guide-step:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.cert-guide-step.active {
  background: var(--tblr-primary, #206bc4);
  border-color: var(--tblr-primary, #206bc4);
  color: #fff;
}
