:root {
  --ds-bg: #050a1f;
  --ds-bg-surface: #0c1330;
  --ds-card: #111a3e;
  --ds-text: #e8edff;
  --ds-muted: #9ea9cf;
  --ds-primary: #4f72ff;
  --ds-primary-strong: #3b5deb;
  --ds-border: rgba(146, 170, 255, 0.22);
}

html,
body,
body.primary-bg-color,
body.whmcs-clientarea {
  background: radial-gradient(1200px 480px at 15% -10%, rgba(79,114,255,0.22), transparent 62%), var(--ds-bg);
  color: var(--ds-text);
  font-size: 15px;
  line-height: 1.45;
}

/* Force dark backgrounds on common Twenty-One wrappers */
#main-body,
#main-body .container,
.main-content,
.primary-content,
.content,
.client-home-panels {
  background: transparent !important;
  color: var(--ds-text) !important;
}

/* Keep headings readable against the dark canvas */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.section-title,
.lead,
p,
label,
li,
small,
span {
  color: var(--ds-text);
}

/* Hide WHMCS native chrome when using custom Divergent header/footer snippets */
#header,
#main-menu,
.header-lined,
.top-nav,
.navbar-main,
.navbar-secondary,
.main-navbar,
.main-menu,
.section-secondary,
.breadcrumb,
#footer,
.footer,
.footer-bar,
.main-footer,
.powered-by,
.copyright,
.social,
.language,
.network-status {
  display: none !important;
}

/* Reduce spacing left by removed native header areas */
#main-body,
.main-content {
  margin-top: 0 !important;
  padding-top: 18px !important;
}

.ds-container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.ds-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(5, 10, 31, 0.85);
  border-bottom: 1px solid var(--ds-border);
}

.ds-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 78px;
}

.ds-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  color: var(--ds-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.ds-logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.ds-logo-fallback {
  display: none;
}

.ds-logo-fallback span {
  color: var(--ds-primary);
}

.ds-logo span {
  color: var(--ds-primary);
}

.ds-nav {
  display: flex;
  gap: 1.05rem;
  flex-wrap: wrap;
}

.ds-nav a {
  color: var(--ds-muted);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1;
}

.ds-nav a:hover {
  color: var(--ds-text);
}

.ds-actions {
  margin-left: auto;
  display: flex;
  gap: 0.55rem;
}

.ds-btn {
  text-decoration: none;
  border-radius: 11px;
  padding: 0.56rem 0.9rem;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.ds-btn-ghost {
  color: var(--ds-text);
  background: rgba(255,255,255,0.04);
  border-color: var(--ds-border);
}

.ds-btn-outline {
  color: #c8d8ff;
  border-color: #6285ff;
  background: transparent;
}

.ds-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--ds-primary), var(--ds-primary-strong));
}

/* Safe WHMCS skin: avoid overriding global layout wrappers */
.panel,
.card,
.client-home-panels .panel,
.tile,
.tile .icon,
.tile-body,
.home-banner,
.home-banner .card,
.home-banner .panel,
.client-home-panels .card,
.client-home-panels .card-body,
.client-home-panels .item,
.feature-box,
.feature-box .feature-icon,
.list-group-item,
.list-group-item-action,
.bg-light,
.bg-white,
.domain-checker-container,
.domain-checker-bg,
.search-box,
.product,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.form-control,
.form-control:focus,
.input-group-text,
.dropdown-menu,
.modal-content {
  background-color: var(--ds-card);
  border-color: var(--ds-border);
  color: var(--ds-text);
}

/* WHMCS homepage quick-nav tiles */
.client-home-panels .card,
.client-home-panels .panel,
.tile,
.tile-body,
.feature-box,
.list-group-item,
.list-group-item-action {
  box-shadow: none !important;
  background: var(--ds-card) !important;
  border: 1px solid var(--ds-border) !important;
}

/* Extra WHMCS homepage tile overrides (Twenty-One variations) */
#main-body .client-home-panels .card,
#main-body .client-home-panels .panel,
#main-body .client-home-panels .panel-body,
#main-body .client-home-panels .card-body,
#main-body .client-home-panels .list-group,
#main-body .client-home-panels .list-group-item,
#main-body .client-home-panels .shortcut-tile,
#main-body .client-home-panels .item,
#main-body .client-home-panels a.list-group-item,
#main-body .client-home-panels a.btn,
#main-body .client-home-panels [class*="bg-white"],
#main-body .client-home-panels [class*="bg-light"] {
  background: var(--ds-card) !important;
  border-color: var(--ds-border) !important;
  color: var(--ds-text) !important;
}

#main-body .client-home-panels .list-group-item:hover,
#main-body .client-home-panels .card:hover,
#main-body .client-home-panels .panel:hover {
  border-color: rgba(120, 154, 255, 0.45) !important;
  background: #182451 !important;
}

#main-body .client-home-panels .list-group-item i,
#main-body .client-home-panels .card i,
#main-body .client-home-panels .panel i {
  color: #a9c2f3 !important;
}

/* Final hard override for persistent white homepage nav boxes */
#main-body .client-home-panels .panel,
#main-body .client-home-panels .panel-default,
#main-body .client-home-panels .panel-heading,
#main-body .client-home-panels .panel-body,
#main-body .client-home-panels .panel-footer,
#main-body .client-home-panels .card,
#main-body .client-home-panels .card-header,
#main-body .client-home-panels .card-body,
#main-body .client-home-panels .card-footer,
#main-body .client-home-panels .list-group,
#main-body .client-home-panels .list-group-item,
#main-body .client-home-panels a.list-group-item,
#main-body .client-home-panels .list-group-item-action,
#main-body .client-home-panels .btn,
#main-body .client-home-panels .btn-default,
#main-body .client-home-panels .btn-sm,
#main-body .client-home-panels .tile,
#main-body .client-home-panels .tile-body,
#main-body .client-home-panels .shortcut-tile,
#main-body .client-home-panels .feature-box {
  background: var(--ds-card) !important;
  background-color: var(--ds-card) !important;
  background-image: none !important;
  color: var(--ds-text) !important;
  border-color: var(--ds-border) !important;
}

#main-body .client-home-panels .list-group-item *,
#main-body .client-home-panels .panel *,
#main-body .client-home-panels .card *,
#main-body .client-home-panels .tile *,
#main-body .client-home-panels .feature-box * {
  color: var(--ds-text) !important;
}

#main-body .client-home-panels i,
#main-body .client-home-panels .fas,
#main-body .client-home-panels .far,
#main-body .client-home-panels .fal,
#main-body .client-home-panels .fab,
#main-body .client-home-panels svg {
  color: #a9c2f3 !important;
  fill: #a9c2f3 !important;
  opacity: 1 !important;
}

/* Absolute fallback for Twenty-One homepage panels/cards regardless of wrapper */
#main-body .panel,
#main-body .panel-default,
#main-body .panel-accent,
#main-body [class*="panel-accent-"],
#main-body .panel-heading,
#main-body .panel-title,
#main-body .panel-body,
#main-body .panel-footer,
#main-body .card,
#main-body .card-header,
#main-body .card-body,
#main-body .card-footer,
#main-body .list-group,
#main-body .list-group-item,
#main-body a.list-group-item,
#main-body .feature,
#main-body .feature-box,
#main-body .shortcut-tile,
#main-body .tile,
#main-body .tile-body,
#main-body .bg-light,
#main-body .bg-white {
  background: #111a3e !important;
  background-color: #111a3e !important;
  background-image: none !important;
  color: #e8edff !important;
  border-color: rgba(146, 170, 255, 0.22) !important;
}

#main-body .panel a,
#main-body .card a,
#main-body .list-group-item a,
#main-body .feature-box a,
#main-body .tile a {
  color: #c7d9ff !important;
}

/* Direct fix for homepage feature boxes that use ico-container */
#main-body .ico-container,
#main-body .ico-container i,
#main-body .feature,
#main-body .feature .feature-title,
#main-body .feature .feature-desc,
#main-body .feature .feature-link,
#main-body .feature .ico-container {
  color: #a9c2f3 !important;
  background: transparent !important;
  border-color: transparent !important;
}

#main-body .feature,
#main-body .feature-box,
#main-body .panel.panel-accent,
#main-body [class*="panel-accent-"] {
  background: #111a3e !important;
  background-color: #111a3e !important;
  background-image: none !important;
  border: 1px solid rgba(146, 170, 255, 0.22) !important;
}

/* Exact override for homepage action icon boxes */
#main-body .action-icon-btns a,
.action-icon-btns a {
  color: #e8edff !important;
  background: #111a3e !important;
  background-color: #111a3e !important;
  background-image: none !important;
  border: 1px solid rgba(146, 170, 255, 0.22) !important;
  border-radius: 0.5rem !important;
  text-decoration: none !important;
}

#main-body .action-icon-btns a:hover,
.action-icon-btns a:hover {
  background: #182451 !important;
  border-color: rgba(120, 154, 255, 0.45) !important;
}

#main-body .action-icon-btns a i,
#main-body .action-icon-btns a span,
#main-body .action-icon-btns a p,
.action-icon-btns a i,
.action-icon-btns a span,
.action-icon-btns a p {
  color: #a9c2f3 !important;
}

.client-home-panels .card * ,
.tile *,
.feature-box *,
.list-group-item * {
  color: var(--ds-text) !important;
}

.tile .icon,
.feature-box .feature-icon,
.client-home-panels i,
.list-group-item i {
  color: #9fb8ef !important;
  opacity: 1 !important;
}

.table,
.table th,
.table td,
.list-group-item,
.domain-pricing table {
  border-color: var(--ds-border);
}

.text-muted,
.small,
.help-block,
.description {
  color: var(--ds-muted) !important;
}

a {
  color: #9fbcff;
}

a:hover,
a:focus {
  color: #c0d4ff;
}

.btn-primary,
.btn-success,
.btn-info {
  background: linear-gradient(180deg, var(--ds-primary), var(--ds-primary-strong));
  border-color: transparent;
}

.btn-default,
.btn-secondary {
  background: rgba(255,255,255,0.03);
  border-color: var(--ds-border);
  color: var(--ds-text);
}

.ds-footer {
  border-top: 1px solid var(--ds-border);
  margin-top: 2rem;
  padding: 2rem 0 1.25rem;
  background: rgba(7, 11, 30, 0.7);
}

.ds-footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 1.25rem;
}

.ds-footer h4 {
  margin: 0 0 0.65rem;
}

.ds-footer p,
.ds-footer li,
.ds-footer a {
  color: var(--ds-muted);
  font-size: 0.92rem;
}

.ds-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.ds-footer a {
  text-decoration: none;
}

.ds-footer a:hover {
  color: var(--ds-text);
}

.ds-footer-bottom {
  border-top: 1px solid var(--ds-border);
  margin-top: 1.1rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ds-footer-bottom div {
  display: flex;
  gap: 1rem;
}

@media (max-width: 980px) {
  .ds-nav {
    display: none;
  }

  .ds-footer-grid {
    grid-template-columns: 1fr;
  }
}
