/*!
 * HyperDC UI — client area: app shell, auth layout, site content layout and client components.
 * Page-scoped additions go at the end under "/* page: <templatefile> *\/" (see docs/THEME.md §4).
 */

/* ==========================================================================
   1. Site layout content (guest pages, KB, announcements…)
   ========================================================================== */
.hdc-site-main { min-height: 50vh; }
.hdc-site-content { padding-block: clamp(1.5rem, 1rem + 2vw, 3rem) clamp(3rem, 2rem + 3vw, 5rem); }
.hdc-site-content.has-aside { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 992px) { .hdc-site-content.has-aside { grid-template-columns: 280px minmax(0, 1fr); } }
@media (max-width: 991.98px) { .hdc-site-content.has-aside > .hdc-site-aside { order: 1; } }
.hdc-site-primary { min-width: 0; }

/* ==========================================================================
   2. Client app shell
   ========================================================================== */
.hdc-layout-client { background: var(--hdc-bg-soft); }
.hdc-app { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .hdc-app { grid-template-columns: 264px minmax(0, 1fr); } }

.hdc-app__side {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 280px;
  max-width: 86vw;
  padding-top: env(safe-area-inset-top, 0px);
  border-inline-end: 1px solid var(--hdc-border);
  background: var(--hdc-surface);
  transform: translateX(-100%);
  transition: transform var(--hdc-dur-3) var(--hdc-ease);
}
[dir="rtl"] .hdc-app__side { transform: translateX(100%); }
.hdc-app.is-nav-open .hdc-app__side { transform: none; box-shadow: var(--hdc-shadow-lg); }
@media (min-width: 1100px) {
  .hdc-app__side { position: sticky; top: 0; height: 100vh; width: auto; max-width: none; transform: none !important; box-shadow: none !important; }
}
.hdc-app__scrim { position: fixed; inset: 0; z-index: 79; background: var(--hdc-overlay); }
@media (min-width: 1100px) { .hdc-app__scrim { display: none !important; } }

.hdc-app__brand { display: flex; align-items: center; height: var(--hdc-header-h); padding-inline: 1.25rem; border-bottom: 1px solid var(--hdc-border); }
.hdc-app__brand img { height: 27px; width: auto; }
.hdc-app__side-foot { display: grid; gap: .6rem; padding: 1rem; border-top: 1px solid var(--hdc-border); }
.hdc-app__status { display: inline-flex; align-items: center; gap: .55rem; color: var(--hdc-text-2) !important; font-size: var(--hdc-fs-xs); font-weight: 600; }

/* Collapse control and icon rail (≥1100px; html.hdc-nav-rail from includes/head.tpl + js/hdc-client.js) */
.hdc-app__collapse { display: none; }
.hdc-appnav__subhead { display: none; }
@media (min-width: 1100px) {
  .hdc-app__collapse {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 36px; padding: .35rem .65rem;
    border: 0; border-radius: var(--hdc-r-sm); background: transparent; color: var(--hdc-text-2);
    font: 550 var(--hdc-fs-xs)/1.2 var(--hdc-font-sans); text-align: start; cursor: pointer;
  }
  .hdc-app__collapse:hover { background: var(--hdc-bg-soft); color: var(--hdc-heading); }
  .hdc-app__collapse:focus-visible { outline: none; box-shadow: var(--hdc-focus-ring); }
  .hdc-app__collapse-icon { --hdc-i: 16px; flex: 0 0 auto; color: var(--hdc-text-3); }
  [dir="rtl"] .hdc-app__collapse-icon { transform: scaleX(-1); }

  .hdc-nav-rail .hdc-app:not(.hdc-app--topnav) { grid-template-columns: 72px minmax(0, 1fr); }
  .hdc-nav-rail .hdc-app__brand { justify-content: center; padding-inline: 0; }
  /* The logo's symbol is its first ~35px: crop to it (light and dark variants alike). */
  .hdc-nav-rail .hdc-app__brand img { width: 35px; height: 27px; object-fit: cover; object-position: 0 50%; }
  .hdc-nav-rail .hdc-appnav { padding: .75rem .55rem; }
  .hdc-nav-rail .hdc-appnav__link { position: relative; justify-content: center; gap: 0; padding: .5rem; min-height: 44px; }
  .hdc-nav-rail :is(.hdc-appnav__label, .hdc-app__foot-label) {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .hdc-nav-rail .hdc-appnav__chev { display: none; }
  .hdc-nav-rail .hdc-appnav__link > .hdc-appnav__badge {
    position: absolute; top: 3px; inset-inline-end: 5px; min-width: 17px; padding: 0 .25rem; font-size: 10px; line-height: 17px;
  }
  .hdc-nav-rail .hdc-appnav__link.is-current, .hdc-nav-rail .hdc-appnav__group.is-fly > .hdc-appnav__link { background: var(--hdc-primary-soft); }
  .hdc-nav-rail .hdc-appnav__link.is-current .hdc-i, .hdc-nav-rail .hdc-appnav__group.is-fly > .hdc-appnav__link .hdc-i { color: var(--hdc-primary); }
  /* Groups open as flyouts placed by js/hdc-client.js (fixed, so the scrolling rail does not clip them) */
  .hdc-nav-rail .hdc-appnav__group:not(.is-fly) > .hdc-appnav__sub { display: none; }
  .hdc-nav-rail .hdc-appnav__group.is-fly > .hdc-appnav__sub {
    position: fixed; top: var(--hdc-fly-y, 72px); inset-inline-start: var(--hdc-fly-x, 80px); z-index: 90;
    width: max-content; min-width: 220px; max-width: 320px; max-height: calc(100vh - var(--hdc-fly-y, 72px) - 12px); overflow-y: auto;
    margin: 0; padding: .35rem; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-md);
    background: var(--hdc-surface-raised); box-shadow: var(--hdc-shadow-lg);
  }
  .hdc-nav-rail .hdc-appnav__group.is-fly .hdc-appnav__subhead {
    display: block; padding: .5rem .7rem .35rem; color: var(--hdc-text-3);
    font: 600 var(--hdc-fs-2xs)/1.2 var(--hdc-font-mono); letter-spacing: var(--hdc-tracking-label); text-transform: uppercase;
  }
  .hdc-nav-rail .hdc-app__side-foot { justify-items: center; padding: .75rem .55rem; }
  .hdc-nav-rail .hdc-app__order { width: 44px; min-height: 40px; padding: 0; }
  .hdc-nav-rail .hdc-app__status { justify-content: center; width: 44px; min-height: 32px; }
  .hdc-nav-rail .hdc-app__collapse { justify-content: center; width: 44px; padding: .35rem 0; }
  .hdc-nav-rail .hdc-app__collapse-icon { transform: rotate(180deg); }
  .hdc-nav-rail[dir="rtl"] .hdc-app__collapse-icon, .hdc-nav-rail [dir="rtl"] .hdc-app__collapse-icon { transform: none; }
}
@media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
  .hdc-app { transition: grid-template-columns var(--hdc-dur-3) var(--hdc-ease); }
}
/* Rail tooltip (one element, created by js/hdc-client.js; the link text stays the accessible name) */
.hdc-tip {
  position: fixed; top: var(--hdc-tip-y, 0); inset-inline-start: var(--hdc-tip-x, 0); z-index: 95;
  max-width: 260px; padding: .35rem .6rem; border-radius: var(--hdc-r-sm);
  background: var(--hdc-heading); color: var(--hdc-surface); box-shadow: var(--hdc-shadow-md);
  font: 600 var(--hdc-fs-xs)/1.3 var(--hdc-font-sans); transform: translateY(-50%);
}
.hdc-tip[hidden] { display: none; }

.hdc-appnav { flex: 1 1 auto; overflow-y: auto; padding: .75rem; overscroll-behavior: contain; }
.hdc-appnav__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hdc-appnav__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 42px;
  padding: .5rem .75rem;
  border-radius: var(--hdc-r-sm);
  color: var(--hdc-text) !important;
  font-size: var(--hdc-fs-sm);
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--hdc-dur-1), color var(--hdc-dur-1);
}
.hdc-appnav__link::-webkit-details-marker { display: none; }
.hdc-appnav__link:hover { background: var(--hdc-bg-soft); color: var(--hdc-heading) !important; }
.hdc-appnav__link .hdc-i, .hdc-appnav__fa { --hdc-i: 19px; width: 19px; color: var(--hdc-text-3); text-align: center; transition: color var(--hdc-dur-1); }
.hdc-appnav__link:hover .hdc-i { color: var(--hdc-primary); }
.hdc-appnav__label { flex: 1 1 auto; min-width: 0; }
.hdc-appnav__chev { --hdc-i: 15px !important; transition: transform var(--hdc-dur-2) var(--hdc-ease); }
.hdc-appnav__group[open] > .hdc-appnav__link .hdc-appnav__chev { transform: rotate(180deg); }
.hdc-appnav__group[open] > .hdc-appnav__link { color: var(--hdc-heading) !important; }
.hdc-appnav__sub { display: grid; gap: 1px; margin: .15rem 0 .5rem; padding: 0 0 0 2.6rem; list-style: none; }
[dir="rtl"] .hdc-appnav__sub { padding: 0 2.6rem 0 0; }
.hdc-appnav__sublink { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; border-radius: var(--hdc-r-xs); color: var(--hdc-text-2) !important; font-size: var(--hdc-fs-sm); }
.hdc-appnav__sublink:hover { background: var(--hdc-bg-soft); color: var(--hdc-heading) !important; }
.hdc-appnav__sublink.is-active, .hdc-appnav__link.is-active { background: var(--hdc-primary-soft); color: var(--hdc-primary-text) !important; font-weight: 600; }
.hdc-appnav__link.is-active .hdc-i { color: var(--hdc-primary); }
.hdc-appnav__divider { height: 1px; margin: .35rem .7rem; background: var(--hdc-border); }
.hdc-appnav__badge { min-width: 20px; padding: 0 .4rem; border-radius: var(--hdc-r-pill); background: var(--hdc-primary); color: #fff; font-size: var(--hdc-fs-2xs); font-weight: 700; line-height: 20px; text-align: center; }

.hdc-app__body { display: flex; flex-direction: column; min-width: 0; }

.hdc-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--hdc-header-h);
  padding-inline: clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--hdc-border);
  background: color-mix(in srgb, var(--hdc-surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.hdc-topbar__burger { display: inline-grid; }
@media (min-width: 1100px) { .hdc-topbar__burger { display: none; } }
.hdc-topbar__search {
  position: relative;
  display: none;
  align-items: center;
  flex: 0 1 380px;
  color: var(--hdc-text-3);
}
@media (min-width: 768px) { .hdc-topbar__search { display: flex; } }
.hdc-topbar__search .hdc-i { position: absolute; inset-inline-start: .8rem; --hdc-i: 18px; pointer-events: none; }
.hdc-topbar__search-input {
  width: 100%;
  height: 40px;
  padding: 0 .9rem 0 2.4rem;
  border: 1px solid var(--hdc-border);
  border-radius: var(--hdc-r-pill);
  background: var(--hdc-bg-soft);
  color: var(--hdc-heading);
  font: 400 var(--hdc-fs-sm)/1 var(--hdc-font-sans);
  transition: border-color var(--hdc-dur-1), box-shadow var(--hdc-dur-1), background-color var(--hdc-dur-1);
}
[dir="rtl"] .hdc-topbar__search-input { padding: 0 2.4rem 0 .9rem; }
.hdc-topbar__search-input:focus { outline: none; border-color: var(--hdc-primary); background: var(--hdc-surface); box-shadow: var(--hdc-focus-ring); }
.hdc-topbar__actions { display: flex; align-items: center; gap: .3rem; margin-inline-start: auto; }

.hdc-account__btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  height: 40px;
  padding: 0 .55rem 0 .3rem;
  border: 1px solid var(--hdc-border);
  border-radius: var(--hdc-r-pill);
  background: var(--hdc-surface);
  color: var(--hdc-heading);
  font: 600 var(--hdc-fs-sm)/1 var(--hdc-font-sans);
  cursor: pointer;
}
.hdc-account__btn:hover { border-color: var(--hdc-border-strong); }
.hdc-account__btn .hdc-avatar { width: 30px; height: 30px; font-size: var(--hdc-fs-xs); }
.hdc-account__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hdc-notify__menu { width: min(360px, calc(100vw - 32px)); }
.hdc-notify__list { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.hdc-notify__item { display: flex; align-items: flex-start; gap: .7rem; padding: .65rem .7rem; border-radius: var(--hdc-r-sm); color: var(--hdc-text) !important; font-size: var(--hdc-fs-sm); line-height: 1.45; }
.hdc-notify__item:hover { background: var(--hdc-bg-soft); }
.hdc-notify__item .hdc-led { margin-top: .4rem; }
.hdc-notify__empty { padding: .9rem .7rem; color: var(--hdc-text-3); font-size: var(--hdc-fs-sm); }

.hdc-locale__menu { width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; }
.hdc-locale__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }

.hdc-app__main { flex: 1 0 auto; padding: clamp(1rem, .5rem + 2vw, 2rem); }
.hdc-app__content { width: 100%; max-width: 1360px; margin-inline: auto; }
.hdc-app__content.has-aside { display: grid; gap: 1.5rem; align-items: start; }
/* WHMCS sidebars form a slim context column at the inline end (header.tpl, C2): never a second navigation column
   next to the portal navigation. The column scrolls on its own when it is taller than the window. */
@media (min-width: 1200px) {
  .hdc-app__content.has-aside { grid-template-columns: minmax(0, 1fr) var(--hdc-aside-w, 256px); }
  .hdc-app__content.has-aside.hdc-aside-start { grid-template-columns: var(--hdc-aside-w, 256px) minmax(0, 1fr); }
  .hdc-app__aside {
    position: sticky; top: calc(var(--hdc-header-h) + 1.5rem);
    max-height: calc(100vh - var(--hdc-header-h) - 3rem); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; padding: 3px; margin: -3px; /* room for focus rings inside the scroll box */
  }
}
/* Single column: page content first, WHMCS sidebars after it (their actions/filters also live in our page content). */
@media (max-width: 1199.98px) { .hdc-app__content.has-aside > .hdc-app__aside { order: 1; } }
.hdc-app__primary { min-width: 0; }
.hdc-app__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.25rem clamp(1rem, 2vw, 2rem);
  border-top: 1px solid var(--hdc-border);
  color: var(--hdc-text-3);
  font-size: var(--hdc-fs-xs);
}
.hdc-app__footer a { color: var(--hdc-text-2) !important; }

/* Network status / verification banners */
.hdc-netbar { border-bottom: 1px solid var(--hdc-border); font-size: var(--hdc-fs-sm); }
.hdc-netbar--warning { background: var(--hdc-warning-soft); color: var(--hdc-warning-text); }
.hdc-netbar--info { background: var(--hdc-info-soft); color: var(--hdc-info-text); }
.hdc-netbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-block: .6rem; }
.hdc-netbar__inner a { margin-inline-start: auto; color: inherit !important; font-weight: 650; }
.hdc-verify { padding: .75rem clamp(1rem, 2vw, 2rem); border-bottom: 1px solid var(--hdc-border); background: var(--hdc-surface); }
.hdc-verify__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; max-width: 1360px; margin-inline: auto; font-size: var(--hdc-fs-sm); }
.hdc-verify__inner > .hdc-i { color: var(--hdc-warning); }
.hdc-verify__text { flex: 1 1 260px; color: var(--hdc-heading); font-weight: 500; }
.hdc-verify__close { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--hdc-r-sm); background: transparent; color: var(--hdc-text-3); cursor: pointer; }
.hdc-verify__close:hover { background: var(--hdc-bg-muted); color: var(--hdc-heading); }

/* ==========================================================================
   3. Auth layout (login, register, password reset, 2FA)
   ========================================================================== */
.hdc-auth { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .hdc-auth { grid-template-columns: minmax(380px, 40%) minmax(0, 1fr); } }
.hdc-auth__brand {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  overflow: hidden;
  isolation: isolate;
}
.hdc-auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 50% at 20% 0%, rgba(0, 113, 188, .35) 0%, transparent 70%),
    linear-gradient(rgba(120, 170, 230, .07) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, rgba(120, 170, 230, .07) 1px, transparent 1px) 0 0/48px 48px;
}
/* Sticky at viewport height so the pitch stays in view while long forms (registration) scroll. */
@media (min-width: 1024px) { .hdc-auth__brand { position: sticky; top: 0; align-self: start; display: flex; height: 100vh; height: 100dvh; overflow-y: auto; } }
.hdc-auth__brand .hdc-logo img { height: 30px; width: auto; }
.hdc-auth__headline { margin: 0 0 1.5rem; color: var(--hdc-heading); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.15; text-wrap: balance; }
.hdc-auth__main { display: flex; flex-direction: column; min-width: 0; background: var(--hdc-bg); }
.hdc-auth__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 2.5rem); }
.hdc-auth__mobile-logo img { height: 27px; width: auto; }
@media (min-width: 1024px) { .hdc-auth__mobile-logo { visibility: hidden; } }
.hdc-auth__content { flex: 1 0 auto; display: grid; align-content: center; justify-items: center; padding: 1rem clamp(1rem, 3vw, 2.5rem) 2rem; }
.hdc-auth__content > * { width: 100%; max-width: 460px; }
.hdc-auth__content > .hdc-auth-wide, .hdc-tpl-clientregister .hdc-auth__content > * { max-width: 760px; }
.hdc-auth__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; padding: 1.25rem; color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-auth__foot a { color: var(--hdc-text-2) !important; }

/* Auth card pattern used by login / reset / 2FA templates */
.hdc-auth-card { display: grid; gap: 1.25rem; }
.hdc-auth-card__head h1 { margin: 0 0 .35rem; font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); letter-spacing: -.025em; }
.hdc-auth-card__head p { margin: 0; color: var(--hdc-text-2); }
.hdc-auth-card__divider { display: flex; align-items: center; gap: .75rem; color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.hdc-auth-card__divider::before, .hdc-auth-card__divider::after { content: ""; flex: 1; height: 1px; background: var(--hdc-border); }
.hdc-auth-card__alt { color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); text-align: center; }

/* ==========================================================================
   4. Page head
   ========================================================================== */
.hdc-page-head { margin-bottom: 1.5rem; }
.hdc-page-head .hdc-breadcrumb { margin-bottom: .75rem; }
.hdc-page-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.hdc-page-head__text { min-width: 0; }
.hdc-page-head__title { display: flex; align-items: center; gap: .75rem; margin: 0; font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); letter-spacing: -.025em; }
.hdc-page-head__lead { margin: .4rem 0 0; color: var(--hdc-text-2); max-width: 70ch; }
.hdc-page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.hdc-layout-site .hdc-page-head { margin-bottom: 2rem; }
.hdc-layout-site .hdc-page-head__title { font-size: var(--hdc-fs-h1); letter-spacing: var(--hdc-tracking-display); }

/* ==========================================================================
   5. Sidebar cards (WHMCS $primarySidebar / $secondarySidebar)
   ========================================================================== */
.hdc-app__aside, .hdc-site-aside { display: grid; gap: 1rem; }
.hdc-side-card { overflow: hidden; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-lg); background: var(--hdc-surface); }
.hdc-side-card__head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; color: var(--hdc-heading); font-size: var(--hdc-fs-sm); font-weight: 650; cursor: pointer; list-style: none; }
.hdc-side-card__head::-webkit-details-marker { display: none; }
.hdc-side-card__title { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; min-width: 0; }
.hdc-side-card__title i { color: var(--hdc-text-3); }
.hdc-side-card__chev { --hdc-i: 15px; color: var(--hdc-text-3); transition: transform var(--hdc-dur-2) var(--hdc-ease); }
.hdc-side-card__details:not([open]) .hdc-side-card__chev { transform: rotate(-90deg); }
.hdc-side-card__body, .hdc-side-card__foot { padding: .85rem 1rem; border-top: 1px solid var(--hdc-border); font-size: var(--hdc-fs-sm); }
.hdc-side-card__list { display: grid; padding: .35rem; border-top: 1px solid var(--hdc-border); }
.hdc-side-card__link, .hdc-side-card__text { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--hdc-r-sm); color: var(--hdc-text) !important; font-size: var(--hdc-fs-sm); }
.hdc-side-card__link:hover { background: var(--hdc-bg-soft); color: var(--hdc-heading) !important; }
.hdc-side-card__link.is-active { background: var(--hdc-primary-soft); color: var(--hdc-primary-text) !important; font-weight: 600; }
.hdc-side-card__link.is-disabled { opacity: .5; pointer-events: none; }
.hdc-side-card__icon { position: relative; display: inline-grid; place-items: center; width: 20px; color: var(--hdc-text-3); }
.hdc-side-card__label { flex: 1 1 auto; min-width: 0; }
.hdc-side-card__text { color: var(--hdc-text-2) !important; }
/* Client portal context column: slimmer cards */
.hdc-app__aside { gap: .75rem; }
.hdc-app__aside .hdc-side-card__head { padding: .7rem .85rem; font-size: var(--hdc-fs-xs); letter-spacing: .01em; }
.hdc-app__aside .hdc-side-card__list { padding: .25rem; }
.hdc-app__aside :is(.hdc-side-card__link, .hdc-side-card__text) { gap: .5rem; padding: .45rem .55rem; font-size: var(--hdc-fs-xs); }
.hdc-app__aside :is(.hdc-side-card__body, .hdc-side-card__foot) { padding: .7rem .85rem; font-size: var(--hdc-fs-xs); }
/* MarketConnect promotion panels kept in the column (Studio presentation "sidebar"): compact, logo ≤ 40px */
.hdc-side-card--promo .hdc-side-card__body .text-center { text-align: start !important; } /* over hdc-compat's .hdc-module .text-center */
.hdc-side-card--promo .hdc-side-card__body a { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; color: var(--hdc-text-2) !important; font-weight: 400 !important; }
.hdc-side-card--promo .hdc-side-card__foot { display: flex; align-items: center; gap: .35rem; }
.hdc-side-card--promo .hdc-side-card__foot i { color: var(--hdc-text-3); }

/* ==========================================================================
   6. Client components
   ========================================================================== */
.hdc-empty { display: grid; justify-items: center; gap: .6rem; padding: clamp(2rem, 1.5rem + 2vw, 3.5rem) 1rem; text-align: center; }
.hdc-empty__title { margin: .5rem 0 0; font-size: var(--hdc-fs-lg); }
.hdc-empty__text { margin: 0; max-width: 46ch; color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); }

.hdc-status { text-transform: capitalize; }

/* Summary tiles (dashboard, service overview) */
.hdc-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.hdc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--hdc-border);
  border-radius: var(--hdc-r-lg);
  background: var(--hdc-surface);
  color: var(--hdc-text) !important;
  transition: border-color var(--hdc-dur-2), box-shadow var(--hdc-dur-2), transform var(--hdc-dur-2) var(--hdc-ease);
}
a.hdc-tile:hover { border-color: var(--hdc-border-strong); box-shadow: var(--hdc-shadow-md); transform: translateY(-2px); }
.hdc-tile__label { display: flex; align-items: center; gap: .5rem; color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); font-weight: 550; }
.hdc-tile__value { color: var(--hdc-heading); font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hdc-tile__meta { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-tile--attention { border-color: color-mix(in srgb, var(--hdc-warning) 45%, transparent); }
.hdc-tile--attention .hdc-tile__value { color: var(--hdc-warning-text); }
.hdc-tile--danger { border-color: color-mix(in srgb, var(--hdc-danger) 45%, transparent); }
.hdc-tile--danger .hdc-tile__value { color: var(--hdc-danger-text); }

/* Definition list (service/domain/invoice details) */
.hdc-dl { display: grid; gap: 0; margin: 0; }
.hdc-dl > div { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--hdc-border); }
.hdc-dl > div:last-child { border-bottom: 0; }
.hdc-dl dt { color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); font-weight: 500; }
.hdc-dl dd { margin: 0; min-width: 0; color: var(--hdc-heading); font-size: var(--hdc-fs-sm); font-weight: 550; overflow-wrap: anywhere; }
.hdc-dl dt { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .hdc-dl > div { grid-template-columns: minmax(0, 1fr); gap: .2rem; } }
/*
  Facts list for cards of any width (C2): in a container narrower than 22rem (side columns) every label sits above its
  value; wider, label and value share a row and the value wraps under the label (end-aligned) when both do not fit.
  Flex/grid items never overlap, whatever the length of a date or a payment method name.
*/
.hdc-dl--facts { container-type: inline-size; }
.hdc-dl.hdc-dl--facts > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 1rem; row-gap: .15rem; }
.hdc-dl--facts dt { flex: 1 1 auto; max-width: 100%; }
.hdc-dl--facts dd { flex: 0 1 auto; max-width: 100%; margin-inline-start: auto; text-align: end; }
@container (max-width: 22rem) {
  .hdc-dl.hdc-dl--facts > div { display: grid; grid-template-columns: minmax(0, 1fr); padding-block: .6rem; }
  .hdc-dl--facts dt { font-size: var(--hdc-fs-xs); }
  .hdc-dl--facts dd { margin-inline-start: 0; text-align: start; }
}

/* Table toolbar + pagination (js/hdc-client.js data-hdc-table) */
.hdc-table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.hdc-table-tools .hdc-input, .hdc-table-tools .hdc-select { width: auto; min-width: 200px; min-height: 40px; }
.hdc-table-wrap--flush { border: 0; border-radius: 0; }
.hdc-card > .hdc-table-wrap { border: 0; border-radius: 0 0 var(--hdc-r-lg) var(--hdc-r-lg); }
.hdc-table th[data-sort] { cursor: pointer; user-select: none; }
.hdc-table th[data-sort]::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: .4rem; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: .3; transform: translateY(-2px) rotate(45deg); }
.hdc-table th[aria-sort="ascending"]::after { opacity: 1; transform: translateY(2px) rotate(-135deg); }
.hdc-table th[aria-sort="descending"]::after { opacity: 1; }
.hdc-table tr[data-href] { cursor: pointer; }
.hdc-table .hdc-cell-main { color: var(--hdc-heading); font-weight: 600; }
.hdc-table .hdc-cell-sub { display: block; color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-top: 1px solid var(--hdc-border); color: var(--hdc-text-3); font-size: var(--hdc-fs-sm); }
.hdc-pagination__pages { display: flex; gap: .25rem; }
.hdc-pagination__btn { min-width: 34px; height: 34px; padding: 0 .55rem; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-sm); background: var(--hdc-surface); color: var(--hdc-text); font: 600 var(--hdc-fs-sm)/1 var(--hdc-font-sans); cursor: pointer; }
.hdc-pagination__btn:hover { border-color: var(--hdc-border-strong); }
.hdc-pagination__btn[aria-current="page"] { border-color: var(--hdc-primary); background: var(--hdc-primary); color: #fff; }
.hdc-pagination__btn:disabled { opacity: .45; cursor: default; }

/* Responsive tables: rows become cards under 720px when opted in */
@media (max-width: 719.98px) {
  .hdc-table--stack thead { display: none; }
  .hdc-table--stack, .hdc-table--stack tbody, .hdc-table--stack tr, .hdc-table--stack td { display: block; width: 100%; }
  .hdc-table--stack tr { padding: .75rem 1rem; border-bottom: 1px solid var(--hdc-border); }
  .hdc-table--stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: end; }
  .hdc-table--stack td::before { content: attr(data-label); color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); font-weight: 600; text-align: start; }
}

/* Two-column page body used by detail pages */
.hdc-cols { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1100px) { .hdc-cols--main-side { grid-template-columns: minmax(0, 1fr) 340px; } .hdc-cols--half { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hdc-stack-lg { display: grid; gap: 1.5rem; }

/* Chat-style ticket thread */
.hdc-thread { display: grid; gap: 1rem; }
.hdc-msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; }
.hdc-msg__bubble { padding: 1rem 1.15rem; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-lg); border-start-start-radius: var(--hdc-r-xs); background: var(--hdc-surface); }
.hdc-msg--staff .hdc-msg__bubble { border-color: color-mix(in srgb, var(--hdc-primary) 28%, transparent); background: color-mix(in srgb, var(--hdc-primary) 5%, var(--hdc-surface)); }
.hdc-msg__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .5rem; font-size: var(--hdc-fs-xs); color: var(--hdc-text-3); }
.hdc-msg__author { color: var(--hdc-heading); font-size: var(--hdc-fs-sm); font-weight: 650; }
.hdc-msg__attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

/* Password strength meter */
.hdc-pwmeter { display: grid; gap: .35rem; }
.hdc-pwmeter__bar { height: 6px; overflow: hidden; border-radius: var(--hdc-r-pill); background: var(--hdc-bg-muted); }
.hdc-pwmeter__fill { height: 100%; width: 0; border-radius: inherit; background: var(--hdc-danger); transition: width var(--hdc-dur-3) var(--hdc-ease), background-color var(--hdc-dur-3); }
.hdc-pwmeter[data-strength="medium"] .hdc-pwmeter__fill { background: var(--hdc-warning); }
.hdc-pwmeter[data-strength="strong"] .hdc-pwmeter__fill { background: var(--hdc-success); }
/* WHMCS's own scoring (PasswordStrength.js registerFormPasswordStrengthFeedback) sets Bootstrap 4 classes on the fill. */
.hdc-pwmeter__fill.bg-danger { background: var(--hdc-danger); }
.hdc-pwmeter__fill.bg-warning { background: var(--hdc-warning); }
.hdc-pwmeter__fill.bg-success { background: var(--hdc-success); }
.hdc-pwmeter__label { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }

/* Misc */
.hdc-admin-return { position: fixed; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; }
.hdc-flip-y { transform: rotate(180deg); }
.hdc-alert__body { min-width: 0; }
.hdc-alert__list { margin: .35rem 0 0; padding-inline-start: 1.1rem; }
.hdc-alert__title { display: block; margin-bottom: .2rem; }
.hdc-kv-inline { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); }
.hdc-kv-inline b { color: var(--hdc-heading); font-weight: 600; }
.hdc-drawer__locale { padding: 1rem .5rem 0; }

/* ==========================================================================
   7. Page-scoped styles (append below; keep each under its own heading)
   ========================================================================== */
