/* GENERATED by tools/build-portal-css-bundle.sh — do not edit; edit the source files and rebuild. */

/* ==== portal.css ==== */
/* ==========================================================================
   HiTechCloud portal — design layer
   Loaded LAST, after Bootstrap 4 (combined.min.css) and the legacy theme CSS.
   Flat style: grey page, white surfaces, 1px hairline borders, no card shadows.
   Hierarchy by size and weight, one accent colour.

   ĐỔI THƯƠNG HIỆU
   - Màu nhấn: --primary / --primary-hover ở :root (nền sáng) và html.darkmode (nền tối).
   - Màu logo / biểu đồ: --brand.
   - Font: --app-font (một dòng) + thẻ <link> Google Fonts trong header.shared.tpl.
   ========================================================================== */

:root {
  color-scheme: light;
  --app-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Token system v2 (2026-10-30): same palette as hitechcloud.vn /account + /iam (auth app globals.css).
     IAM name -> portal token:  --ink = --foreground · --ink-soft = --muted · --brand = --primary · --brand-strong = --primary-strong
     --brand-soft = --primary-light · --card = --surface · --input-border = --border-strong · --danger/--success/--warning kept. */
  --brand: #0969ff;
  --cyan: #00a8ff;                /* only inside gradients / illustration accents */
  --navy: #071832;
  --primary: #0969ff;             /* white text on it: 4.7:1 */
  --primary-hover: #0753cc;
  --primary-foreground: #ffffff;
  --primary-light: rgba(9, 105, 255, 0.08);
  --primary-strong: #0753cc;      /* primary text on --primary-light: 6.9:1 */

  --background: #f6f8fc;
  --surface: #ffffff;
  --surface-overlay: #ffffff;
  --surface-tint: #fafbfe;        /* card heads / table heads: one step off the card white */
  --foreground: #0b1730;
  --muted: #5a6478;
  --muted-strong: #475169;        /* muted on --secondary tracks */
  --border: #e4e8ef;
  --border-strong: #d3dae5;
  --tab-rail: color-mix(in srgb, var(--foreground) 10%, transparent);
  --item-hover: #f0f4fb;
  --secondary: #e8eef8;
  --secondary-hover: #dce5f4;
  --surface-hover: #f4f7fd;        /* rows / cards on white */
  --button-hover: #e6ecf6;
  --ring-focus: rgba(9, 105, 255, 0.22);
  --border-focus: var(--primary);
  --elevation-popover: 0 10px 15px -3px rgb(11 23 48 / 0.10), 0 4px 6px -4px rgb(11 23 48 / 0.10);
  --elevation-modal: 0 20px 25px -5px rgb(11 23 48 / 0.12), 0 8px 10px -6px rgb(11 23 48 / 0.12);

  --danger: #dc2626;
  --danger-bg: rgb(220 38 38 / 0.08);
  --danger-bg-hover: rgb(220 38 38 / 0.14);
  --error: #dc2626;
  --error-text: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-strong: #b91c1c;
  --success-bg: #ecfdf3;
  --success: #15803d;
  --warning-bg: #fffbeb;
  --warning: #b45309;
  --warning-border: #fde68a;
  --info-bg: #eaf2ff;
  --info: #0753cc;
  --info-border: #c3d9ff;
  --neutral-bg: #eef1f6;
  --neutral: #4b5568;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-card: 16px;            /* cards, tables, stat block (IAM rounded-2xl) */
  --sidebar-w: 256px;
  --sidebar-rail: 64px;
  --topbar-h: 64px;
}

html.darkmode {
  color-scheme: dark;
  --brand: #4f93ff;
  --primary: #4f93ff;
  --primary-hover: #6ba6ff;
  --primary-foreground: #05060f;
  --primary-light: rgba(79, 147, 255, 0.14);
  --primary-strong: #6ba6ff;

  --background: #070e1c;
  --surface: #0d1627;
  --surface-overlay: #131e34;
  --surface-tint: #0f192d;
  --foreground: #eef2f8;
  --muted: #97a3b8;
  --muted-strong: #adb8cb;
  --border: #1d293f;
  --border-strong: #27344d;
  --item-hover: rgb(255 255 255 / 0.05);
  --secondary: rgb(255 255 255 / 0.08);
  --secondary-hover: rgb(255 255 255 / 0.13);
  --surface-hover: #121d32;
  --button-hover: rgb(255 255 255 / 0.08);
  --ring-focus: rgba(79, 147, 255, 0.28);
  --border-focus: rgba(79, 147, 255, 0.7);
  --elevation-popover: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --elevation-modal: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);

  --danger: #f87171;
  --danger-bg: rgb(248 113 113 / 0.12);
  --danger-bg-hover: rgb(248 113 113 / 0.2);
  --error-text: #f87171;
  --error-bg: rgb(248 113 113 / 0.1);
  --error-border: rgb(248 113 113 / 0.3);
  --error-strong: #f87171;
  --success-bg: rgb(52 211 153 / 0.13);
  --success: #34d399;
  --warning-bg: rgb(251 191 36 / 0.13);
  --warning: #fbbf24;
  --warning-border: rgb(251 191 36 / 0.3);
  --info-bg: rgb(79 147 255 / 0.12);
  --info: #8ab8ff;
  --info-border: rgb(79 147 255 / 0.3);
  --neutral-bg: rgb(151 163 184 / 0.14);
  --neutral: #adb8cb;
}

/* ---------- Base ------------------------------------------------------- */

html, body { background: var(--background) !important; }
/* 2026-12-04 (hostbill-header-zalopay-20261204): the base theme (combined/custom.min.css) sets html,body{height:100%}
   + body{display:flex;flex-direction:column}. That froze body — and with it .cm-app/.cm-main — at exactly one viewport
   height; page content overflowed past .cm-main, so the sticky .cm-topbar (contained by .cm-main) scrolled off-screen
   after ~1 screen. Let body grow with its content. Rollback: delete this rule + rebuild the bundle. */
body.cm-shell { height: auto; min-height: 100%; }
body {
  font-family: var(--app-font) !important;
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body .h1, body .h2, body .h3, body .h4, body .h5, body .h6,
body h1, body h2, body h3, body h4, body h5, body h6 {
  font-family: var(--app-font);
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
body h1, body .h1 { font-size: 20px; line-height: 1.4; }
body h2, body .h2 { font-size: 18px; line-height: 1.4; }
body h3, body .h3 { font-size: 16px; line-height: 1.45; }
body h4, body .h4, body h5, body .h5, body h6, body .h6 { font-size: 14px; line-height: 1.5; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--error-text) !important; }
.text-warning { color: var(--warning) !important; }
hr { border-color: var(--border); }
code, kbd, pre, .cm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cm-mono { font-size: 13px; font-variant-numeric: tabular-nums; }
.cm-num { font-variant-numeric: tabular-nums; }
::selection { background: var(--primary-light); }

/* Scrollbars: transparent at rest, visible on hover (I18). */
* { --scrollbar-thumb: transparent; }
*:hover { --scrollbar-thumb: color-mix(in srgb, var(--foreground) 16%, transparent); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--foreground) 40%, transparent); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  *:hover { scrollbar-color: color-mix(in srgb, var(--foreground) 18%, transparent) transparent; }
}
.scrollbar-clean { scrollbar-width: none; }
.scrollbar-clean::-webkit-scrollbar { display: none; }

/* Icons (Lucide sprite). */
.cm-i { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cm-i--sm { width: 14px; height: 14px; }
.cm-i--lg { width: 20px; height: 20px; }
.material-icons { font-size: 18px; vertical-align: middle; }

.pageloader-wrapper { display: none !important; }
.sr-only-focusable:focus { position: static; }

/* ---------- App shell -------------------------------------------------- */

.cm-app { display: flex; min-height: 100vh; }

.cm-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  transition: width .2s ease-out;
}
.cm-sidebar__head {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.cm-logo { display: flex; align-items: center; min-width: 0; height: 40px; }
.cm-logo img { height: 32px; width: auto; max-width: 168px; object-fit: contain; }
.cm-logo .cm-logo__dark { display: none; }
html.darkmode .cm-logo .cm-logo__light { display: none; }
html.darkmode .cm-logo .cm-logo__dark { display: block; }

.cm-sidebar__nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 12px;
  display: flex; flex-direction: column;
}
.cm-nav-group + .cm-nav-group { margin-top: 16px; }
/* A closed group is just its heading: keep the next heading close (the icon rail keeps its 16px separators). */
.cm-nav-group:has(> .cm-nav-collapse.is-closed) + .cm-nav-group { margin-top: 4px; }
@media (min-width: 993px) { body.sidenav-toggled .cm-nav-group:has(> .cm-nav-collapse) + .cm-nav-group { margin-top: 16px; } }
.cm-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cm-nav-label {
  display: flex; align-items: center; width: 100%; height: 40px;
  padding: 0 12px; border: 0; border-radius: var(--radius);
  background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; text-align: left;
}
.cm-nav-label:hover { background: var(--item-hover); color: var(--foreground); }
.cm-nav-label:focus { outline: none; }
.cm-nav-label .cm-chevron { margin-left: auto; transition: transform .2s ease-out; }
/* Count in a group heading (Services total): right-aligned, the chevron follows it. */
.cm-nav-label__count { margin-left: auto; padding: 0 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-nav-label__count + .cm-chevron { margin-left: 8px; }
.cm-nav-label[aria-expanded="false"] .cm-chevron { transform: rotate(-90deg); }
.cm-nav-label .cm-nav-dash { display: none; }
.cm-nav-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease-out; }
.cm-nav-collapse > .cm-nav-list { min-height: 0; overflow: hidden; }
.cm-nav-collapse.is-closed { grid-template-rows: 0fr; }

.cm-nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 40px; width: 100%; padding: 0 12px;
  border-radius: var(--radius);
  font-size: 14px; color: color-mix(in srgb, var(--foreground) 72%, transparent) !important;
  white-space: nowrap; text-decoration: none !important;
  scroll-margin-block: 32px;
}
.cm-nav-link:hover { background: var(--item-hover); color: var(--foreground) !important; }
.cm-nav-link.is-active, .cm-nav-link.active {
  background: var(--secondary); color: var(--foreground) !important; font-weight: 500;
}
.cm-nav-sub-toggle .cm-chevron { margin-left: auto; transition: transform .2s ease-out; color: var(--muted); }
.cm-nav-sub-toggle[aria-expanded="false"] .cm-chevron { transform: rotate(-90deg); }
.cm-nav-sub > .cm-nav-list { padding-top: 4px; }
.cm-nav-sub .cm-nav-link { padding-left: 38px; }
.cm-nav-sub .cm-nav-link .cm-i { display: none; }
/* Order menu (menus/menu.left.order-list.tpl): a parent inside a sub-list keeps its chevron; its children step in once more. */
.cm-nav-sub .cm-nav-sub-toggle .cm-chevron { display: inline-block; }
.cm-nav-sub .cm-nav-sub .cm-nav-link { padding-left: 54px; }
/* Long order names ("Pay as You Go VPS USA (San Jose)") wrap in the drawer instead of losing their ending. */
.cm-nav-order .cm-nav-link, .cm-nav-order-list .cm-nav-sub .cm-nav-link { height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; white-space: normal; }
/* Mobile drawer: no "Tài khoản" group, the topbar account menu is the entry point there. */
@media (max-width: 992.98px) { .cm-nav-account { display: none; } }
/* Sidebar order list (theme menu config, signed in or not) is for the drawer only; from 993px the topbar order menus cover it. */
@media (min-width: 993px) { html body .cm-sidebar .cm-nav-order--drawer, html body .cm-sidebar .cm-nav-order, html body .cm-sidebar .cm-nav-group:has(> .cm-nav-list > .cm-nav-order-list:only-child) { display: none; } html body .cm-sidebar .cm-nav-order-list { display: none; } }
.cm-nav-link__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.cm-nav-count { flex-shrink: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; transition: opacity .15s; }
.cm-nav-link.is-active .cm-nav-count { color: var(--foreground); }
.cm-nav-dot { position: absolute; left: 24px; top: 8px; width: 6px; height: 6px; border-radius: 9999px; background: color-mix(in srgb, var(--foreground) 50%, transparent); opacity: 0; transition: opacity .15s; }
.cm-nav-empty { padding: 8px 12px; font-size: 13px; color: var(--muted); white-space: normal; }

.cm-avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary-strong);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
}

/* ---------- Account menu (components/account-menu.tpl) ----------
   Avatar + first name at the right end of the topbar. Panel: name/email, two balanced columns, balance and debt
   with their two actions, logout. <768px: a sheet under the topbar, still two columns. Enters with fade + 4px drop. */
.cm-acct { position: relative; flex-shrink: 0; }
.cm-acct__btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 2px; border: 0; border-radius: 9999px; background: transparent; color: var(--foreground); cursor: pointer; }
.cm-acct__btn:hover, .cm-acct.show .cm-acct__btn { background: var(--item-hover); }
.cm-acct__btn:focus { outline: none; }
.cm-acct__btn:focus-visible { box-shadow: 0 0 0 2px var(--ring-focus); }
.cm-acct__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.cm-acct__chevron { color: var(--muted); transition: transform .2s ease-out; }
.cm-acct.show .cm-acct__chevron { transform: rotate(180deg); }
@media (max-width: 1439.98px) { .cm-acct__name, .cm-acct__chevron { display: none; } .cm-acct__btn { padding: 0 2px; } }

html body .cm-app .cm-acct-menu.dropdown-menu { width: min(440px, calc(100vw - 32px)); padding: 0; margin-top: 8px; overflow: hidden; transform-origin: top right; }
html body .cm-app .cm-acct-menu.dropdown-menu.show { opacity: 1; transform: none; transition: opacity .15s ease-out, transform .15s ease-out; }
@starting-style { html body .cm-app .cm-acct-menu.dropdown-menu.show { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { html body .cm-app .cm-acct-menu.dropdown-menu.show { transition: opacity .15s; transform: none; } }
.cm-acct-menu__head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.cm-acct-menu__name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Email: the part before @ shrinks, the domain stays (two accounts often differ only by domain). */
.cm-acct-menu__email { display: flex; min-width: 0; font-size: 12px; color: var(--muted); }
.cm-acct-menu__local { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-acct-menu__domain { flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Two equal columns everywhere: the lists, the two money figures, the two money actions. */
.cm-acct-menu__grid, .cm-acct-menu__money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 4px; padding: 6px; }
.cm-acct-menu__col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-acct-menu__title { margin: 0; padding: 6px 10px 4px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cm-acct-menu__item { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; line-height: 1.3; color: var(--foreground) !important; text-decoration: none !important; }
.cm-acct-menu__item .cm-i { flex-shrink: 0; color: var(--muted); }
.cm-acct-menu__item:hover, .cm-acct-menu__item:focus-visible { background: var(--item-hover); outline: none; }
.cm-acct-menu__item:hover .cm-i { color: var(--foreground); }
.cm-acct-menu__tag { margin-left: auto; padding: 1px 6px; border-radius: 9999px; background: var(--success-bg); color: var(--success); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-acct-menu__money { border-top: 1px solid var(--border); }
.cm-acct-menu__stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 4px 10px 6px; }
.cm-acct-menu__stat-label { font-size: 12px; color: var(--muted); }
.cm-acct-menu__stat-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-acct-menu__stat-value.is-credit { color: var(--success); }
.cm-acct-menu__stat-value.is-debt { color: var(--danger); }
/* Money actions and logout are buttons: solid blue, soft blue, solid red. */
.cm-acct-menu__btn { justify-content: center; min-height: 34px; font-weight: 500; }
.cm-acct-menu__btn .cm-i { color: inherit !important; }
.cm-acct-menu__btn--primary { background: var(--primary); color: var(--primary-foreground) !important; }
.cm-acct-menu__btn--primary:hover, .cm-acct-menu__btn--primary:focus-visible { background: var(--primary-hover); }
.cm-acct-menu__btn--soft { background: var(--primary-light); color: var(--primary-strong) !important; }
.cm-acct-menu__btn--soft:hover, .cm-acct-menu__btn--soft:focus-visible { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.cm-acct-menu__btn--danger { background: var(--danger); color: #fff !important; }
.cm-acct-menu__btn--danger:hover, .cm-acct-menu__btn--danger:focus-visible { background: color-mix(in srgb, var(--danger) 88%, #000); }
/* Dark --danger (#ff637e) is too light for white text: keep the light-theme red here. */
html.darkmode .cm-acct-menu__btn--danger { background: #c70036; }
html.darkmode .cm-acct-menu__btn--danger:hover, html.darkmode .cm-acct-menu__btn--danger:focus-visible { background: #a8002d; }
.cm-acct-menu__foot { padding: 6px; border-top: 1px solid var(--border); }

/* Phones / small tablets: a sheet under the topbar; two columns kept, 44px rows. */
@media (max-width: 767.98px) {
  html body .cm-app .cm-acct-menu.dropdown-menu { position: fixed; top: calc(var(--topbar-h) - 4px); left: 8px; right: 8px; width: auto; max-height: calc(100dvh - var(--topbar-h) - 8px); overflow-y: auto; overscroll-behavior: contain; }
  .cm-acct-menu__item { min-height: 44px; gap: 8px; padding: 0 8px; font-size: 13px; }
  .cm-acct-menu__title { padding: 8px 8px 4px; }
  .cm-acct-menu__stat { padding: 6px 8px 8px; }
}

.cm-main {
  flex: 1 1 auto; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left .2s ease-out;
}
.cm-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 24px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cm-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.cm-search { position: relative; width: 280px; }
.cm-search .cm-i { z-index: 1; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cm-search input {
  width: 100%; height: 36px; padding: 0 56px 0 36px; text-overflow: ellipsis;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--foreground); font-size: 14px;
}
.cm-search input::placeholder { color: var(--muted); }
.cm-search input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--ring-focus); }
/* Shortcut hint: system font (the mono stack has no ⌘), label set per platform by portal.js. */
.cm-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 2px 6px; border-radius: 6px; background: var(--item-hover); color: var(--muted); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 11px; font-weight: 500; line-height: 1.3; white-space: nowrap; box-shadow: none; pointer-events: none; }
.cm-search .search-results, .cm-search .dropdown-menu { width: 100%; }

.cm-iconbtn {
  position: relative; width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: color-mix(in srgb, var(--foreground) 72%, transparent) !important; cursor: pointer;
}
.cm-iconbtn:hover { background: var(--item-hover); color: var(--foreground) !important; }
.cm-iconbtn:focus { outline: none; }
.cm-iconbtn__badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9999px; background: var(--primary); color: var(--primary-foreground);
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}

.cm-i-menu { display: none; }
@media (max-width: 992.98px) {
  [data-cm-sidebar-toggle] .cm-i-open, [data-cm-sidebar-toggle] .cm-i-close { display: none !important; }
  [data-cm-sidebar-toggle] .cm-i-menu { display: inline-block; }
}
.cm-theme-btn .cm-i-moon { display: none; }
html.darkmode .cm-theme-btn .cm-i-moon { display: inline-block; }
html.darkmode .cm-theme-btn .cm-i-sun { display: none; }

.cm-content { flex: 1 0 auto; padding: 24px; }
.cm-content > .section-main,
html body .cm-app .body-content .section-main,
html body .cm-app .section-main {
  margin: 0 !important; padding: 0 !important; max-width: 1600px !important; min-height: 0;
}
html body .cm-app .body-content { margin: 0 !important; }

.cm-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  padding: 16px 24px 24px; font-size: 12px; color: var(--muted);
  background: transparent !important; border: 0 !important;
}
.cm-footer a { color: var(--muted) !important; }
.cm-footer a:hover { color: var(--foreground) !important; }
.cm-footer__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.cm-footer__right { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Collapsed rail (desktop) — body.sidenav-toggled is the legacy flag main.js already persists. */
@media (min-width: 993px) {
  body.sidenav-toggled .cm-sidebar { width: var(--sidebar-rail); }
  body.sidenav-toggled .cm-main { margin-left: var(--sidebar-rail); }
  body.sidenav-toggled .cm-nav-link__text,
  body.sidenav-toggled .cm-nav-count,
  body.sidenav-toggled .cm-logo { opacity: 0; }
  body.sidenav-toggled .cm-nav-dot { opacity: 1; }
  body.sidenav-toggled .cm-nav-label { color: transparent; pointer-events: none; position: relative; }
  body.sidenav-toggled .cm-nav-label .cm-chevron, body.sidenav-toggled .cm-nav-label__count { opacity: 0; }
  /* The icon rail has no group headings to click: every group shows its icons. */
  body.sidenav-toggled .cm-sidebar .cm-nav-group > .cm-nav-collapse.is-closed { grid-template-rows: 1fr; }
  /* …except the order list (one icon per order page): the rail keeps it shut, the topbar order menus cover it. */
  body.sidenav-toggled .cm-sidebar .cm-nav-order > .cm-nav-collapse.is-closed { grid-template-rows: 0fr; }
  body.sidenav-toggled .cm-nav-label .cm-nav-dash { display: block; position: absolute; left: 24px; top: 50%; width: 16px; height: 1px; background: var(--border-strong); }
  body.sidenav-toggled .cm-sidebar__nav { scrollbar-width: none; }
  body.sidenav-toggled .cm-sidebar__nav::-webkit-scrollbar { display: none; }
  .cm-mobile-only { display: none !important; }
}
.cm-rail-mark { position: absolute; left: 16px; width: 32px; height: 32px; object-fit: contain; opacity: 0; pointer-events: none; transition: opacity .15s; }
@media (min-width: 993px) { body.sidenav-toggled .cm-rail-mark { opacity: 1; } }

/* Off-canvas sidebar (mobile/tablet). */
.cm-overlay { display: none; }
@media (max-width: 992.98px) {
  .cm-sidebar {
    width: min(288px, calc(100vw - 56px));
    transform: translateX(-100%);
    box-shadow: var(--elevation-modal);
    transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  body.sidenav-toggled .cm-sidebar { transform: none; transition-duration: .5s; }
  .cm-overlay {
    display: block; position: fixed; inset: 0; z-index: 1035;
    background: rgb(0 0 0 / 0.15); opacity: 0; pointer-events: none;
    transition: opacity .35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  body.sidenav-toggled .cm-overlay { opacity: 1; pointer-events: auto; transition-duration: .5s; }
  .cm-main { margin-left: 0; }
  .cm-desktop-only { display: none !important; }
  .cm-topbar { padding: 0 12px 0 8px; }
  .cm-content { padding: 16px; }
  .cm-footer { padding: 16px; }
  .cm-search { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-sidebar, .cm-main, .cm-overlay, .cm-nav-collapse, .cm-nav-label .cm-chevron { transition: none !important; }
}

html body .cm-app .cm-footer, html body .cm-app .cm-main, html body .cm-app .cm-content { background: transparent !important; }
html body .cm-app .table tr { border: 0 !important; background-color: transparent; }

/* ---------- Page head --------------------------------------------------- */

.cm-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.cm-page-head__text { flex: 1 1 320px; min-width: 0; }
.cm-page-head h1 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.cm-page-head .cm-title--record { font-size: 18px; }
.cm-page-head__desc { margin: 4px 0 0; max-width: 60ch; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.cm-page-head__meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--muted); }
.cm-page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
@media (max-width: 767.98px) { .cm-page-head__actions { flex-shrink: 1; min-width: 0; width: 100%; } .cm-page-head__actions > .btn, .cm-page-head__actions > .dropdown, .cm-page-head__actions > form { flex: 1 1 auto; } .cm-page-head__actions > .dropdown > .btn, .cm-page-head__actions > form > .btn { width: 100%; } .cm-page-head__actions .btn { justify-content: center; } }
.cm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 32px; margin: 0 0 4px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.cm-crumbs a { color: var(--muted) !important; }
.cm-crumbs a:hover { color: var(--foreground) !important; text-decoration: none; }
.cm-crumbs .cm-i { width: 14px; height: 14px; opacity: .7; }

/* Section heading between blocks */
.cm-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.cm-section-title h2 { margin: 0; font-size: 18px; font-weight: 600; }

/* ---------- Surfaces ---------------------------------------------------- */

.cm-card, html body .cm-app .card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  color: var(--foreground);
}
.cm-card { overflow: hidden; }
.cm-card + .cm-card { margin-top: 12px; }
.cm-grid > .cm-card + .cm-card, .cm-stack > .cm-card + .cm-card { margin-top: 0; }
.cm-card__head {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.cm-card__head h2, .cm-card__head h3, .cm-card__title { margin: 0; font-size: 16px; font-weight: 600; }
.cm-card__head .cm-card__sub { font-size: 13px; color: var(--muted); }
.cm-card__head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cm-card__body { padding: 20px; }
.cm-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.cm-link-more { display: inline-flex; align-items: center; gap: 4px; height: 32px; font-size: 14px; font-weight: 500; color: var(--primary) !important; white-space: nowrap; }
.cm-link-more:hover { text-decoration: none; color: var(--primary-hover) !important; }

html body .cm-app .card-header, html body .cm-app .card-footer { background: transparent !important; border-color: var(--border) !important; }
html body .cm-app .card-body { padding: 20px; }

.cm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1200px) {
  .cm-grid--main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
}
.cm-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Dashboard: money card beside "Quản lý tài khoản", then "Điều hướng nhanh". */
.cm-dash-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1200px) { .cm-dash-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-dash-pair > .cm-card { margin: 0; }
.cm-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.cm-money__stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-money__label { font-size: 13px; color: var(--muted); }
.cm-money__value { font-size: 22px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-money__value.is-credit { color: var(--success); }
.cm-money__value.is-debt { color: var(--danger); }
.cm-money__btn { width: 100%; justify-content: center; }
/* Soft blue button: light blue fill, dark blue text (secondary money action). */
html body .cm-app .btn.cm-btn-soft { background: var(--primary-light) !important; border-color: transparent !important; color: var(--primary-strong) !important; }
html body .cm-app .btn.cm-btn-soft:hover { background: color-mix(in srgb, var(--primary) 14%, transparent) !important; }
.cm-linkgrid { margin: 0; padding: 8px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
.cm-linkgrid a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--foreground) !important; text-decoration: none !important; }
.cm-linkgrid a .cm-i { flex-shrink: 0; color: var(--muted); }
.cm-linkgrid a:hover { background: var(--item-hover); }
.cm-linkgrid a:hover .cm-i { color: var(--foreground); }
.cm-quicknav { margin: 0; padding: 12px; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.cm-quicknav a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--foreground) !important; text-decoration: none !important; }
.cm-quicknav a:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.cm-quicknav__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary-strong); }
.cm-quicknav__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
/* Leftover dashboard widget slot: hidden when it holds nothing visible (Status alerts move to .cm-notices). */
.cm-dash-notices { display: flex; flex-direction: column; gap: 8px; }
.cm-dash-notices:not(:has(:not(script, link, style, [id^="status_bar_"], [id^="status_bar_"] *))) { display: none; }

/* Status-module notices: never where the hook prints them (top of every page), only inside the
   "Thông báo bảo trì" card that portal.js moves them into. */
html body [id^="status_bar_"] { display: none !important; }
.cm-notices__icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning); flex-shrink: 0; }
.cm-notices__list { display: flex; flex-direction: column; }
html body .cm-notices [id^="status_bar_"] { position: relative; display: flex !important; flex-direction: column; gap: 4px; margin: 0; padding: 14px 52px 14px 20px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--foreground) !important; font-size: 14px; line-height: 1.55; opacity: 1; }
html body .cm-notices [id^="status_bar_"] + [id^="status_bar_"] { border-top: 1px solid var(--border) !important; }
.cm-notices .status_bar_view:first-child { font-weight: 500; }
.cm-notices .status_bar_view + .status_bar_view { font-size: 13px; color: var(--muted); }
.cm-notices .status_bar_view b { color: var(--foreground); font-weight: 600; }
html body .cm-notices [id^="status_bar_"] .close { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 20px; line-height: 1; opacity: 1; text-shadow: none; float: none; }
html body .cm-notices [id^="status_bar_"] .close:hover { background: var(--item-hover); color: var(--foreground); }
.cm-quicknav__count { flex-shrink: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .cm-money { padding: 16px; gap: 10px; }
  .cm-money__value { font-size: 18px; }
  .cm-linkgrid a { min-height: 44px; }
}
@media (max-width: 479.98px) { .cm-linkgrid { grid-template-columns: minmax(0, 1fr); } }
.cm-stack--lg { gap: 24px; }

/* Stat row: ONE divided block, not four cards. */
.cm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 992px) { .cm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cm-stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; min-width: 0; color: var(--foreground) !important; text-decoration: none !important; border-color: var(--border); border-style: solid; border-width: 0 0 1px 1px; margin: 0 0 -1px -1px; }
a.cm-stat:hover { background: var(--surface-hover); }
.cm-stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-stat__label { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-stat__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); }
.cm-stat__value { font-size: 20px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 576px) { .cm-stat__value { font-size: 24px; } }
.cm-stat__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-stat__sub.is-warning { color: var(--warning); }
.cm-stat__sub.is-danger { color: var(--error-strong); }
/* Phones: labels wrap instead of "Hóa đơn để…" (must follow the base .cm-stat__label rule). */
@media (max-width: 575.98px) { .cm-stat__label { white-space: normal; overflow-wrap: anywhere; } }

/* Divided list rows */
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-list > li + li, .cm-row + .cm-row { border-top: 1px solid var(--border); }
.cm-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 20px; color: var(--foreground) !important; text-decoration: none !important; }
a.cm-row:hover { background: var(--surface-hover); }
.cm-row__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--item-hover); color: color-mix(in srgb, var(--foreground) 72%, transparent); }
.cm-row__main { flex: 1 1 auto; min-width: 0; }
.cm-row__title, .cm-row__sub { display: block; }
.cm-row__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-row__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-row__end { flex-shrink: 0; display: flex; align-items: center; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }

/* Description list (label / value) */
.cm-dl { margin: 0; }
.cm-dl__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 20px; }
.cm-dl__row + .cm-dl__row { border-top: 1px solid var(--border); }
@media (min-width: 576px) { .cm-dl__row { grid-template-columns: 11rem minmax(0, 1fr); gap: 16px; } }
.cm-dl dt { font-size: 13px; font-weight: 400; color: var(--muted); }
.cm-dl dd { margin: 0; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }

/* Empty state */
.cm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; text-align: center; }
.cm-empty__icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--item-hover); color: var(--muted); margin-bottom: 4px; }
.cm-empty__title { margin: 0; font-size: 14px; font-weight: 600; }
.cm-empty__text { margin: 0; max-width: 46ch; font-size: 14px; color: var(--muted); }
.cm-empty .btn { margin-top: 8px; }

/* Toolbar above a table: tabs left, search + actions right */
.cm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.cm-toolbar__end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cm-input-search { position: relative; }
.cm-input-search .cm-i { z-index: 1; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cm-input-search .form-control { padding-left: 36px; min-width: 240px; }

/* Segmented tabs (status filter) */
.cm-seg { margin: 0; list-style: none; display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--secondary); max-width: 100%; overflow-x: auto; }
.cm-seg a, .cm-seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted-strong) !important; white-space: nowrap; text-decoration: none !important; cursor: pointer; }
.cm-seg a:hover, .cm-seg button:hover { color: var(--foreground) !important; }
.cm-seg button:focus { outline: none; }
.cm-seg button:focus-visible { box-shadow: 0 0 0 2px var(--ring-focus); }
.cm-seg .is-active, .cm-seg .active { background: var(--surface); color: var(--foreground) !important; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06); }
.cm-seg .cm-seg__count { font-size: 12px; color: var(--muted-strong); font-variant-numeric: tabular-nums; }

/* Underline tabs (page sections) */
.cm-tabs { display: flex; gap: 20px; margin: 0 0 20px; padding: 0; list-style: none; box-shadow: inset 0 -1px 0 var(--tab-rail); overflow-x: auto; scrollbar-width: none; }
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 40px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted) !important; white-space: nowrap; text-decoration: none !important; }
.cm-tabs a:hover { color: var(--foreground) !important; }
.cm-tabs a.is-active, .cm-tabs a.active { color: var(--foreground) !important; border-bottom-color: var(--foreground); }

/* Two-column settings area: sub-nav left, content right */
.cm-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1200px) { .cm-settings { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }
.cm-subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
/* Horizontal tab rows: portal.js adds .is-fade-start / .is-fade-end while items hide past that edge. */
:is(.cm-tabs, .cm-seg, .cm-subnav).is-fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
:is(.cm-tabs, .cm-seg, .cm-subnav).is-fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
:is(.cm-tabs, .cm-seg, .cm-subnav).is-fade-start.is-fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.cm-subnav::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { .cm-subnav { flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 24px); } }
.cm-subnav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--radius); font-size: 14px; color: color-mix(in srgb, var(--foreground) 72%, transparent) !important; white-space: nowrap; text-decoration: none !important; }
.cm-subnav a:hover { background: var(--item-hover); color: var(--foreground) !important; }
.cm-subnav a.is-active, .cm-subnav a.active { background: var(--secondary); color: var(--foreground) !important; font-weight: 500; }

/* Settings row: label left, control right */
.cm-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 20px; }
.cm-field + .cm-field { border-top: 1px solid var(--border); }
@media (min-width: 768px) { .cm-field { grid-template-columns: 12rem minmax(0, 1fr); gap: 24px; align-items: start; } .cm-field > label, .cm-field__label { min-height: 40px; display: flex; align-items: center; } }
.cm-field > label, .cm-field__label { margin: 0; font-size: 14px; font-weight: 500; }
.cm-field__hint { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ---------- Status badges ---------------------------------------------- */

html body .cm-app .badge, html body .cm-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px !important;
  border-radius: 9999px; border: 0 !important; box-shadow: none !important;
  font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: 0; text-transform: none;
  background: var(--neutral-bg) !important; color: var(--neutral) !important;
  white-space: nowrap; vertical-align: middle;
}
html body .cm-app .badge::before, html body .cm-badge::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; opacity: .9; }
html body .cm-app .badge.badge-pill::before, html body .cm-app .badge.badge-primary::before, html body .cm-app .badge.badge-top::before, html body .cm-badge--plain::before { display: none; }
html body .cm-app .badge.badge-primary { background: var(--primary-light) !important; color: var(--primary-strong) !important; }
html body .cm-app .badge.badge-pill.badge-primary { background: var(--primary) !important; color: var(--primary-foreground) !important; }
html body .cm-app .badge.badge-Active,
html body .cm-app .badge.badge-Paid,
html body .cm-app .badge.badge-Accepted,
html body .cm-app .badge.badge-Completed,
html body .cm-app .badge.badge-success,
html body .cm-app .badge.badge-Approved,
html body .cm-app .label.label-Active,
html body .cm-app .label.label-Paid,
html body .cm-app .label.label-Accepted,
html body .cm-app .label.label-Completed,
html body .cm-badge.is-success { background: var(--success-bg) !important; color: var(--success) !important; }
html body .cm-app .badge.badge-Pending,
html body .cm-app .badge.badge-Unpaid,
html body .cm-app .badge.badge-Open,
html body .cm-app .badge.badge-Opened,
html body .cm-app .badge.badge-In-Progress,
html body .cm-app .badge.badge-Draft,
html body .cm-app .badge.badge-Sent,
html body .cm-app .badge.badge-warning,
html body .cm-app .badge.badge-Receiptunpaid,
html body .cm-app .label.label-Pending,
html body .cm-app .label.label-Unpaid,
html body .cm-app .label.label-Open,
html body .cm-app .label.label-Opened,
html body .cm-badge.is-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
html body .cm-app .badge.badge-Answered,
html body .cm-app .badge.badge-Customer-Reply,
html body .cm-app .badge.badge-Client-Reply,
html body .cm-app .badge.badge-info,
html body .cm-app .label.label-Answered,
html body .cm-app .label.label-Customer-Reply,
html body .cm-app .label.label-Client-Reply,
html body .cm-app .label.label-info,
html body .cm-badge.is-info { background: var(--info-bg) !important; color: var(--info) !important; }
html body .cm-app .badge.badge-Suspended,
html body .cm-app .badge.badge-Fraud,
html body .cm-app .badge.badge-Overdue,
html body .cm-app .badge.badge-Collections,
html body .cm-app .badge.badge-danger,
html body .cm-app .badge.badge-Dead,
html body .cm-app .badge.badge-Chargeback,
html body .cm-app .label.label-Suspended,
html body .cm-app .label.label-Fraud,
html body .cm-app .label.label-Overdue,
html body .cm-app .label.label-Collections,
html body .cm-badge.is-danger { background: var(--error-bg) !important; color: var(--error-strong) !important; }
html body .cm-app .badge.badge-Terminated,
html body .cm-app .badge.badge-Cancelled,
html body .cm-app .badge.badge-Canceled,
html body .cm-app .badge.badge-Closed,
html body .cm-app .badge.badge-Close,
html body .cm-app .badge.badge-Expired,
html body .cm-app .badge.badge-Refunded,
html body .cm-app .badge.badge-Transferred,
html body .cm-app .badge.badge-secondary,
html body .cm-app .badge.badge-light,
html body .cm-app .badge.badge-details,
html body .cm-app .label.label-Terminated,
html body .cm-app .label.label-Cancelled,
html body .cm-app .label.label-Canceled,
html body .cm-app .label.label-Closed,
html body .cm-badge.is-neutral { background: var(--neutral-bg) !important; color: var(--neutral) !important; }

/* ---------- Buttons ----------------------------------------------------- */
/* Four forms: outline (default), primary, secondary, ghost. Danger = ghost on rose tint. */

html body .cm-app .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--radius) !important;
  font-family: var(--app-font); font-size: 14px; font-weight: 500; line-height: 1.2;
  text-transform: none; letter-spacing: 0; white-space: nowrap;
  box-shadow: none !important;
  transition: background-color .15s, color .15s, border-color .15s;
}
html body .cm-app .btn:focus, html body .cm-app .btn.focus { box-shadow: none !important; outline: none; }
html body .cm-app .btn .material-icons { font-size: 18px; margin: 0 !important; }
html body .cm-app .btn-sm, html body .cm-app .btn-group-sm > .btn { min-height: 32px; padding: 0 12px; border-radius: var(--radius-sm) !important; font-size: 13px; gap: 6px; }
html body .cm-app .btn-lg { min-height: 44px; padding: 0 20px; }
html body .cm-app .btn-block { display: flex; width: 100%; }
@media (max-width: 767.98px) { .cm-app .btn:not(.btn-sm) { min-height: 44px; } }

html body .cm-app .btn-primary, html body .cm-app .btn-success, html body .cm-app .btn-info {
  background: var(--primary) !important; border: 1px solid var(--primary) !important; color: var(--primary-foreground) !important;
}
html body .cm-app .btn-primary:hover, html body .cm-app .btn-success:hover, html body .cm-app .btn-info:hover { background: var(--primary-hover) !important; border-color: var(--primary-hover) !important; }
html body .cm-app .btn-secondary, html body .cm-app .btn-light {
  background: var(--secondary) !important; border: 1px solid transparent !important; color: var(--foreground) !important;
}
html body .cm-app .btn-secondary:hover, html body .cm-app .btn-light:hover { background: var(--secondary-hover) !important; }
html body .cm-app .btn-default, html body .cm-app .btn-outline, html body .cm-app .btn-outline-primary, html body .cm-app .btn-outline-secondary,
html body .cm-app .btn-outline-dark, html body .cm-app .btn-outline-info, html body .cm-app .btn-outline-success, html body .cm-app .btn-white {
  background: var(--surface) !important; border: 1px solid var(--border-strong) !important; color: var(--foreground) !important;
}
html body .cm-app .btn-default:hover, html body .cm-app .btn-outline:hover, html body .cm-app .btn-outline-primary:hover, html body .cm-app .btn-outline-secondary:hover,
html body .cm-app .btn-outline-dark:hover, html body .cm-app .btn-outline-info:hover, html body .cm-app .btn-outline-success:hover, html body .cm-app .btn-white:hover {
  background: var(--button-hover) !important;
}
html body .cm-app .btn-ghost, html body .cm-app .btn-link {
  background: transparent !important; border: 1px solid transparent !important; color: color-mix(in srgb, var(--foreground) 80%, transparent) !important; text-decoration: none !important;
}
html body .cm-app .btn-ghost:hover, html body .cm-app .btn-link:hover { background: var(--button-hover) !important; color: var(--foreground) !important; }
html body .cm-app .btn-link { color: var(--primary) !important; }
html body .cm-app .btn-danger, html body .cm-app .btn-outline-danger, html body .cm-app .btn-danger-soft {
  background: var(--danger-bg) !important; border: 1px solid transparent !important; color: var(--danger) !important;
}
html body .cm-app .btn-danger:hover, html body .cm-app .btn-outline-danger:hover, html body .cm-app .btn-danger-soft:hover { background: var(--danger-bg-hover) !important; }
html body .cm-app .btn-warning, html body .cm-app .btn-outline-warning { background: var(--warning-bg) !important; border: 1px solid transparent !important; color: var(--warning) !important; }
html body .cm-app .btn:disabled, html body .cm-app .btn.disabled { opacity: .5; pointer-events: none; }
html body .cm-app .btn-icon { width: 40px; padding: 0; }
html body .cm-app .btn-sm.btn-icon { width: 32px; }

/* ---------- Forms ------------------------------------------------------- */

html body .cm-app .form-control, html body .cm-app .custom-select, html body .cm-app select.form-control,
html body .cm-app input[type=text]:not(.cm-plain), html body .cm-app input[type=email]:not(.cm-plain), html body .cm-app input[type=password]:not(.cm-plain),
html body .cm-app input[type=number]:not(.cm-plain), html body .cm-app input[type=tel]:not(.cm-plain), html body .cm-app textarea {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  background-color: var(--surface) !important;
  color: var(--foreground) !important;
  font-family: var(--app-font); font-size: 14px;
  box-shadow: none !important;
}
html body .cm-app .form-control, html body .cm-app .custom-select { height: 40px; padding: 0 12px; }
html body .cm-app textarea.form-control { height: auto; min-height: 96px; padding: 10px 12px; }
html body .cm-app .form-control-sm { height: 32px; border-radius: var(--radius-sm) !important; font-size: 13px; }
@media (max-width: 767.98px) {
  html body .cm-app .form-control:not(.form-control-sm):not(textarea), html body .cm-app .custom-select { height: 44px; font-size: 16px; }
}
html body .cm-app .form-control::placeholder, html body .cm-app textarea::placeholder { color: var(--muted); opacity: 1; }
/* combined.min.css sets input::placeholder to #afb2c1 (2.1:1) with !important; win it back for every input. */
html body input::placeholder, html body textarea::placeholder,
html body input:focus::placeholder, html body textarea:focus::placeholder { color: var(--muted) !important; opacity: 1; }
html body .cm-app .form-control:focus, html body .cm-app .custom-select:focus, html body .cm-app textarea:focus,
html body .cm-app input[type=text]:focus, html body .cm-app input[type=email]:focus, html body .cm-app input[type=password]:focus {
  border-color: var(--border-focus) !important; box-shadow: 0 0 0 2px var(--ring-focus) !important; outline: none;
}
html body .cm-app .form-control:disabled, html body .cm-app .form-control[readonly] { background-color: var(--item-hover) !important; color: var(--muted) !important; }
html body .cm-app .form-control.is-invalid, html body .cm-app .parsley-error { border-color: var(--error) !important; }
html body .cm-app .invalid-feedback, html body .cm-app .parsley-errors-list { color: var(--error-text); font-size: 12px; }
html body .cm-app label, html body .cm-app .col-form-label { font-size: 14px; font-weight: 500; color: var(--foreground); }
html body .cm-app .form-group { margin-bottom: 16px; }
html body .cm-app .form-text, html body .cm-app small.form-text { font-size: 12px; color: var(--muted) !important; }
html body .cm-app .input-group-text { background: var(--item-hover); border-color: var(--border-strong); color: var(--muted); border-radius: var(--radius); }
html body .cm-app .input-group > .form-control:not(:last-child), html body .cm-app .input-group > .custom-select:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html body .cm-app .input-group > .form-control:not(:first-child), html body .cm-app .input-group > .custom-select:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html body .cm-app .input-group-append .btn { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html body .cm-app .input-group-prepend .btn { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html body .cm-app .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--primary); border-color: var(--primary); }
html body .cm-app .custom-control-label::before { border-color: var(--border-strong); }
html body .cm-app .custom-control-input:focus ~ .custom-control-label::before { box-shadow: none; }
html body .cm-app input[type=checkbox], html body .cm-app input[type=radio] { accent-color: var(--primary); }
.cm-req { color: var(--error-text); }

/* Checkbox / radio with label, and a two-column form grid (shared by sign-up, tickets, account, affiliates). */
.cm-checks { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.cm-check { display: inline-flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; font-weight: 400 !important; color: var(--foreground); cursor: pointer; }
.cm-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.cm-check small { display: block; color: var(--muted); }
.cm-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 576px) { .cm-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The legacy theme paints a grey ::after box over every native checkbox/radio (checked looks disabled). */
html body .cm-app input[type=checkbox]::after, html body .cm-app input[type=radio]::after { content: none !important; display: none !important; }

/* ---------- Tables ------------------------------------------------------ */

.cm-table-wrap, html body .cm-app .table-responsive { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
.cm-table-wrap .table, html body .cm-app .table-responsive .table { margin: 0; border: 0; }
/* th is the containing block, so .sr-only labels can't escape the overflow and widen the page. */
.cm-table-wrap th, html body .cm-app .table-responsive th { position: relative; }
html body .cm-app .table { color: var(--foreground); background: var(--surface) !important; border: 0 !important; font-size: 14px; }
html body .cm-app .table thead th {
  height: 44px; padding: 0 16px; vertical-align: middle;
  border-top: 0 !important; border-bottom: 1px solid var(--border) !important;
  background: var(--surface) !important;
  font-size: 12px; font-weight: 500; color: var(--muted) !important; text-transform: none; letter-spacing: 0; white-space: nowrap;
}
html body .cm-app .table td, html body .cm-app .table tbody th {
  padding: 12px 16px; vertical-align: middle;
  border-top: 1px solid var(--border) !important; border-bottom: 0 !important;
  background: transparent;
}
html body .cm-app .table tbody tr:first-child td { border-top: 0 !important; }
html body .cm-app .table-hover tbody tr:hover, html body .cm-app .table tbody tr.cm-tr-link:hover { background: var(--surface-hover) !important; }
html body .cm-app .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
html body .cm-app .table .cm-td-num, html body .cm-app .table .cm-th-num { text-align: right; font-variant-numeric: tabular-nums; }
html body .cm-app .table .cm-td-actions { width: 48px; text-align: right; white-space: nowrap; }
.cm-td-main { font-weight: 500; overflow-wrap: anywhere; }
.cm-td-main a { color: var(--foreground) !important; }
.cm-td-main a:hover { color: var(--primary) !important; text-decoration: none; }
.cm-td-sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.cm-dash { color: var(--muted); }
.cm-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Stackable tables become row lists under sm */
@media (max-width: 575.98px) {
  html body .cm-app table.cm-stack-sm, html body .cm-app table.cm-stack-sm tbody, html body .cm-app table.cm-stack-sm tr, html body .cm-app table.cm-stack-sm td { display: block; width: 100%; }
  html body .cm-app table.cm-stack-sm thead { display: none; }
  html body .cm-app table.cm-stack-sm tr { padding: 12px 16px; border-top: 1px solid var(--border); }
  html body .cm-app table.cm-stack-sm tr:first-child { border-top: 0; }
  html body .cm-app table.cm-stack-sm td { padding: 2px 0; border: 0 !important; text-align: left !important; }
  html body .cm-app table.cm-stack-sm td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: 12px; }
  html body .cm-app table.cm-stack-sm td.cm-td-actions { width: auto; }
  html body .cm-app table.cm-stack-sm td.cm-hide-sm { display: none; }
}

/* ---------- Tabs, pills, pagination, alerts, dropdowns, modals ---------- */

html body .cm-app .nav-tabs { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--tab-rail); gap: 20px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html body .cm-app .nav-tabs::-webkit-scrollbar { display: none; }
html body .cm-app .nav-tabs .nav-link { height: 40px; display: inline-flex; align-items: center; padding: 0; margin: 0; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; background: transparent !important; color: var(--muted) !important; font-size: 14px; font-weight: 500; white-space: nowrap; }
html body .cm-app .nav-tabs .nav-link:hover { color: var(--foreground) !important; }
html body .cm-app .nav-tabs .nav-link.active, html body .cm-app .nav-tabs .nav-item.active .nav-link, html body .cm-app .nav-tabs .nav-item.show .nav-link { color: var(--foreground) !important; border-bottom-color: var(--foreground) !important; }
html body .cm-app .nav-tabs-wrapper { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }

html body .cm-app .pagination { gap: 4px; margin: 0; }
html body .cm-app .page-link { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 0 !important; border-radius: var(--radius-sm) !important; background: transparent; color: var(--foreground); font-size: 14px; font-variant-numeric: tabular-nums; }
html body .cm-app .page-link:hover { background: var(--item-hover); color: var(--foreground); }
html body .cm-app .page-item.active .page-link { background: var(--secondary); color: var(--foreground); font-weight: 500; }
html body .cm-app .page-item.disabled .page-link { background: transparent; color: var(--muted); opacity: .5; }
html body .cm-app .page-link:focus { box-shadow: none; }

html body .cm-app .alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--foreground); font-size: 14px;
}
html body .cm-app .alert-info, html body .cm-app .alert-primary { background: var(--info-bg); border-color: var(--info-border); color: var(--foreground); }
html body .cm-app .alert-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--foreground); }
html body .cm-app .alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--foreground); }
html body .cm-app .alert-danger, html body .cm-app .alert-error { background: var(--error-bg); border-color: var(--error-border); color: var(--foreground); }
html body .cm-app .alert .close { margin-left: auto; opacity: .6; text-shadow: none; }
.cm-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.cm-banner > .cm-i { color: var(--muted); }
.cm-banner__text { flex: 1 1 260px; min-width: 0; }
.cm-banner__text strong { font-weight: 600; }
.cm-banner__actions { display: flex; gap: 8px; margin-left: auto; }
.cm-banner.is-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.cm-banner.is-warning > .cm-i { color: var(--warning); }
.cm-banner.is-danger { background: var(--error-bg); border-color: var(--error-border); }
.cm-banner.is-danger > .cm-i { color: var(--error-strong); }
.cm-banner.is-info { background: var(--info-bg); border-color: var(--info-border); }
.cm-banner.is-info > .cm-i { color: var(--info); }

html body .cm-app .dropdown-menu {
  min-width: 200px; padding: 4px; margin-top: 4px;
  border: 1px solid var(--border) !important; border-radius: 16px !important;
  background: var(--surface-overlay) !important; box-shadow: var(--elevation-popover) !important;
  font-size: 14px; color: var(--foreground);
}
html body .cm-app .dropdown-menu:not(.show) { display: none !important; }
html body .cm-app .dropdown-menu-right { right: 0; left: auto; }
html body .cm-app .dropdown-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius); color: var(--foreground) !important; font-size: 14px; white-space: nowrap;
}
html body .cm-app .dropdown-item:hover, html body .cm-app .dropdown-item:focus { background: var(--item-hover) !important; color: var(--foreground) !important; }
html body .cm-app .dropdown-item.active, html body .cm-app .dropdown-item:active { background: var(--secondary) !important; color: var(--foreground) !important; }
html body .cm-app .dropdown-item .cm-i { color: var(--muted); }
html body .cm-app .dropdown-item.cm-item-danger:hover { background: var(--danger-bg) !important; color: var(--danger) !important; }
html body .cm-app .dropdown-item.cm-item-danger:hover .cm-i { color: var(--danger); }
html body .cm-app .dropdown-divider { margin: 4px 0; border-color: var(--border); }
html body .cm-app .dropdown-header { padding: 8px 12px; font-size: 12px; color: var(--muted); }
html body .cm-app .dropdown-toggle::after { display: none; }

.modal-content { border: 1px solid var(--border) !important; border-radius: 16px !important; background: var(--surface) !important; box-shadow: var(--elevation-modal) !important; color: var(--foreground); }
.modal-header, .modal-footer { border-color: var(--border) !important; padding: 16px 20px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-backdrop.show { opacity: .3; }

html body .cm-app .list-group-item { background: var(--surface); border-color: var(--border); color: var(--foreground); }
html body .cm-app .progress { height: 6px; border-radius: 9999px; background: var(--secondary); }
html body .cm-app .progress-bar { background: var(--primary); border-radius: 9999px; }
html body .cm-app .table-borders, html body .cm-app .table-radius { border-radius: var(--radius); }

/* Notifications dropdown */
.cm-notif { width: 340px; max-width: calc(100vw - 24px); padding: 0 !important; overflow: hidden; }
.cm-notif__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.cm-notif__list { max-height: 360px; overflow-y: auto; padding: 4px; }
.cm-notif__item { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: var(--foreground) !important; text-decoration: none !important; }
.cm-notif__item:hover { background: var(--item-hover); }
.cm-notif__dot { width: 8px; height: 8px; margin-top: 6px; flex-shrink: 0; border-radius: 9999px; background: var(--primary); }
.cm-notif__item.is-seen .cm-notif__dot { background: transparent; }
.cm-notif__title { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-notif__time { font-size: 12px; color: var(--muted); }
.cm-notif__foot { display: block; padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; font-size: 14px; font-weight: 500; }

/* Live-search results under the topbar search (main.js / Semantic UI search markup) */
.cm-search .navbar-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: auto; width: max(100%, 360px); max-height: 70vh; overflow-y: auto; z-index: 1050; }
.cm-search .navbar-search-results .category > .name { padding: 8px 12px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cm-search .navbar-search-results .result { display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--foreground); text-decoration: none; }
.cm-search .navbar-search-results .result:hover { background: var(--item-hover); }
.cm-search .navbar-search-results .result .title { font-size: 14px; font-weight: 500; }
.cm-search .navbar-search-results .result .description, .cm-search .navbar-search-results .result .price { font-size: 12px; color: var(--muted); }
.cm-search .navbar-search-results .message { padding: 16px; font-size: 14px; color: var(--muted); }
.cm-search .navbar-search-loader { display: none; }

/* ---------- Legacy wrappers neutralised inside the new shell ------------ */
html body .cm-app .navbar.sub-bar, html body .cm-app .main-overlay { display: none !important; }
html body .cm-app .section-heading h3 { font-size: 18px; }
html body .cm-app .shadow, html body .cm-app .shadow-sm, html body .cm-app .shadow-lg { box-shadow: none !important; }
html body .cm-app .bg-white { background: var(--surface) !important; }
html body .cm-app .bg-light { background: var(--item-hover) !important; }
html body .cm-app .border, html body .cm-app .border-top, html body .cm-app .border-bottom, html body .cm-app .border-left, html body .cm-app .border-right { border-color: var(--border) !important; }

/* Legacy light/dark logo pairs used inside page templates */
.cm-theme-logo--dark { display: none !important; }
html.darkmode .cm-theme-logo--light { display: none !important; }
html.darkmode .cm-theme-logo--dark { display: inline-block !important; }

/* Auth pages: no sidebar, centred column */
.cm-app--auth > .cm-auth { flex: 1 1 auto; }
.cm-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }

/* ---------- "Đăng ký dịch vụ" mega menu (components/order-mega.tpl) ----------
   Closed by default, opened by click. Panel drops under the topbar, aligned with the content column. */
.cm-mega-trigger .cm-mega-chevron { transition: transform .2s ease-out; }
.cm-mega-trigger[aria-expanded="true"] .cm-mega-chevron { transform: rotate(180deg); }
.cm-mega {
  position: fixed; z-index: 1045;
  /* portal.js sets --cm-mega-left / --cm-mega-width from the menu that opened it (panel drops under that menu). */
  top: calc(var(--topbar-h) + 4px); left: var(--cm-mega-left, calc(var(--sidebar-w) + 24px));
  width: var(--cm-mega-width, min(1160px, calc(100vw - var(--sidebar-w) - 48px)));
  max-height: calc(100vh - var(--topbar-h) - 28px);
  display: flex; overflow: hidden;
  background: var(--surface-overlay); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--elevation-modal);
  animation: cm-mega-in .18s ease-out;
}
.cm-mega[hidden] { display: none; }
@keyframes cm-mega-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cm-mega { animation: none; } }
.cm-app--auth .cm-mega, body:not(.cm-shell) .cm-mega { left: 24px; }
.cm-mega__inner { display: grid; grid-template-columns: 260px minmax(0, 1fr); width: 100%; min-height: 0; }
.cm-mega__cats { margin: 0; padding: 8px; list-style: none; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; background: var(--item-hover); border-right: 1px solid var(--border); }
.cm-mega__cat { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--radius); background: transparent; color: color-mix(in srgb, var(--foreground) 80%, transparent); font-size: 14px; text-align: left; cursor: pointer; }
.cm-mega__cat-name { flex: 1 1 auto; min-width: 0; }
.cm-mega__cat .cm-i { color: var(--muted); opacity: 0; transition: opacity .15s; }
.cm-mega__cat:hover { background: var(--secondary); color: var(--foreground); }
.cm-mega__cat.is-active { position: relative; background: var(--surface); color: var(--primary); font-weight: 500; }
.cm-mega__cat.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--primary); }
.cm-mega__cat.is-active .cm-i, .cm-mega__cat:hover .cm-i { opacity: 1; }
.cm-mega__cat:focus { outline: none; }
.cm-mega__panes { min-width: 0; overflow-y: auto; }
.cm-mega__pane { padding: 20px 24px 24px; }
.cm-mega__pane[hidden] { display: none; }
.cm-mega__head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.cm-mega__head-icon { width: 48px; height: 48px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--primary-light); color: var(--primary); }
.cm-mega__head-icon .cm-i { width: 24px; height: 24px; }
.cm-mega__head-text { flex: 1 1 auto; min-width: 0; }
html body .cm-mega__title { margin: 0; font-size: 18px; font-weight: 600; }
.cm-mega__desc { margin: 4px 0 0; max-width: 70ch; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.cm-mega__head .cm-link-more { flex-shrink: 0; margin-top: 4px; }
.cm-mega__grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cm-mega__card { display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--foreground) !important; text-decoration: none !important; transition: border-color .15s, background-color .15s; }
.cm-mega__card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.cm-mega__card:hover .cm-mega__card-name { color: var(--primary); }
.cm-mega__card--solo { max-width: 360px; }
.cm-mega__card-icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--item-hover); color: color-mix(in srgb, var(--foreground) 75%, transparent); }
.cm-mega__card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-mega__card-name { font-size: 14px; font-weight: 500; line-height: 1.4; }
.cm-mega__card-desc { font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


/* Header order menus (grouped). Shown from 993px; portal.js adds .is-folded to the topbar when they don't fit
   (sidebar open, long balance, English labels…) and they fold into the single "Đăng ký dịch vụ" trigger. */
.cm-mega-wrap { position: static; display: flex; align-items: center; gap: 4px; min-width: 0; flex-shrink: 0; margin-left: 12px; }
.cm-topnav { display: flex; align-items: center; gap: 2px; }
.cm-topnav__item {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--foreground) 80%, transparent); white-space: nowrap;
}
.cm-topnav__item:hover { background: var(--item-hover); color: var(--foreground); }
.cm-topnav__item[aria-expanded="true"] { background: var(--secondary); color: var(--foreground); }
.cm-topnav__item:focus { outline: none; }
.cm-topnav__item .cm-mega-chevron { color: var(--muted); transition: transform .2s ease-out; }
.cm-topnav__item[aria-expanded="true"] .cm-mega-chevron { transform: rotate(180deg); }
html body .cm-app .cm-topbar:not(.is-folded) .cm-mega-wrap .cm-mega-trigger { display: none !important; }
.cm-topbar.is-folded .cm-topnav { display: none; }
/* Group with a single category: no category column, the cards take the full panel. */
.cm-mega.is-single .cm-mega__inner { grid-template-columns: minmax(0, 1fr); }
.cm-mega.is-single .cm-mega__cats { display: none; }
.cm-mega__cats > li[hidden] { display: none; }
/* MacBook 11–16" range (and any 993–1599px desktop): search is a FIXED box, not a
   collapsing icon. Responsive width via clamp so it auto-sizes with the viewport.
   (2026-10-28: changed from the focus-to-expand icon per owner request.) */
@media (min-width: 993px) and (max-width: 1599.98px) {
  .cm-topbar:not(.is-folded) .cm-search { position: relative; width: clamp(200px, 20vw, 320px); height: 36px; flex-shrink: 0; }
  .cm-topbar:not(.is-folded) .cm-search .navbar-search-results { left: 0; right: auto; }
}

/* Section headings in the category column ("Hạ tầng Cloud", "Lưu trữ & Cơ sở dữ liệu", "Website & Email"). */
.cm-mega__heading { padding: 12px 12px 4px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cm-mega__cats > .cm-mega__heading:first-child, .cm-mega__cats > .cm-mega__heading[hidden] + .cm-mega__heading { padding-top: 4px; }
.cm-mega__heading[hidden] { display: none; }

/* Tables: the name column keeps room for names and plan codes; money and dates never break mid-value. */
@media (min-width: 576px) { .cm-app table td.cm-td-first { min-width: 200px; } }
.cm-app table td.cm-td-num, .cm-app table td.cm-num { white-space: nowrap; }
/* Sort glyph: full --muted (the .6 / .7 opacities put it at 2.4:1). */
html body .cm-app .table thead th .sort-icon { opacity: 1; color: var(--muted); }

/* Scrollbars: the 4px auto-hide bar everywhere (combined.min.css gives .scrollable / .table-wrapper / dark 8px). */
html body .scrollable::-webkit-scrollbar, html body .table-wrapper::-webkit-scrollbar, html.darkmode body ::-webkit-scrollbar { width: 4px; height: 4px; }
html body .scrollable::-webkit-scrollbar-track, html body .table-wrapper::-webkit-scrollbar-track, html.darkmode body ::-webkit-scrollbar-track { background: transparent; }
html body .scrollable::-webkit-scrollbar-thumb, html body .table-wrapper::-webkit-scrollbar-thumb, html.darkmode body ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 9999px; }

/* Buttons stay flat: combined.min.css lifts .btn-* by 1px and adds a shadow on hover. */
html body .btn:hover { transform: none; }
html body .btn:hover:not(:focus-visible) { box-shadow: none; }

/* ---------- Utilities ----------------------------------------------------
   Stand-ins for the one-property inline styles templates used to carry (style="margin:0" …).
   !important keeps the weight an inline style had over component rules. */
.cm-m-0 { margin: 0 !important; }
.cm-mb-0 { margin-bottom: 0 !important; }
.cm-mt-12 { margin-top: 12px !important; }
.cm-min-w-0 { min-width: 0 !important; }
.cm-nowrap { white-space: nowrap !important; }
.cm-break { overflow-wrap: anywhere !important; }
.cm-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-fw-medium { font-weight: 500 !important; }
.cm-justify-end { justify-content: flex-end !important; }
.cm-text-muted { color: var(--muted) !important; }
.cm-text-fg { color: var(--foreground) !important; }
.cm-text-success { color: var(--success) !important; }
.cm-text-warning { color: var(--warning) !important; }
.cm-flush { border: 0 !important; border-radius: 0 !important; }

/* --- Topbar layout — matches the hitechcloud.vn main-site header: logo left, nav next to it (LEFT),
   account / CTA cluster on the RIGHT. Row = [sidebar toggle · (mobile logo) · (search) · order nav]
   …free space… [right cluster: widgets, bell, cart, lang, theme, account].
   The nav hugs the left (margin-left:12px, next to the search/toggle). The ONE flexible gap is before the
   right cluster (.cm-topbar__right keeps its own margin-left:auto), so the cluster floats to the far right.
   2026-11-02: removed the margin-left:auto that was set on .cm-mega-wrap at >=993px — it pushed the nav off
   the left and let it float mid-/right-of-bar, which did not match the main site. --- */
.cm-topbar { min-width: 0; }
.cm-topbar > .cm-search { flex: 0 1 auto; min-width: 0; }
.cm-topbar .cm-mega-wrap { margin-left: 12px; }
.cm-topbar .cm-topbar__right { margin-left: auto; }

/* Visitor account dropdown ("Tài khoản" → Đăng nhập / Đăng ký) in the topbar. */
.cm-authmenu .cm-authmenu__btn { display: inline-flex; align-items: center; gap: 6px; }
.cm-authmenu .dropdown-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }

/* Shared notification bell (hc-bell.js, same component as hitechcloud.vn): sized/tinted like the other topbar icon buttons. */
.cm-bell { flex-shrink: 0; --hcb-size: 36px; --hcb-radius: var(--radius-sm); --hcb-color: color-mix(in srgb, var(--foreground) 72%, transparent); --hcb-hover: var(--item-hover); }
.cm-bell:not([data-hc-bell-ready]) { width: 36px; height: 36px; }
.cm-bell[hidden] { display: none; }
.cm-avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.cm-acct-menu__head { flex-direction: row; align-items: center; gap: 12px; }
.cm-acct-menu__ident { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cm-acct-menu__greet { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-acct-menu__ident .cm-acct-menu__name { font-weight: 400; color: var(--muted); font-size: 13px; }
.cm-avatar--img { padding: 0; overflow: hidden; background: var(--item-hover); }
.cm-avatar--img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   Refresh layer v2 (2026-10-30) — aligns the client area with hitechcloud.vn /account + /iam.
   Additive: tokens live at the top of this file; everything below only restyles (no markup contracts).
   Revert: restore portal.css.bak-20261030-refresh (and bump the p= param in header.shared.tpl).
   ========================================================================== */

/* Cards, stat block, tables: IAM card radius (16px). */
.cm-card, html body .cm-app .card, .cm-stats, .cm-table-wrap, html body .cm-app .table-responsive, .cm-banner { border-radius: var(--radius-card) !important; }
html body .cm-app .table-borders, html body .cm-app .table-radius { border-radius: var(--radius-card); }
.cm-card__head { min-height: 60px; padding: 14px 20px; background: var(--surface-tint); }
.cm-card__head h2, .cm-card__head h3, .cm-card__title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.cm-card__head h2 + .cm-card__sub { margin-left: 2px; }
/* Section-header icon tile (inline SVG from icons.svg), same language as the account portal's section icons. */
.cm-card__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.cm-card__icon .cm-i { width: 17px; height: 17px; }
.cm-card__icon.is-success { background: var(--success-bg); color: var(--success); }
.cm-card__icon.is-warning { background: var(--warning-bg); color: var(--warning); }
.cm-card__icon.is-danger { background: var(--error-bg); color: var(--error-strong); }
.cm-card__icon.is-neutral { background: var(--neutral-bg); color: var(--neutral); }
.cm-card__foot { background: var(--surface-tint); }

/* Page head: a touch larger; the dashboard greeting becomes a soft brand panel with a line illustration. */
.cm-page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.section-dashboard > .cm-page-head {
  /* 2026-12-04: flat neutral panel (was SVG ring illustration + blue gradient). */
  position: relative; overflow: hidden; margin-bottom: 0; padding: 24px 28px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface);
}
.section-dashboard > .cm-page-head h1 { font-size: 24px; }
@media (max-width: 767.98px) {
  .section-dashboard > .cm-page-head { padding: 18px 16px; background: var(--surface); }
  .section-dashboard > .cm-page-head h1 { font-size: 20px; }
}

/* Stat block: larger icon tiles that fill with the brand on hover. */
.cm-stat { padding: 18px 20px; }
.cm-stat__icon { width: 38px; height: 38px; border-radius: 11px; transition: background-color .15s, color .15s; }
.cm-stat__icon .cm-i { width: 18px; height: 18px; }
a.cm-stat:hover .cm-stat__icon { background: var(--primary); color: var(--primary-foreground); }
.cm-stat__label { font-weight: 500; }
.cm-stat__value { letter-spacing: -0.015em; }

/* Quick nav / link grid. */
.cm-quicknav a { border-radius: var(--radius); transition: border-color .15s, background-color .15s; }
.cm-quicknav a:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--primary-light); }
.cm-quicknav__icon { width: 36px; height: 36px; border-radius: 10px; transition: background-color .15s, color .15s; }
.cm-quicknav a:hover .cm-quicknav__icon { background: var(--primary); color: var(--primary-foreground); }
.cm-linkgrid a .cm-i { color: var(--primary); opacity: .85; }
.cm-linkgrid a:hover { background: var(--primary-light); }
.cm-linkgrid a:hover .cm-i { color: var(--primary); opacity: 1; }
.cm-money__value { letter-spacing: -0.015em; }

/* Rows / description lists. */
.cm-row__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.cm-dl dt { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 576px) { .cm-dl dt { padding-top: 2px; } }

/* Empty states: brand icon tile with soft rings over a faded dot grid (CSS-only illustration, theme aware). */
.cm-empty { position: relative; isolation: isolate; padding: 52px 20px 48px; gap: 8px; }
.cm-empty::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--foreground) 16%, transparent) 1px, transparent 1.3px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 46% 62% at 50% 34%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 46% 62% at 50% 34%, #000 0%, transparent 78%);
}
.cm-empty__icon {
  position: relative; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 6%, transparent), 0 0 0 18px color-mix(in srgb, var(--primary) 3.5%, transparent);
}
.cm-empty__icon .cm-i, .cm-empty__icon .cm-i--lg { width: 28px; height: 28px; stroke-width: 1.8; }
.cm-empty__icon::after { content: ""; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; border-radius: 9999px; background: var(--cyan); opacity: .75; box-shadow: 0 0 0 3px var(--surface); }
.cm-empty__title { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.cm-empty .btn { margin-top: 10px; }
@media (max-width: 575.98px) { .cm-empty { padding: 40px 16px 36px; } }

/* Tables: tinted small-caps head, brand-tinted hover, a bit more air in the rows. */
html body .cm-app .table thead th {
  height: 46px; background: var(--surface-tint) !important;
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted) !important;
}
html body .cm-app .table td, html body .cm-app .table tbody th { padding: 14px 16px; }
html body .cm-app .table-hover tbody tr:hover, html body .cm-app .table tbody tr.cm-tr-link:hover { background: var(--surface-hover) !important; }
html body .cm-app .table tbody tr.cm-tr-link:hover .cm-td-main a { color: var(--primary) !important; }
.cm-table-foot { background: var(--surface-tint); }
.cm-td-main a { font-weight: 600; }
.cm-td-num { font-weight: 500; }

/* Tabs / segments / subnav: brand is the active colour (same rule as the account portal's SubTabs). */
.cm-tabs a.is-active, .cm-tabs a.active { color: var(--primary-strong) !important; border-bottom-color: var(--primary); }
html body .cm-app .nav-tabs .nav-link.active, html body .cm-app .nav-tabs .nav-item.active .nav-link, html body .cm-app .nav-tabs .nav-item.show .nav-link { color: var(--primary-strong) !important; border-bottom-color: var(--primary) !important; }
.cm-seg { border-radius: 12px; background: var(--secondary); }
.cm-seg .is-active, .cm-seg .active { color: var(--primary-strong) !important; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgb(11 23 48 / 0.06); }
.cm-subnav a.is-active, .cm-subnav a.active { background: var(--primary-light); color: var(--primary-strong) !important; }
html body .cm-app .page-item.active .page-link { background: var(--primary-light); color: var(--primary-strong); }

/* Sidebar: active entry is a brand pill, its icon takes the brand colour. */
.cm-nav-link .cm-i { color: color-mix(in srgb, var(--foreground) 55%, transparent); transition: color .15s; }
.cm-nav-link:hover .cm-i { color: var(--foreground); }
.cm-nav-link.is-active, .cm-nav-link.active { background: var(--primary-light); color: var(--primary-strong) !important; font-weight: 500; }
.cm-nav-link.is-active .cm-i, .cm-nav-link.active .cm-i { color: var(--primary); }
.cm-nav-link.is-active .cm-nav-count { color: var(--primary-strong); }
.cm-nav-label { font-weight: 600; }

/* Forms: IAM focus ring (3px) and a clearer label/hint hierarchy. */
html body .cm-app .form-control:focus, html body .cm-app .custom-select:focus, html body .cm-app textarea:focus,
html body .cm-app input[type=text]:focus, html body .cm-app input[type=email]:focus, html body .cm-app input[type=password]:focus {
  box-shadow: 0 0 0 3px var(--ring-focus) !important;
}
html body .cm-app .form-control:hover:not(:focus):not(:disabled), html body .cm-app .custom-select:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--foreground) 28%, var(--border-strong)) !important; }
html body .cm-app label, html body .cm-app .col-form-label { font-weight: 500; }
html body .cm-app .form-group { margin-bottom: 18px; }
html body .cm-app .btn:focus-visible { box-shadow: 0 0 0 3px var(--ring-focus) !important; outline: none; }
html body .cm-app .btn-primary:hover, html body .cm-app .btn-success:hover, html body .cm-app .btn-info:hover { background: var(--primary-hover) !important; }
html body .cm-app .btn-sm { border-radius: 10px !important; }
.cm-field + .cm-field { border-top-color: var(--border); }
html body .cm-app .input-group-text { background: var(--surface-tint); }

/* Alerts / banners: icon-friendly spacing, tinted by status. */
html body .cm-app .alert { border-radius: var(--radius-card); padding: 14px 18px; }

/* Order page: category cards (overrides/products.tpl) get an icon tile and a calmer title. */
.section-product-card { overflow: hidden; transition: border-color .15s, background-color .15s; }
.section-product-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)) !important; }
html body .cm-app .section-product-card .card-body { padding: 20px; gap: 14px; align-items: center; }
.section-product-card .cm-cat-icon { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--primary-light); color: var(--primary); }
.section-product-card .cm-cat-icon .cm-i { width: 22px; height: 22px; }
.section-product-card:hover .cm-cat-icon { background: var(--primary); color: var(--primary-foreground); }
.section-product-card .card-title.h3 { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--foreground) !important; text-decoration: none; }
.section-product-card .card-title.h3:hover { color: var(--primary) !important; }
html body .cm-app .section-product-card .card-footer { background: var(--surface-tint) !important; padding: 12px 20px; }
.section-product-card .product-icon { width: 44px; flex-shrink: 0; }

/* Phones. */
@media (max-width: 575.98px) {
  .cm-card__head { padding: 12px 16px; min-height: 54px; }
  .cm-card__body { padding: 16px; }
  .cm-stat { padding: 14px 16px; }
  .cm-stat__icon { width: 34px; height: 34px; }
  html body .cm-app .table td, html body .cm-app .table tbody th { padding: 12px 14px; }
  html body .cm-app .table thead th { padding: 0 14px; }
  .cm-card__icon { width: 30px; height: 30px; }
}
.cm-inv-main .cm-td-main { white-space: nowrap; }

/* SSO button (module-injected inline style): same brand, radius and height as the portal buttons. Markup/behaviour untouched. */
html body a.htc-id-btn { min-height: 44px; margin: 14px 0 6px; padding: 0 16px; border-radius: var(--radius); border-color: var(--primary); background: var(--primary); font-size: 14px; font-weight: 600; }
html body a.htc-id-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
html body a.htc-id-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring-focus); }
html body a.htc-id-btn .htc-id-logo { color: var(--primary); }
html.darkmode body a.htc-id-btn { color: var(--primary-foreground); }
html.darkmode body a.htc-id-btn .htc-id-logo { background: var(--primary-foreground); color: var(--primary); }

/* Row "…" menus escaped from clipping tables (portal.js places them position:fixed; 27/11/2026). */
html body .cm-app .dropdown-menu.cm-dd-fixed { z-index: 1060; max-width: calc(100vw - 16px); overscroll-behavior: contain; }
html body .cm-app .dropdown-menu.cm-dd-fixed .dropdown-item { white-space: nowrap; }


/* ==== portal-services.css ==== */
/* HiTechCloud portal — services pages (service list, service detail, domains, service groups).
   Uses the tokens and components of portal.css; page-specific rules only. */

/* ---------- List toolbar ---------- */
/* main.js [data-sorter] puts .active on the <li>, not on the link. */
.cm-seg > li { list-style: none; display: flex; }
.cm-seg > li.active > a { background: var(--surface); color: var(--foreground) !important; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06); }
.cm-filter-btn.shown { background: var(--secondary) !important; }

.cm-filters { margin-bottom: 12px; }
.cm-filters .cm-card__body { display: flex; flex-direction: column; gap: 16px; }
.cm-filters__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 16px; }
@media (min-width: 768px) { .cm-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cm-filters__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cm-filters__grid label { margin-bottom: 6px; }
.cm-filters__checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.cm-filters__checks label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.cm-filters__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-filters .input-group > .custom-select, .cm-filters .input-group > select.form-control { flex: 0 0 64px; max-width: 64px; }

/* Sortable headers (main.js swaps the Material ligature inside .sort-icon) */
.cm-app .table thead th a[data-sorter] { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.cm-app .table thead th a[data-sorter]:hover { color: var(--foreground); }
.cm-app .table thead th .sort-icon { order: 2; font-size: 16px !important; opacity: .6; }

/* ---------- Service rows ---------- */
.cm-svc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cm-svc-name__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--item-hover); color: color-mix(in srgb, var(--foreground) 72%, transparent); }
.cm-svc-name__text { min-width: 0; }
.cm-svc-name__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 500; }
.cm-svc-name__title a { color: var(--foreground); }
.cm-svc-name__title a:hover { color: var(--primary); text-decoration: none; }
.cm-svc-name__sub { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.cm-svc-name__sub .cm-mono { font-size: 12px; }
.cm-label-badge:empty { display: none !important; }
.cm-app .badge.cm-label-badge { background: var(--neutral-bg); color: var(--neutral); }
.cm-app .badge.cm-label-badge::before { display: none; }
.cm-row-actions { display: inline-flex; align-items: center; gap: 4px; }
.cm-app .table tr.expired td:first-child, .cm-app .table tr.nearexpire td:first-child { box-shadow: inset 2px 0 0 var(--warning); }
.cm-app .table tr.expired td:first-child { box-shadow: inset 2px 0 0 var(--error); }
.cm-expiry-note { display: block; font-size: 12px; color: var(--muted); }
.cm-expiry-note.is-warning { color: var(--warning); }
@media (max-width: 575.98px) {
  .cm-app table.cm-stack-sm td.cm-td-first { padding-bottom: 6px; }
  .cm-app table.cm-stack-sm .cm-row-actions { margin-top: 6px; }
}

/* ---------- Service / domain detail ---------- */
.cm-record-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cm-record-head__title h1 { margin: 0; font-size: 18px; font-weight: 600; text-wrap: balance; }
.cm-meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cm-meta-item .cm-i { color: var(--muted); }
.cm-meta-item a { color: var(--foreground); }

.cm-svc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1200px) {
  .cm-svc-layout--left { grid-template-columns: 220px minmax(0, 1fr); }
  .cm-svc-layout--right { grid-template-columns: minmax(0, 1fr) 220px; }
  .cm-svc-layout--right > .cm-svc-side { order: 2; }
}
.cm-svc-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Side navigation built from left_nav_service.tpl / left_nav_domain.tpl (<li class="nav-item"><a class="nav-link">) */
.cm-svc-nav { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.cm-svc-nav::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { .cm-svc-nav { flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 24px); } }
.cm-svc-nav > li { list-style: none; flex-shrink: 0; }
.cm-svc-nav .nav-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; line-height: 1.35; color: color-mix(in srgb, var(--foreground) 72%, transparent) !important; white-space: nowrap; text-decoration: none !important; }
@media (min-width: 1200px) { .cm-svc-nav .nav-link { white-space: normal; } }
.cm-svc-nav .nav-link:hover { background: var(--item-hover); color: var(--foreground) !important; }
.cm-svc-nav .nav-link.active { background: var(--secondary); color: var(--foreground) !important; font-weight: 500; }
.cm-svc-nav .nav-link.text-danger { color: var(--danger) !important; }
.cm-svc-nav .nav-link.text-danger:hover { background: var(--danger-bg); }
.cm-svc-nav li.last { margin-top: 8px; }
.cm-svc-nav .widg-image, #vm-menu .widg-image { display: none !important; }

/* App widgets row (#vm-menu: main.js folds overflow into a "More" dropdown) */
.cm-app #vm-menu { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; visibility: visible; }
.cm-app #vm-menu:empty { display: none; }
.cm-app #vm-menu > li { list-style: none; flex-shrink: 0; }
.cm-app #vm-menu > li > a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--foreground) !important; white-space: nowrap; text-decoration: none !important; }
.cm-app #vm-menu > li > a:hover { background: var(--button-hover); }
.cm-app #vm-menu > li > a.active { background: var(--secondary); border-color: transparent; }
.cm-app #vm-menu > li > a.text-danger { color: var(--danger) !important; border-color: transparent; background: var(--danger-bg); }
.cm-app #vm-menu .dropdown-menu > li > a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--foreground) !important; text-decoration: none !important; white-space: nowrap; }
.cm-app #vm-menu .dropdown-menu > li > a:hover { background: var(--item-hover); }
.cm-app #vm-menu .dropdown-menu > li > a.text-danger { color: var(--danger) !important; }
.cm-svc-apps { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cm-svc-apps:has(#vm-menu:empty) { display: none; }

/* Widget content rendered by modules / widgets */
.cm-app .cm-svc-main .widget { min-width: 0; }

/* Spec grid inside a card (VPS limits, IPMI) */
.cm-spec-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .cm-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-spec { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; border-top: 1px solid var(--border); min-width: 0; }
.cm-spec:nth-child(1) { border-top: 0; }
@media (min-width: 768px) { .cm-spec:nth-child(2) { border-top: 0; } }
.cm-spec__label { font-size: 13px; color: var(--muted); }
.cm-spec__value { font-size: 14px; overflow-wrap: anywhere; }
.cm-spec__value.cm-mono { font-size: 13px; }
.cm-spec__value a { color: var(--primary); }
.cm-spec__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.cm-dl dd .cm-inline-link { margin-left: 8px; font-size: 13px; }
.cm-dl dd .badge + .cm-inline-link { margin-left: 8px; }

/* Cancellation request */
.cm-cancel-reasons { display: flex; flex-direction: column; gap: 8px; }
.cm-cancel-reasons label { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; cursor: pointer; }
.cm-cancel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cm-cancel-actions .form-control { width: auto; min-width: 220px; }

/* Domain list: bulk action bar + toggles from domains-toggle.css */
.cm-app .domains-table thead.noncrucial th { height: auto; padding: 10px 16px; background: var(--item-hover) !important; color: var(--foreground) !important; font-size: 13px; }
.cm-app .domains-table .selected-names { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; }
.cm-app .domain-widgets .btn { min-width: 32px; }
.cm-app .domain-widgets { white-space: nowrap; }
@media (max-width: 575.98px) { .cm-app .domains-table thead.noncrucial { display: none; } }

/* ---------- Neutralise legacy layout rules (combined.min.css) inside the new detail page ---------- */
.cm-app .section-account.section-account-service.cm-svc-layout { display: grid; flex-direction: initial; margin: 0; }
.cm-app .section-account .service-details.cm-card { display: block; overflow: hidden; }
.cm-app .cm-svc-apps #vm-menu,
.cm-app .cm-svc-apps .cloud #vm-menu { position: static; top: auto; right: auto; left: auto; width: auto; max-width: 100%; max-height: none; justify-content: flex-start; flex: 1 1 auto; transition: none; }
.cm-app .cm-svc-apps #vm-menu li { background: transparent; }
.cm-app .cm-svc-apps #vm-menu > li > a { padding: 0 12px; font-weight: 500; font-size: 14px; line-height: 1; border-radius: var(--radius-sm); }
.cm-app .cm-svc-apps #vm-menu > li > a:hover { background: var(--button-hover); }
.cm-app .cm-svc-apps #vm-menu > li > a.dropdown-toggle { padding: 0 12px; }
.cm-app .cm-svc-apps #vm-menu .dropdown-menu li { background: transparent; }
.cm-app .services-table .cm-td-num { white-space: nowrap; }
.cm-app .cm-svc-nav.leftnavigation-box > li, .cm-app .cm-svc-nav.leftnavigation-box > li.nav-item { background: transparent; border: 0; margin: 0; padding: 0; box-shadow: none; }
.cm-app .cm-svc-nav.leftnavigation-box > li > a { margin: 0; border: 0; box-shadow: none; }
.cm-app .cm-svc-nav.leftnavigation-box { margin-right: 0; }
.cm-app .cm-svc-nav.leftnavigation-box .nav-item .nav-link { padding: 8px 12px; line-height: 1.35; font-weight: 400; color: color-mix(in srgb, var(--foreground) 72%, transparent) !important; }
.cm-app .cm-svc-nav.leftnavigation-box .nav-item:hover .nav-link { color: var(--foreground) !important; font-weight: 400; }
.cm-app .cm-svc-nav.leftnavigation-box .nav-item .nav-link.active { font-weight: 500; color: var(--foreground) !important; }
.cm-app .cm-svc-nav.leftnavigation-box .nav-item .nav-link.text-danger { color: var(--danger) !important; }
@media (max-width: 767.98px) { .cm-head-wrap .cm-page-head__actions { flex-shrink: 1; min-width: 0; width: 100%; } }
@media (max-width: 575.98px) {
  .cm-app table.services-table.cm-stack-sm tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .cm-app table.services-table.cm-stack-sm td { width: auto; padding: 0; }
  .cm-app table.services-table.cm-stack-sm td.cm-td-first { grid-column: 1 / -1; }
  .cm-app table.services-table.cm-stack-sm td[data-label]::before { display: none; }
  .cm-app table.services-table.cm-stack-sm td.cm-td-num { text-align: right !important; font-weight: 500; }
  .cm-app table.services-table.cm-stack-sm td.cm-num { font-size: 13px; color: var(--muted); padding-left: 44px; }
  .cm-app table.services-table.cm-stack-sm td.cm-num::before { display: inline !important; content: attr(data-label) " "; }
  .cm-app table.services-table.cm-stack-sm td:nth-child(2) { padding-left: 44px; }
  .cm-app table.services-table.cm-stack-sm .cm-row-actions { margin: 0; justify-content: flex-end; }
}
@media (max-width: 575.98px) { .cm-app table.services-table.cm-stack-sm td.cm-td-actions { text-align: right !important; justify-self: end; } }
.cm-app .cm-toggle.is-on { background: var(--primary) !important; }
.cm-app .cm-toggle-buy { display: inline; padding: 0 !important; background: none !important; border: 0 !important; color: var(--primary) !important; font-size: 13px; font-weight: 500; white-space: nowrap; }
.cm-app .cm-toggle-buy:hover { text-decoration: underline; }
/* Domain rows under sm: checkbox · name / status · expiry / two toggles / actions */
@media (max-width: 575.98px) {
  .cm-app table.domains-table.cm-stack-sm tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .cm-app table.domains-table.cm-stack-sm td { width: auto; padding: 0; }
  .cm-app table.domains-table.cm-stack-sm td.noncrucial { grid-column: 1; grid-row: 1; }
  .cm-app table.domains-table.cm-stack-sm td.cm-td-first { grid-column: 2 / 4; grid-row: 1; }
  .cm-app table.domains-table.cm-stack-sm td[data-label]::before { display: none; }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(3) { grid-column: 2; }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(5) { grid-column: 3; text-align: right !important; }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(6), .cm-app table.domains-table.cm-stack-sm td:nth-child(7) { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(6) { grid-column: 2; }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(7) { grid-column: 3; }
  .cm-app table.domains-table.cm-stack-sm td:nth-child(6)::before, .cm-app table.domains-table.cm-stack-sm td:nth-child(7)::before { display: inline !important; content: attr(data-label); }
  .cm-app table.domains-table.cm-stack-sm td.cm-td-actions { grid-column: 2 / 4; text-align: right !important; }
  .cm-app table.domains-table.cm-stack-sm .cm-expiry-note { font-size: 12px; }
}

/* ==== 2026-12-04 (hostbill-upgrade-20261204): legacy module markup inside service widgets ====
   Module widgets (OVH dedicated, IPAM, VPS plugins, DCI6…) still ship Bootstrap 2/3 markup (.progress .bar, .label-*,
   .span4, .wbox, .panel). On the Bootstrap 4 theme their progress bars were invisible and labels unstyled.
   Scoped to .widget (service/domain detail widget containers only). */
.widget .progress.widget-progress, .widget .progress:not(.cm-progress) { position: relative; height: 20px; background: var(--surface-tint); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; box-shadow: none; }
.widget .progress .bar { height: 100%; min-width: 2px; background: color-mix(in srgb, var(--primary) 28%, transparent); border-right: 2px solid var(--primary); transition: width .3s; }
.widget .widget-progress span { color: var(--foreground); text-shadow: none; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; }
.widget .label { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--surface-tint); color: var(--muted-strong); border: 1px solid var(--border); }
.widget .label-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.widget .label-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.widget .label-important, .widget .label-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.widget .label-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.widget .row > [class^="span"], .widget .row > [class*=" span"] { flex: 1 1 260px; max-width: 100%; padding: 0 15px; margin-bottom: 12px; }
.widget .wbox, .widget .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card, 12px); margin-bottom: 16px; box-shadow: none; }
.widget .wbox { padding: 16px; }
.widget .panel > .panel-heading { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-tint); font-weight: 600; border-radius: var(--radius-card, 12px) var(--radius-card, 12px) 0 0; }
.widget .panel > .panel-body { padding: 16px; }
.widget h2 { font-size: 18px; font-weight: 650; margin: 0 0 8px; }
.widget h3 { font-size: 15px; font-weight: 650; margin: 16px 0 6px; }
.widget table td[align="right"] { text-align: left; }
@media (max-width: 767.98px) {
  .widget table.table, .widget table.checker, .widget table.display { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .widget table td[width] { width: auto; }
}


/* ==== portal-billing.css ==== */
/* HiTechCloud portal — billing pages. Uses the tokens and components of portal.css; page-specific rules only. */

/* Balance summary under the billing page head: two cells, not four. */
.cm-billing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
@media (min-width: 992px) { .cm-billing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; } }
.cm-stat__value.is-warning { color: var(--warning); }

/* Sub-navigation of the billing area (clientarea/top_nav.tpl) sits right under the stats. */

/* Status tabs: main.js [data-sorter] toggles .active on the <li>. */
.cm-seg li { list-style: none; border-radius: 8px; }
.cm-seg li.active { background: var(--surface); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06); }
.cm-seg li.active > a { color: var(--foreground) !important; }
html.darkmode .cm-seg li.active { background: var(--secondary-hover); }

/* Sortable header: label then a small arrow. .sort-icon stays a Material glyph because main.js writes
   the glyph name into it ("unfold_more" / "expand_less" / "expand_more"). */
.cm-sort .sort-icon { font-size: 14px !important; line-height: 1; color: var(--muted); }
.cm-th-num .cm-sort { flex-direction: row; }
.cm-app .table thead th .cm-sort { font-size: 12px; font-weight: 500; }

/* Checkbox column */
.cm-app .table .cm-td-check { width: 44px; padding-right: 0; }
.cm-app .table .cm-td-check input { width: 16px; height: 16px; vertical-align: middle; }

/* Overdue: due date and badge in red; the row itself stays neutral. */
.cm-overdue { color: var(--error-strong); font-weight: 500; }
.cm-app .table td .cm-row-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }

/* Toolbar above billing tables */
.cm-billing-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.cm-billing-toolbar__end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cm-billing-toolbar .payall-selected { display: none; }
@media (max-width: 575.98px) {
  .cm-billing-toolbar__end { margin-left: 0; width: 100%; }
  .cm-billing-toolbar__end .btn { flex: 1 1 auto; }
}

/* Filter box (toggled by #service-filters in top_nav) */
.cm-app .filters-box { margin: 0 0 12px !important; padding: 16px 20px !important; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cm-filters-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 16px; align-items: end; }
@media (min-width: 768px) { .cm-filters-grid { grid-template-columns: 1fr 2fr 1fr auto; } }
.cm-filters-grid .form-group { margin: 0; }

/* Pagination: ‹ 1 2 3 ›. main.js inserts li.page-li between the two arrow items. */
.cm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.cm-pager .pagination { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cm-pager .page-item-left .page-link, .cm-pager .page-item-right .page-link { width: 32px; padding: 0; color: var(--muted); }
.cm-pager .page-item-left .page-link:hover, .cm-pager .page-item-right .page-link:hover { color: var(--foreground); }

/* Add funds */
.cm-funds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1200px) { .cm-funds { grid-template-columns: minmax(0, 1fr) 22rem; } }
.cm-funds-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) { .cm-funds-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cm-funds-form .form-group { margin: 0; }
.cm-funds-form .cm-funds-form__full { grid-column: 1 / -1; }
.cm-amount { position: relative; }
.cm-amount .form-control { padding-right: 56px; font-variant-numeric: tabular-nums; }
.cm-amount__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }
.cm-funds-note { display: flex; gap: 12px; padding: 16px 20px; }
.cm-funds-note + .cm-funds-note { border-top: 1px solid var(--border); }
.cm-funds-note .cm-i { margin-top: 2px; color: var(--muted); }
.cm-funds-note strong { display: block; font-size: 14px; font-weight: 500; }
.cm-funds-note span { font-size: 13px; color: var(--muted); }
.cm-card__foot--actions { justify-content: flex-start; color: var(--foreground); }

/* Result pages (thank you / payment failed) */
.cm-result { max-width: 560px; margin: 24px auto; text-align: center; }
.cm-result .cm-card__body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; }
.cm-result__icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); margin-bottom: 8px; }
.cm-result__icon.is-success { background: var(--success-bg); color: var(--success); }
.cm-result__icon.is-danger { background: var(--error-bg); color: var(--error-strong); }
.cm-result h1 { margin: 0; font-size: 20px; }
.cm-result p { margin: 0; max-width: 46ch; color: var(--muted); }
.cm-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }

/* Card on file */
.cm-cc { display: flex; align-items: center; gap: 16px; }
.cm-cc__brand { width: 48px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--item-hover); color: var(--muted); }
.cm-cc__num { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* Estimate badges (legacy class names) */
.cm-app .badge-estimate-Draft, .cm-app .badge-estimate-Sent { background: var(--warning-bg); color: var(--warning); }
.cm-app .badge-estimate-Accepted, .cm-app .badge-estimate-Invoiced { background: var(--success-bg); color: var(--success); }
.cm-app .badge-estimate-Dead, .cm-app .badge-estimate-Rejected { background: var(--error-bg); color: var(--error-strong); }
.cm-app .badge-Receiptunpaid { background: var(--warning-bg); color: var(--warning); }
.cm-app .badge-Receiptpaid { background: var(--success-bg); color: var(--success); }

/* Invoice rows under sm: two-line row — "#id [status] … amount" / "Hạn dd/mm/yyyy … [Thanh toán]". */
@media (max-width: 575.98px) {
  .cm-app table.invoices-table.cm-stack-sm tr { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
  .cm-app table.invoices-table.cm-stack-sm td { width: auto; padding: 0; }
  .cm-app table.invoices-table.cm-stack-sm td[data-label]::before { display: none; }
  .cm-app table.invoices-table td.cm-inv-main { grid-column: 1; grid-row: 1; }
  .cm-app table.invoices-table td.cm-inv-status { grid-column: 2; grid-row: 1; min-width: 0; }
  .cm-app table.invoices-table td.cm-inv-amount { grid-column: 3; grid-row: 1; text-align: right !important; font-weight: 500; }
  .cm-app table.invoices-table td.cm-inv-due { grid-column: 1 / 3; grid-row: 2; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .cm-app table.invoices-table.cm-stack-sm td.cm-inv-due::before { display: inline; content: attr(data-short) " "; color: var(--muted); font-size: 13px; }
  .cm-app table.invoices-table td.cm-inv-due.cm-overdue { color: var(--error-strong); }
  .cm-app table.invoices-table td.cm-inv-actions { grid-column: 3; grid-row: 2; justify-self: end; }
  .cm-app table.invoices-table td.cm-inv-actions .cm-dl-unpaid { display: none; }
  .cm-app table.invoices-table td[colspan] { grid-column: 1 / -1; }
}

/* Payment method as selectable cards (radio, same name as the old <select>). */
.cm-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cm-choice { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400 !important; }
.cm-choice:hover { background: var(--surface-hover); }
.cm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cm-choice__dot { width: 16px; height: 16px; flex-shrink: 0; border-radius: 9999px; border: 1px solid var(--border-strong); background: var(--surface); }
.cm-choice__label { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.cm-choice:has(input:checked) { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--ring-focus); }
.cm-choice input:checked + .cm-choice__dot { border: 5px solid var(--primary); }
@media (max-width: 575.98px) {
  .cm-billing-stats .cm-stat__icon, .cm-billing-stats .cm-stat__sub { display: none; }
  .cm-billing-stats { grid-template-columns: minmax(0, 1fr); }
  .cm-billing-stats .cm-stat__value { font-size: 18px; }
}
.cm-cc__brand img { height: 22px !important; width: auto; max-width: 40px; }
.cm-cc .cm-row__main { min-width: 0; }
@media (max-width: 575.98px) { .cm-cc { gap: 12px; } }
.checkout table td { padding: 6px 8px 6px 0; vertical-align: middle; font-size: 14px; }

/* Invoice view: payment card + document. Payment first on narrow screens, right column from 1200px. */
.cm-invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1200px) {
  .cm-invoice-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
  .cm-invoice-layout .cm-invoice-pay { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--topbar-h) + 24px); }
  .cm-invoice-layout .cm-invoice-doc { grid-column: 1; grid-row: 1; }
}
.cm-app .cm-invoice-doc.info-box, .cm-app .cm-invoice-pay.info-box { padding: 0 !important; margin: 0; }
.cm-invoice-doc .invoice-iframe { padding: 0 !important; border: 0 !important; background: transparent !important; }
.cm-invoice-doc iframe { display: block; min-height: 480px; border-radius: var(--radius); }
.cm-invoice-pay__total { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.cm-invoice-pay__amount { font-size: 24px; font-weight: 600; line-height: 1.3; }
.cm-invoice-pay label { display: block; margin-bottom: 6px; }
.cm-invoice-gateway { margin-top: 12px; }
.cm-invoice-gateway:empty { display: none; }
.cm-invoice-gateway img { max-width: 100%; height: auto; }
.cm-invoice-gateway .btn, .cm-invoice-gateway input[type=submit], .cm-invoice-gateway button { width: 100%; }
.cm-invoice-pay__extra { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }


/* ==== portal-support.css ==== */
/* HiTechCloud portal — support pages (tickets, knowledge base, announcements, downloads, network status).
   Uses the tokens and components of portal.css; page-specific rules only. */

/* ---- Status filter: main.js [data-sorter] toggles .active on the <li>, so the pill lives on the li ---- */
.cm-seg.cm-seg--li { margin: 0; list-style: none; }
.cm-seg.cm-seg--li > li { display: flex; border-radius: 8px; }
.cm-seg.cm-seg--li > li.active { background: var(--surface); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06); }
.cm-seg.cm-seg--li > li.active > a { color: var(--foreground) !important; }
html.darkmode .cm-seg.cm-seg--li > li.active { background: var(--secondary-hover); box-shadow: none; }

/* Sortable column headers */
.cm-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--muted) !important; text-decoration: none !important; white-space: nowrap; }
.cm-sort:hover { color: var(--foreground) !important; }
.cm-sort .cm-i { width: 14px; height: 14px; opacity: .7; }

/* Ticket list rows */
.cm-tickets .cm-td-main a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.cm-tickets td { white-space: nowrap; }
.cm-tickets td:first-child { white-space: normal; width: 100%; min-width: 0; }
.cm-tickets .cm-td-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
@media (max-width: 575.98px) {
  .cm-tickets .cm-td-main a, .cm-tickets .cm-td-sub { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .cm-tickets td { white-space: normal; }
  .cm-tickets tr { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
  .cm-app .cm-tickets.cm-stack-sm td { width: auto; }
  .cm-app .cm-tickets.cm-stack-sm tbody tr + tr { border-top: 1px solid var(--border); }
  .cm-app .cm-tickets.cm-stack-sm td:first-child { flex: 1 1 100%; width: 100%; }
  .cm-app .cm-tickets td.cm-ticket-date { margin-left: auto; text-align: right !important; color: var(--muted); font-size: 13px; }
  .cm-app .cm-tickets td.cm-ticket-date::before { content: none !important; }
  .cm-app .cm-tickets td[data-label]::before { content: none; }
}

/* Pagination inside a table footer (components/pagination.tpl markup) */
.cm-table-foot .d-flex.mt-4 { margin: 0 !important; }
.cm-table-foot .pagination .page-item-left .page-link,
.cm-table-foot .pagination .page-item-right .page-link { gap: 4px; padding: 0 10px; }
.cm-table-foot .pagination .material-icons { font-size: 16px; }

/* ---- Ticket view ---- */
.cm-ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.cm-ticket-meta .cm-sep { width: 3px; height: 3px; border-radius: 9999px; background: currentColor; opacity: .6; }
.cm-ticket-actions form { display: inline-flex; margin: 0; }

.cm-thread { list-style: none; margin: 0; padding: 0; }
.cm-msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 20px; }
.cm-msg + .cm-msg { border-top: 1px solid var(--border); }
.cm-msg__avatar { width: 32px; height: 32px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; text-transform: uppercase; background: var(--neutral-bg); color: var(--neutral); overflow: hidden; }
.cm-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cm-msg--staff .cm-msg__avatar { background: var(--primary-light); color: var(--primary-strong); }
.cm-msg--staff { background: color-mix(in srgb, var(--primary) 3%, var(--surface)); }
.cm-msg__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 32px; }
.cm-msg__name { font-size: 14px; font-weight: 500; }
.cm-msg__role { font-size: 12px; font-weight: 500; color: var(--primary); }
.cm-msg__time { font-size: 12px; color: var(--muted); }
.cm-msg__tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.cm-msg__body { margin: 4px 0 0; max-width: 75ch; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.cm-msg__body p { margin: 0 0 8px; }
.cm-msg__note { margin-top: 8px; font-size: 12px; color: var(--warning); }
.cm-msg__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 575.98px) {
  .cm-msg { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .cm-msg__avatar { display: none; }
}

/* Attachments (hbfiles markup is enhanced by photoswipe.js) */
.cm-msg .hbfiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cm-msg .hbfile { display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 8px 6px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.cm-msg .hbfile-placeholder-box { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--item-hover); overflow: hidden; }
.cm-msg .hbfile-placeholder-box img { max-width: 100%; max-height: 100%; }
.cm-msg .hbfile-control { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-msg .hbfile-title { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-msg .hbfile-download { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 32px; min-height: 32px; border-radius: var(--radius-sm); color: var(--muted); }
.cm-msg .hbfile-download:hover { background: var(--button-hover); color: var(--foreground); }

/* Rating stars rendered by the legacy rating plugin */
.cm-msg .rating-box { display: inline-flex; }

/* ---- Composer (reply / new ticket) ---- */
.cm-composer textarea.form-control { min-height: 140px; }
.cm-upload { border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.cm-upload #dropzone { display: none; }
.cm-upload .fileupload-buttonbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px; }
.cm-upload .fileinput-button { position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--foreground); }
.cm-upload .fileinput-button input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 100px; }
.cm-upload__hint { font-size: 12px; color: var(--muted); }
.cm-upload .bordered-section { margin: 0 16px 12px !important; }
.cm-upload .table-files td { padding: 8px 12px; font-size: 13px; }
.cm-composer__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* New ticket form column */
.cm-form-narrow { max-width: none; }
.cm-dept-hint small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted) !important; }
.cm-captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cm-captcha img { height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); }
.cm-captcha .form-control { max-width: 200px; }

/* KB hints shown under the message box (ajax.tickets.tpl action=kbhint) */
#hintarea:empty { display: none; }

/* ---- Rating page ---- */
.cm-rating-faces { display: flex; gap: 8px; }
.cm-rating-faces .rating-icon { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13px; color: var(--foreground); }
.cm-rating-faces .rating-icon:hover { background: var(--button-hover); }
.cm-rating-faces .rating-icon .cm-i { width: 24px; height: 24px; }

/* ---- Knowledge base / announcements / downloads ---- */
.cm-kb-search { position: relative; max-width: 640px; }
.cm-kb-search .cm-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--muted); pointer-events: none; }
.cm-app .cm-kb-search .form-control { padding-left: 40px !important; padding-right: 110px !important; height: 44px !important; }
.cm-kb-search .btn { position: absolute; right: 4px; top: 4px; min-height: 36px !important; }
.cm-cards-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 992px) { .cm-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .cm-cards-2--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-row .cm-row__chev { color: var(--muted); flex-shrink: 0; }
.cm-row__thumb { width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--radius-sm); object-fit: cover; }

.cm-article { max-width: none; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.cm-article h1, .cm-article h2, .cm-article h3, .cm-article h4 { margin: 1.4em 0 .5em; }
.cm-article h2 { font-size: 18px; } .cm-article h3 { font-size: 16px; }
.cm-article p, .cm-article ul, .cm-article ol { margin: 0 0 1em; }
.cm-article img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.cm-article pre, .cm-article code { font-size: 13px; background: var(--item-hover); border-radius: 6px; }
.cm-article pre { padding: 12px 14px; overflow-x: auto; }
.cm-article code { padding: 1px 5px; color: inherit; }
.cm-article table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.cm-article table td, .cm-article table th { padding: 8px 10px; border: 1px solid var(--border); }
.cm-article a { text-decoration: underline; text-underline-offset: 2px; }
.cm-news-item { display: block; padding: 16px 20px; color: var(--foreground) !important; text-decoration: none !important; }
.cm-news-item + .cm-news-item { border-top: 1px solid var(--border); }
.cm-news-item:hover { background: var(--surface-hover); }
.cm-news-item__title { margin: 6px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.45; }
.cm-news-item__text { margin: 0; max-width: 75ch; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-news-item__meta { font-size: 13px; color: var(--muted); }
#knowledgebase_vote { margin-top: 24px; }

/* ---- Network status ---- */
.cm-netstat td, .cm-netstat th { text-align: center; }
.cm-netstat td:first-child, .cm-netstat th:first-child { text-align: left; }
.cm-netstat .cm-ok { color: var(--success); }
.cm-netstat .cm-down { color: var(--error-strong); }
.cm-netstat .loader-icon { background: none !important; display: inline-block; width: 14px; height: 14px; border-radius: 9999px; border: 2px solid var(--border-strong); border-top-color: var(--muted); animation: cm-spin .8s linear infinite; }
@keyframes cm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cm-netstat .loader-icon { animation: none; } }
.cm-composer__foot .btn { margin: 0 !important; }


/* ==== portal-account.css ==== */
/* HiTechCloud portal — account pages (settings area, security, contacts, activity logs, affiliates).
   Uses the tokens and components of portal.css; page-specific rules only. */

/* ---------- Settings area layout ---------- */
.cm-account__main { min-width: 0; max-width: 960px; }
.cm-account__main > .cm-page-head { margin-bottom: 12px; }
@media (max-width: 1199.98px) {
  /* Sub-nav becomes a scrolling row above the content. */
  .cm-account-subnav { margin: 0 -4px; padding: 0 32px 4px 4px; box-shadow: inset 0 -1px 0 var(--tab-rail); border-radius: 0; }
  .cm-account-subnav a { height: 36px; padding: 0 10px; }
}

/* ---------- Field rows (label left, control right) ---------- */
.cm-field__control { min-width: 0; }
.cm-field__value { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; overflow-wrap: anywhere; }
.cm-field__label .cm-req { margin-left: 2px; }
.cm-field .form-control-file { font-size: 14px; }
.cm-field .cm-field__desc { margin: 2px 0 0; font-size: 13px; font-weight: 400; color: var(--muted); }
.cm-check input { margin-top: 3px; flex-shrink: 0; }
.cm-check__text { display: flex; flex-direction: column; }
.cm-check__desc { font-size: 13px; color: var(--muted); }
@media (min-width: 768px) {
  .cm-field--top > label, .cm-field--top .cm-field__label { align-items: flex-start; padding-top: 10px; }
}
.cm-account .cm-card__foot > .btn:last-child, .cm-aff .cm-card__foot > .btn:last-child { margin-left: auto !important; }
.cm-account .cm-card__foot > .btn + .btn { margin-left: 0 !important; }
.cm-card__section-title { margin: 0; padding: 16px 20px 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.cm-card__intro { margin: 0; padding: 16px 20px 0; font-size: 14px; color: var(--muted); max-width: 70ch; }

/* intl-tel-input wraps the phone field */
.cm-field .iti { width: 100%; }

/* ---------- Underline tabs row (billing / history) ---------- */
.cm-tabs-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; box-shadow: inset 0 -1px 0 var(--tab-rail); }
.cm-tabs-row .cm-tabs { flex: 1 1 auto; min-width: 0; margin: 0; box-shadow: none; }
.cm-tabs-row__action { margin-bottom: 4px; flex-shrink: 0; }
@media (max-width: 991.98px) {
  .cm-tabs-row { flex-wrap: wrap; }
  .cm-tabs-row .cm-tabs { flex-basis: 100%; }
  .cm-tabs-row__action { order: -1; margin: 0 0 4px auto; }
}
.cm-tabs li { list-style: none; }

/* ---------- Tables in account pages ---------- */
.cm-account .table .sortorder, .cm-account .table [data-sorter], .cm-aff .table .sortorder, .cm-aff .table [data-sorter] {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none;
}
.cm-account .table .sortorder:hover, .cm-account .table [data-sorter]:hover, .cm-aff .table .sortorder:hover, .cm-aff .table [data-sorter]:hover { color: var(--foreground); }
.cm-account .table .sort-icon, .cm-aff .table .sort-icon { font-size: 16px !important; order: 2; opacity: .7; }
.cm-account .pagination, .cm-aff .pagination { margin-top: 12px; }
.cm-table-empty { padding: 32px 16px !important; text-align: center; color: var(--muted); }

/* ---------- Security ---------- */
.cm-ip-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 768px) { .cm-ip-form { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; } }
.cm-rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.cm-rules code { color: var(--foreground); background: var(--item-hover); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.cm-account details.cm-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 20px; font-size: 14px; font-weight: 500; }
.cm-account details.cm-details > summary::-webkit-details-marker { display: none; }
.cm-account details.cm-details > summary .cm-chevron { margin-left: auto; transition: transform .2s; color: var(--muted); }
.cm-account details.cm-details[open] > summary .cm-chevron { transform: rotate(180deg); }
.cm-account details.cm-details > .cm-details__body { padding: 0 20px 16px; }

/* ---------- Danger zone ---------- */
.cm-danger-card { border-color: var(--error-border) !important; }
.cm-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.cm-danger-row__text { flex: 1 1 280px; min-width: 0; }
.cm-danger-row__title { margin: 0; font-size: 14px; font-weight: 500; }
.cm-danger-row__desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Message / email detail ---------- */
.cm-message-body { padding: 20px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.cm-message-body img { max-width: 100%; height: auto; }
.cm-back-link { display: inline-flex; align-items: center; gap: 4px; height: 32px; font-size: 14px; color: var(--muted) !important; text-decoration: none !important; }
.cm-back-link:hover { color: var(--foreground) !important; }

/* ---------- Contacts privileges ---------- */
.cm-priv-group + .cm-priv-group { border-top: 1px solid var(--border); }
.cm-priv-group { padding: 16px 20px; }
.cm-priv-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 500; }
.cm-priv-group__head label { margin: 0; font-weight: 600 !important; }
.cm-priv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 16px; }
@media (min-width: 768px) { .cm-priv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .cm-priv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-priv-grid label { margin: 0; font-weight: 400 !important; }
.cm-priv-grid .cm-check { align-items: flex-start; }
.cm-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; color: var(--foreground) !important; text-decoration: none !important; }
.cm-chip:hover { background: var(--button-hover); }
.cm-ns-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 768px) { .cm-ns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-account-form .form-label-placeholder { display: none; }
.cm-signup-fields { padding: 20px 20px 4px; }
.cm-signup-fields .row { margin-left: -8px; margin-right: -8px; }
.cm-signup-fields .row > [class*="col"] { padding-left: 8px; padding-right: 8px; }

/* ---------- Affiliates ---------- */
.cm-aff-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cm-aff-link input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px !important; }
.cm-perks { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .cm-perks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-perk { padding: 16px 20px; border-color: var(--border); border-style: solid; border-width: 1px 0 0 0; }
.cm-perks > .cm-perk:first-child { border-top: 0; }
@media (min-width: 992px) {
  .cm-perk { border-width: 0 0 0 1px; }
  .cm-perks > .cm-perk:first-child { border-left: 0; }
  .cm-perks > .cm-perk:nth-child(n+4) { border-top-width: 1px; }
  .cm-perks > .cm-perk:nth-child(3n+1) { border-left: 0; }
}
.cm-perk__value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-perk__label { font-size: 14px; font-weight: 500; }
.cm-perk__text { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.cm-aff pre, .cm-aff .alert-default { white-space: pre-wrap; word-break: break-all; padding: 12px; border-radius: var(--radius-sm); background: var(--item-hover); font-size: 12px; border: 0; }
.cm-aff .table td .cm-td-sub { margin-top: 2px; }
.cm-aff-intro { max-width: 640px; margin: 24px auto; text-align: center; }
.cm-aff-intro .cm-card__body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cm-aff-intro .cm-terms { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; }
#slider.slides { max-width: 100%; }
.cm-aff .invoice-iframe iframe { border: 0; width: 100%; }
.cm-account__actions { display: flex; justify-content: flex-end; gap: 8px; }
.cm-check input[type=checkbox], .cm-check input[type=radio], .cm-priv-grid input[type=checkbox], .cm-priv-group__head input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); }
/* Legacy theme paints a grey ::after box over every checkbox/radio (checked = grey). Show the native control
   in the accent colour instead. Scoped to the account area; worth moving to portal.css site-wide. */
.cm-account input[type=checkbox]::after, .cm-account input[type=radio]::after,
.cm-aff input[type=checkbox]::after, .cm-aff input[type=radio]::after,
.cm-account-form input[type=checkbox]::after, .cm-account-form input[type=radio]::after { content: none !important; display: none !important; }
.cm-account__main > .cm-tabs-row { margin-bottom: 4px; }
.cm-tabs-row .nav-tabs-wrapper .nav-tabs { box-shadow: none; }
.cm-tab-count { margin-left: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-tabs-row .nav-tabs { margin: 0; }
@media (max-width: 991.98px) { .cm-account .cm-hide-md { display: none; } }

/* .cm-check is also defined by portal-support.css (muted span) and portal-auth.css; keep account labels readable. */
.cm-account .cm-check > span, .cm-account .cm-check__text > span:first-child, .cm-aff .cm-check > span { color: var(--foreground); }
.cm-account .cm-check .cm-check__desc { color: var(--muted); }
#priv_serv > .cm-priv-group, #priv_dom > .cm-priv-group { border-top: 1px solid var(--border); }
.cm-aff-options { margin: 0; }
.cm-aff-options td { padding: 14px 20px !important; }
.cm-aff-options__label { display: block; font-size: 14px; font-weight: 500; margin: 0; }
.cm-aff .cm-grid > .cm-card + .cm-card, .cm-account .cm-grid > .cm-card + .cm-card { margin-top: 0; }
.cm-aff .table tr.cm-row-current { background: var(--primary-light); }
.cm-aff .filters-box > .d-flex { gap: 8px; }
.cm-aff #slider { max-width: 100% !important; box-sizing: border-box; }
/* drawclientinfo.tpl (checkout): label/value pairs in two columns */
.cm-dl--grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .cm-dl--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .cm-dl--grid .cm-dl__row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; }
  .cm-dl--grid .cm-dl__row:nth-child(2) { border-top: 0; }
}
.cm-dl--grid .cm-dl__row { padding-left: 0; padding-right: 0; }

/* Affiliate overview: two rows of two columns (terms | earnings, statistics + integration code | referral link + options). */
.cm-aff-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1200px) { .cm-aff-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-aff-pair > .cm-card + .cm-card { margin-top: 0; }
.cm-aff-head-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
/* Row 1: terms take two thirds so the perks keep their 3 x 2 grid; earnings stack in the narrow third. */
@media (min-width: 1200px) {
  .cm-aff-pair--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .cm-aff-pair--wide .cm-aff-figs { grid-template-columns: minmax(0, 1fr); }
}
/* Earnings */
.cm-aff-figs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 576px) { .cm-aff-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-aff-fig { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.cm-aff-fig__label { font-size: 13px; color: var(--muted); }
.cm-aff-fig__value { font-size: 20px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cm-aff-bar { display: flex; height: 8px; border-radius: 9999px; overflow: hidden; background: var(--item-hover); }
.cm-aff-bar > span { display: block; height: 100%; }
.cm-aff-bar .is-available, .cm-aff-legend__dot.is-available { background: var(--success); }
.cm-aff-bar .is-withdrawn, .cm-aff-legend__dot.is-withdrawn { background: var(--primary); }
.cm-aff-bar .is-pending, .cm-aff-legend__dot.is-pending { background: var(--warning); }
.cm-aff-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.cm-aff-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cm-aff-legend__dot { width: 8px; height: 8px; border-radius: 9999px; }
.cm-aff-withdraw { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border); }
.cm-aff-withdraw__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.cm-aff-withdraw__title { font-size: 14px; font-weight: 500; }
.cm-aff-withdraw__desc { font-size: 13px; color: var(--muted); }
/* Statistics */
.cm-aff-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cm-aff-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; min-width: 0; border-color: var(--border); border-style: solid; border-width: 0 0 1px 0; }
.cm-aff-kpi:nth-child(odd) { border-right-width: 1px; }
.cm-aff-kpis > .cm-aff-kpi:nth-last-child(-n+2):nth-child(odd), .cm-aff-kpis > .cm-aff-kpi:last-child { border-bottom-width: 0; }
.cm-aff-kpi__value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cm-aff-kpi__total { font-size: 14px; font-weight: 400; color: var(--muted); }
.cm-aff-kpi__label { font-size: 13px; color: var(--muted); }
/* Referral link */
.cm-aff-field-label { display: block; margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 400; }
.cm-aff-note { margin: 0; font-size: 13px; color: var(--muted); }
.cm-aff-note code { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--item-hover); color: var(--foreground); }
.cm-aff-pair .tab-content > .tab-pane > .cm-card { margin-top: 8px; }
.cm-aff-subtitle { margin: 8px 0 0; font-size: 16px; font-weight: 600; }

/* Affiliate traffic page (module affiliates_traffic). */
.cm-aft-total { display: flex; flex-direction: column; gap: 4px; }
.cm-aft-total__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-aft-total__value { font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cm-aft-total__sub { font-size: 13px; color: var(--muted); }
.cm-aff-bar .is-social, .cm-aff-legend__dot.is-social { background: var(--primary); }
.cm-aff-bar .is-direct, .cm-aff-legend__dot.is-direct { background: var(--success); }
.cm-aff-bar .is-other, .cm-aff-legend__dot.is-other { background: var(--warning); }
.cm-aft-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.cm-aft-sources li { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.cm-aft-sources__pct { font-size: 16px; font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; }
.cm-aft-path { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-aft-links { table-layout: fixed; width: 100%; }
.cm-aft-links th:last-child { width: 7rem; }
.cm-aft-links .cm-aft-path { max-width: none; }
.cm-aft .cm-card__foot .pagination { flex-wrap: wrap; gap: 2px; }
.cm-aft-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cm-aft-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.cm-aft-filters select { width: auto; min-width: 11rem; }
@media (max-width: 575.98px) { .cm-aft-filters, .cm-aft-filters select { width: 100%; } .cm-aft-table .cm-aft-path { max-width: none; white-space: normal; overflow-wrap: anywhere; } }


/* ==== portal-auth.css ==== */
/* HiTechCloud portal — auth & public pages (login, signup, password reset, MFA, account picker, home, errors).
   Uses the tokens and components of portal.css; page-specific rules only. */

/* ---------- Split auth screen (login, sign-up, password reset) ----------
   Left: white form column (logo + tools on top, form centred, footer at the bottom).
   Right: dark brand panel, sticky, from 1100px. */
html body .cm-app.cm-app--auth { display: block; min-height: 100vh; background: var(--surface); }
.cm-authx { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 1100px) { .cm-authx { grid-template-columns: minmax(0, 1fr) clamp(380px, 38vw, 560px); } }
.cm-authx__main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; background: var(--surface); }
.cm-authx__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 72px; padding: 0 24px; flex-shrink: 0; }
.cm-authx__logo { display: inline-flex; align-items: center; }
.cm-authx__logo img { height: 36px; width: auto; }
.cm-authx__logo .cm-logo__dark { display: none; }
html.darkmode .cm-authx__logo .cm-logo__light { display: none; }
html.darkmode .cm-authx__logo .cm-logo__dark { display: inline; }
.cm-authx__tools { display: flex; align-items: center; gap: 4px; }
.cm-authx__body { flex: 1 0 auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px 24px 40px; }
html body .cm-app .section-main.cm-authx__content { width: 100%; max-width: 400px !important; margin: 32px 0 auto !important; }
html body .cm-app .section-main.cm-authx__content:has(.cm-auth-box--wide) { max-width: 560px !important; }
.cm-authx__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 16px; padding: 13px 24px 20px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.cm-authx__foot > * { display: inline-flex; align-items: center; min-height: 24px; }
.cm-authx__foot a { color: var(--muted) !important; }
@media (max-width: 575.98px) { .cm-authx__foot > span:first-child { flex-basis: 100%; justify-content: center; } }
.cm-authx__foot a:hover { color: var(--foreground) !important; }
@media (max-width: 575.98px) {
  .cm-authx__top { height: 64px; padding: 0 16px; }
  .cm-authx__logo img { height: 32px; }
  .cm-authx__body { padding: 16px 16px 32px; }
}

/* Brand panel: always dark, whatever the theme (M33 force-dark).
   Image (dist/images/auth-panel*): dark empty ceiling on top, mascot + GPU rack at the bottom.
   It sits on the sticky inner block (exactly one viewport tall), anchored to the bottom so the mascot is never
   cropped; short screens lose only the empty ceiling. Copy sits in that dark top area under a gradient scrim. */
.cm-authx__brand { display: none; }
@media (min-width: 1100px) {
  .cm-authx__brand { display: block; position: relative; background: #050a1a; color: #e9edf5; }
  .cm-authx__brand-inner {
    position: sticky; top: 0; height: 100vh; min-height: 560px; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 24px;
    padding: 72px clamp(32px, 4vw, 56px) 48px;
    background-color: #050a1a;
    background-image: url("../images/auth-panel.jpg");
    background-image: image-set(url("../images/auth-panel-640.webp") type("image/webp") 1x, url("../images/auth-panel.webp") type("image/webp") 2x, url("../images/auth-panel.jpg") type("image/jpeg") 1x);
    background-size: cover; background-position: center bottom; background-repeat: no-repeat;
  }
  .cm-authx__brand-inner::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgb(4 8 22 / 0.88) 0%, rgb(4 8 22 / 0.6) 34%, rgb(4 8 22 / 0) 58%);
  }
  .cm-authx__brand-inner > * { position: relative; }
}
@media (min-width: 1100px) and (min-resolution: 1.5dppx) {
  .cm-authx__brand-inner { background-image: image-set(url("../images/auth-panel.webp") type("image/webp") 1x, url("../images/auth-panel.jpg") type("image/jpeg") 1x); }
}
/* Short screens: titles only, so the copy never reaches the mascot's head (~57% down the image). */
@media (min-width: 1100px) and (max-height: 960px) {
  .cm-authx__brand-inner { padding-top: 56px; gap: 20px; }
  .cm-authx__point-text { display: none; }
  .cm-authx__points { gap: 12px; }
  .cm-authx__points li { align-items: center; }
  .cm-authx__headline { font-size: 26px; }
}
@media (min-width: 1100px) and (max-height: 780px) {
  .cm-authx__brand .cm-authx__points { display: none; }
}
.cm-authx__mark { width: 40px; height: 40px; object-fit: contain; }
.cm-authx__headline { margin: 0; max-width: 18ch; font-size: 30px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: #fff; text-wrap: balance; text-shadow: 0 1px 12px rgb(0 0 0 / 0.35); }
.cm-authx__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; max-width: 40ch; }
.cm-authx__points li { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; line-height: 1.55; color: #b4bdd0; }
.cm-authx__points strong { display: block; margin-bottom: 2px; font-size: 15px; font-weight: 600; color: #fff; }
.cm-authx__point-body { min-width: 0; }
.cm-authx__point-icon { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgb(255 255 255 / 0.1); color: #7cb8fa; backdrop-filter: blur(4px); }

/* Fallback: login/sign-up rendered under some other route inside the normal app shell.
   Hide the shell and centre the form instead of letting it stretch full width. */
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-sidebar,
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-topbar,
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-overlay { display: none !important; }
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-main { margin-left: 0 !important; background: var(--surface) !important; }
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-content { display: flex; justify-content: center; padding: 48px 16px !important; }
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .section-main { width: 100%; max-width: 400px !important; }
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box--wide) .section-main { max-width: 560px !important; }
html body .cm-app:not(.cm-app--auth):has(.cm-auth-box) .cm-footer { justify-content: center; }

.cm-auth-box { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.cm-auth-box > .cm-auth-foot { margin-top: 8px; }


/* Standalone card: white on grey, no border (M29). */
.cm-auth-panel { display: flex; flex-direction: column; gap: 24px; }
.cm-auth-head { display: flex; flex-direction: column; gap: 6px; }
.cm-auth-switch { margin: 0; font-size: 14px; color: var(--muted); }
.cm-auth-switch a { font-weight: 500; }
.cm-auth-title { margin: 0 !important; font-size: 24px !important; font-weight: 600; line-height: 1.4; text-align: left; }
.cm-auth-lead { margin: -12px 0 0; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.cm-auth-foot { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.cm-auth-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.cm-auth-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.cm-auth-field { position: relative; display: flex; flex-direction: column; gap: 8px; }
.cm-auth-field > label, .cm-app .cm-field-label { margin: 0; font-size: 14px; font-weight: 500; color: var(--foreground); width: fit-content; }
.cm-app .cm-auth-input, .cm-app .cm-auth-submit { height: 48px !important; min-height: 48px; font-size: 16px; }
.cm-app .cm-auth-submit { width: 100%; font-size: 15px; }
/* "Quên mật khẩu?": after the input in the DOM, shown on the label row (form.md). */
.cm-auth-forgot { position: absolute; top: -1.5px; right: 0; display: inline-flex; align-items: center; min-height: 24px; font-size: 14px; color: var(--foreground) !important; line-height: 21px; }
.cm-auth-forgot:hover { text-decoration: underline; }
.cm-auth-link { align-self: flex-start; display: inline-flex; align-items: center; min-height: 24px; margin-block: -2px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 500; color: var(--primary); cursor: pointer; }
.cm-auth-link:hover { text-decoration: underline; }
.cm-auth-captcha__row { display: flex; align-items: center; gap: 8px; }
.cm-auth-captcha__row .capcha { width: 120px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); object-fit: cover; cursor: pointer; }
.cm-auth-captcha__row .form-control { flex: 1 1 auto; min-width: 0; }
.cm-auth-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* "hoặc" divider: --border-strong, a hairline alone on white disappears (form.md). */
.cm-auth-or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.cm-auth-or::before, .cm-auth-or::after { content: ""; height: 1px; flex: 1 1 auto; background: var(--border-strong); }

/* Social / passkey buttons rendered by modules: equal-weight outline, logo left, same height as inputs. */
.cm-auth-alt, .cm-auth-alt .alt-login, .cm-auth-alt .text-center { display: flex; flex-direction: column; gap: 8px; margin: 0; text-align: left; }
.cm-auth-alt > link + .btn { margin-top: 0; }
.cm-app .cm-auth-alt .btn,
.cm-app .cm-auth-alt .btn-social.btn-google, .cm-app .cm-auth-alt .btn-social.btn-github,
.cm-app .cm-auth-alt .btn-social,
.cm-app .cm-auth-form [data-passkeyv2-operation] {
  position: relative; display: flex !important; align-items: center; justify-content: center; gap: 10px;
  width: 100% !important; height: 48px; min-height: 48px; margin: 0 !important; padding: 0 16px !important;
  background-color: var(--surface) !important; border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important; color: var(--foreground) !important;
  font-size: 15px; font-weight: 500; letter-spacing: 0; text-align: center; box-shadow: none !important;
}
.cm-app .cm-auth-alt .btn:hover, .cm-app .cm-auth-alt .btn-social:hover,
.cm-app .cm-auth-form [data-passkeyv2-operation]:hover { background-color: var(--button-hover) !important; }
.cm-app .cm-auth-alt .btn-social > .social-logo,
.cm-app .cm-auth-alt .btn-social > :first-child {
  position: static !important; width: 20px !important; height: 20px; flex-shrink: 0; border: 0 !important;
  background-size: 20px !important; line-height: 1;
}
.cm-app .cm-auth-form [data-passkeyv2] { margin-top: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.cm-app .cm-auth-form [data-passkeyv2-operation]::before {
  content: ""; width: 18px; height: 18px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%2010a2%202%200%200%200-2%202c0%201.02-.1%202.51-.26%204%22%20/%3E%20%3Cpath%20d%3D%22M14%2013.12c0%202.38%200%206.38-1%208.88%22%20/%3E%20%3Cpath%20d%3D%22M17.29%2021.02c.12-.6.43-2.3.5-3.02%22%20/%3E%20%3Cpath%20d%3D%22M2%2012a10%2010%200%200%201%2018-6%22%20/%3E%20%3Cpath%20d%3D%22M2%2016h.01%22%20/%3E%20%3Cpath%20d%3D%22M21.8%2016c.2-2%20.131-5.354%200-6%22%20/%3E%20%3Cpath%20d%3D%22M5%2019.5C5.5%2018%206%2015%206%2012a6%206%200%200%201%20.34-2%22%20/%3E%20%3Cpath%20d%3D%22M8.65%2022c.21-.66.45-1.32.57-2%22%20/%3E%20%3Cpath%20d%3D%22M9%206.8a6%206%200%200%201%209%205.2v2%22%20/%3E%20%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%2010a2%202%200%200%200-2%202c0%201.02-.1%202.51-.26%204%22%20/%3E%20%3Cpath%20d%3D%22M14%2013.12c0%202.38%200%206.38-1%208.88%22%20/%3E%20%3Cpath%20d%3D%22M17.29%2021.02c.12-.6.43-2.3.5-3.02%22%20/%3E%20%3Cpath%20d%3D%22M2%2012a10%2010%200%200%201%2018-6%22%20/%3E%20%3Cpath%20d%3D%22M2%2016h.01%22%20/%3E%20%3Cpath%20d%3D%22M21.8%2016c.2-2%20.131-5.354%200-6%22%20/%3E%20%3Cpath%20d%3D%22M5%2019.5C5.5%2018%206%2015%206%2012a6%206%200%200%201%20.34-2%22%20/%3E%20%3Cpath%20d%3D%22M8.65%2022c.21-.66.45-1.32.57-2%22%20/%3E%20%3Cpath%20d%3D%22M9%206.8a6%206%200%200%201%209%205.2v2%22%20/%3E%20%3C/svg%3E") center / contain no-repeat;
}

.cm-auth-done { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.cm-auth-done p { margin: 0; }
.cm-auth-done__icon { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--success-bg); color: var(--success); }

/* Login modal (public pages) and inline block */
.cm-auth-modal { max-width: 440px; }
.cm-auth-modal .modal-body { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.cm-auth-modal .close { margin: -4px -8px -4px auto; padding: 0; opacity: 1; text-shadow: none; }
.cm-auth-inline { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Sign-up ---------- */
.cm-signup-form { display: flex; flex-direction: column; gap: 24px; margin: 0; }
.cm-form-section { margin: 0; padding: 0; border: 0; min-width: 0; }
.cm-form-section + .cm-form-section { padding-top: 24px; border-top: 1px solid var(--border); }
.cm-form-section__title { margin: 0 0 16px !important; padding: 0; font-size: 16px; font-weight: 600; color: var(--foreground); }
.cm-form-col--full { grid-column: 1 / -1; }
.cm-form-grid .form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cm-form-grid .form-group.d-none { display: none !important; }
.cm-form-grid .form-group:has(> .empty-placeholder) { display: none; }
.cm-form-grid .iti { width: 100%; }
.cm-file { font-size: 14px; }
.cm-app .cm-signup-form .form-control { height: 44px; }
.cm-app .cm-signup-form textarea.form-control { height: auto; }
.cm-app .cm-signup-form .parsley-errors-list { margin: 0; padding: 0; list-style: none; }
.cm-app .cm-field-label { display: inline-flex; align-items: center; gap: 4px; }
.cm-app .cm-field-label .vtip_description { position: static !important; display: inline-block !important; width: 16px !important; height: 16px !important; margin: 0 !important; padding: 0 !important; transform: none !important; background-size: 16px 16px !important; background-position: center !important; vertical-align: middle; }
.cm-app .cm-field-label .vtip_description::before, .cm-app .cm-field-label .vtip_description::after { top: 0 !important; left: 0 !important; margin: 0 !important; line-height: 16px !important; }

/* ---------- Portal home ---------- */
.cm-root-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 992px) { .cm-root-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-app a.cm-root-action { display: flex; align-items: flex-start; gap: 16px; padding: 20px; margin: 0 !important; color: var(--foreground) !important; text-decoration: none !important; transition: border-color .15s, background-color .15s; }
.cm-app a.cm-root-action:hover { border-color: var(--border-strong) !important; background: var(--surface-hover) !important; }
.cm-root-action__icon { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--primary-light); color: var(--primary); }
.cm-root-action__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cm-root-action__title { font-size: 16px; font-weight: 600; }
.cm-root-action__desc { font-size: 14px; color: var(--muted); text-wrap: pretty; }
.cm-root-action__arrow { margin-top: 12px; color: var(--muted); }

.cm-news-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 16px 20px; color: var(--foreground) !important; text-decoration: none !important; }
.cm-news-row:hover { background: var(--surface-hover); }
@media (min-width: 768px) { .cm-news-row { grid-template-columns: 7rem minmax(0, 1fr); gap: 16px; } }
.cm-news-row__date { font-size: 13px; color: var(--muted); padding-top: 1px; }
.cm-news-row__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-news-row__title { font-size: 14px; font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-news-row:hover .cm-news-row__title { color: var(--primary); }
.cm-news-row__excerpt { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-news-row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cm-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 9999px; background: var(--neutral-bg); color: var(--neutral); font-size: 12px; font-weight: 500; }
.cm-tag__dot { width: 6px; height: 6px; border-radius: 9999px; flex-shrink: 0; }
.cm-root .cm-card__head-actions { gap: 16px; }

/* ---------- Error / status pages ---------- */
.cm-error { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 0; text-align: center; }
.cm-error__code { margin: 0; font-size: 14px; font-weight: 600; color: var(--primary); letter-spacing: .04em; }
.cm-error__icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--item-hover); color: var(--muted); margin-bottom: 8px; }
.cm-error__title { margin: 0 !important; font-size: 20px !important; font-weight: 600; max-width: 32ch; text-wrap: balance; }
.cm-error__text { margin: 0; max-width: 52ch; font-size: 14px; color: var(--muted); }
.cm-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.cm-error__details { width: 100%; max-width: 440px; margin-top: 16px; text-align: left; }
.cm-maintenance { align-items: center; text-align: center; }
.cm-maintenance .cm-auth-title { text-align: center; }
.cm-maintenance .cm-auth-lead { margin: 0; }
.cm-badbrowser { margin: 16px; }

/* Info pages (CMS HTML) */
.cm-prose { padding: 24px; font-size: 15px; line-height: 1.7; max-width: 860px; }
.cm-prose > :first-child { margin-top: 0; }
.cm-prose > :last-child { margin-bottom: 0; }
.cm-prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.cm-prose table { width: 100%; display: block; overflow-x: auto; }

/* Account picker */
.cm-userselect { gap: 16px; }
.cm-userselect .cm-input-search .form-control { min-width: 0; width: 100%; height: 44px; }
.cm-userselect__list { max-height: 400px; overflow-y: auto; margin: 0 -12px; display: flex; flex-direction: column; gap: 4px; }
.cm-userselect__list .cm-row { min-height: 56px; padding: 8px 12px; border-radius: var(--radius); border: 0 !important; }
.cm-userselect__list .cm-row:hover { background: var(--item-hover); }

/* MFA */
.cm-mfa-disable { max-width: 720px; }
.cm-app .cm-list > li.cm-row { list-style: none; }
.cm-app .cm-row__end .btn-sm { white-space: nowrap; }
.cm-app .cm-list > li.cm-row .cm-row__sub { margin-top: 4px; }
.cm-app .cm-list > li.cm-row .cm-row__end { gap: 8px; }
@media (max-width: 575.98px) {
  .cm-app .cm-list > li.cm-row { flex-wrap: wrap; }
  .cm-app .cm-list > li.cm-row .cm-row__end { width: 100%; padding-left: 44px; justify-content: flex-start; }
}

/* Brand marks for module social buttons: the module ships white logos meant for coloured buttons. */
.cm-app .cm-auth-alt .social-logo.social-google { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cpath%20fill%3D%22%23FFC107%22%20d%3D%22M43.6%2020.5H42V20H24v8h11.3C33.7%2032.7%2029.2%2036%2024%2036c-6.6%200-12-5.4-12-12s5.4-12%2012-12c3.1%200%205.8%201.2%207.9%203.1l5.7-5.7C34%206.1%2029.3%204%2024%204%2012.9%204%204%2012.9%204%2024s8.9%2020%2020%2020%2020-8.9%2020-20c0-1.3-.1-2.4-.4-3.5z%22/%3E%3Cpath%20fill%3D%22%23FF3D00%22%20d%3D%22M6.3%2014.7l6.6%204.8C14.7%2015.1%2019%2012%2024%2012c3.1%200%205.8%201.2%207.9%203.1l5.7-5.7C34%206.1%2029.3%204%2024%204%2016.3%204%209.7%208.3%206.3%2014.7z%22/%3E%3Cpath%20fill%3D%22%234CAF50%22%20d%3D%22M24%2044c5.2%200%209.9-2%2013.4-5.2l-6.2-5.2C29.2%2035.1%2026.7%2036%2024%2036c-5.2%200-9.6-3.3-11.3-7.9l-6.5%205C9.5%2039.6%2016.2%2044%2024%2044z%22/%3E%3Cpath%20fill%3D%22%231976D2%22%20d%3D%22M43.6%2020.5H42V20H24v8h11.3c-.8%202.2-2.2%204.2-4.1%205.6l6.2%205.2C37%2039.2%2044%2034%2044%2024c0-1.3-.1-2.4-.4-3.5z%22/%3E%3C/svg%3E") center / 20px no-repeat !important; }
.cm-app .cm-auth-alt .social-logo.social-github { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%231f2329%22%20d%3D%22M12%20.5C5.7.5.5%205.7.5%2012c0%205.1%203.3%209.4%207.9%2010.9.6.1.8-.3.8-.6v-2c-3.2.7-3.9-1.5-3.9-1.5-.5-1.3-1.3-1.7-1.3-1.7-1-.7.1-.7.1-.7%201.2.1%201.8%201.2%201.8%201.2%201%201.8%202.8%201.3%203.5%201%20.1-.8.4-1.3.7-1.6-2.6-.3-5.3-1.3-5.3-5.7%200-1.3.5-2.3%201.2-3.1-.1-.3-.5-1.5.1-3.1%200%200%201-.3%203.3%201.2a11.5%2011.5%200%200%201%206%200C17.3%204.7%2018.3%205%2018.3%205c.7%201.6.3%202.8.1%203.1.8.8%201.2%201.8%201.2%203.1%200%204.4-2.7%205.4-5.3%205.7.4.4.8%201.1.8%202.2v3.3c0%20.3.2.7.8.6%204.6-1.5%207.9-5.8%207.9-10.9C23.5%205.7%2018.3.5%2012%20.5z%22/%3E%3C/svg%3E") center / 20px no-repeat !important; }
html.darkmode .cm-app .cm-auth-alt .social-logo.social-github { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23e9edf5%22%20d%3D%22M12%20.5C5.7.5.5%205.7.5%2012c0%205.1%203.3%209.4%207.9%2010.9.6.1.8-.3.8-.6v-2c-3.2.7-3.9-1.5-3.9-1.5-.5-1.3-1.3-1.7-1.3-1.7-1-.7.1-.7.1-.7%201.2.1%201.8%201.2%201.8%201.2%201%201.8%202.8%201.3%203.5%201%20.1-.8.4-1.3.7-1.6-2.6-.3-5.3-1.3-5.3-5.7%200-1.3.5-2.3%201.2-3.1-.1-.3-.5-1.5.1-3.1%200%200%201-.3%203.3%201.2a11.5%2011.5%200%200%201%206%200C17.3%204.7%2018.3%205%2018.3%205c.7%201.6.3%202.8.1%203.1.8.8%201.2%201.8%201.2%203.1%200%204.4-2.7%205.4-5.3%205.7.4.4.8%201.1.8%202.2v3.3c0%20.3.2.7.8.6%204.6-1.5%207.9-5.8%207.9-10.9C23.5%205.7%2018.3.5%2012%20.5z%22/%3E%3C/svg%3E") !important; }
.cm-auth > * { flex-shrink: 0; }

/* ---------- Sign-up details ---------- */
.cm-optional { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--muted); }
.cm-segpick--hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cm-choice-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 480px) { .cm-choice-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-app .cm-choice { position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .15s, background-color .15s; }
.cm-app .cm-choice:hover { background: var(--surface-hover); }
.cm-app .cm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cm-app .cm-choice:has(input:checked) { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--ring-focus); }
.cm-app .cm-choice:has(input:focus-visible) { border-color: var(--border-focus); }
.cm-choice__icon { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--item-hover); color: var(--muted); }
.cm-app .cm-choice:has(input:checked) .cm-choice__icon { background: var(--primary-light); color: var(--primary); }
.cm-choice__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-choice__title { font-size: 14px; font-weight: 500; color: var(--foreground); }
.cm-choice__desc { font-size: 13px; color: var(--muted); }

/* Password strength meter injected by HostBill's script after the password input. */
html body .cm-app #password_strength, html body .cm-app .password_strength { width: 100% !important; height: 4px !important; margin-top: 8px; border: 0 !important; border-radius: 9999px; background: var(--secondary) !important; overflow: hidden; }
html body .cm-app .password_strength span { display: block; height: 100% !important; width: 0; border-radius: 9999px; transition: width .2s; }
html body .cm-app .password_strength_1 span { width: 20% !important; background: var(--error) !important; }
html body .cm-app .password_strength_2 span { width: 40% !important; background: var(--warning) !important; }
html body .cm-app .password_strength_3 span { width: 60% !important; background: var(--warning) !important; }
html body .cm-app .password_strength_4 span { width: 80% !important; background: var(--success) !important; }
html body .cm-app .password_strength_5 span { width: 100% !important; background: var(--success) !important; }
/* Module socialbuttons.css paints .btn-google solid red in dark mode: keep the outline button in both themes. */
html.darkmode body .cm-app .cm-auth-alt .btn-social,
html.darkmode body .cm-app .cm-auth-alt .btn-social.btn-google,
html.darkmode body .cm-app .cm-auth-alt .btn-social.btn-github { background-color: var(--surface) !important; border-color: var(--border-strong) !important; color: var(--foreground) !important; }
html.darkmode body .cm-app .cm-auth-alt .btn-social:hover { background-color: var(--button-hover) !important; }

/* passkeyv2 appends "Sign in with a passkey" to every form that has a password input: not on reminder / reset. */
html body .cm-app .section-passreminder [data-passkeyv2] { display: none !important; }

/* Show / hide password (eye button added by portal.js inside .cm-pw). Tab: input → eye → next field. */
.cm-pw { position: relative; }
html body .cm-app .cm-pw > input { padding-right: 48px !important; }
.cm-pw__toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.cm-pw__toggle:hover { background: var(--item-hover); color: var(--foreground); }
.cm-pw__toggle:focus { outline: none; }
.cm-pw__toggle .cm-i-eye-off { display: none; }
.cm-pw__toggle[aria-pressed="true"] .cm-i-eye { display: none; }
.cm-pw__toggle[aria-pressed="true"] .cm-i-eye-off { display: inline-block; }

/* ---------- Maintenance (standalone, bilingual) — 2026-11-19 ----------
   Wide announcement layout (max 1040px): top row = logo left + VI/EN switch right; header left-aligned; the three
   sections sit in 3 columns from 1024px (stacked below). No card, no big icon. VI/EN switch = visually hidden radios
   (siblings of .cm-maint__top / .cm-maint__doc) + CSS, works without JS. */
.cm-maint { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 24px 16px 24px; background: var(--surface); }
@media (min-width: 768px) { .cm-maint { padding: 32px 32px 24px; } }
.cm-maint__top, .cm-maint__update, .cm-maint__doc, .cm-maint__actions, .cm-maint__foot { width: 100%; max-width: 1040px; }
.cm-maint__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cm-maint__logo { display: inline-flex; }
.cm-maint__logo img { height: 36px; width: auto; }
@media (max-width: 575.98px) { .cm-maint__logo img { height: 30px; } }

.cm-maint__radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cm-maint__langs { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border-radius: 9999px; background: var(--neutral-bg); }
.cm-maint__lang { display: inline-flex; align-items: center; height: 32px; margin: 0; padding: 0 14px; border-radius: 9999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; user-select: none; }
@media (max-width: 374.98px) { .cm-maint__lang { padding: 0 10px; } }
.cm-maint__lang:hover { color: var(--foreground); }
#cm-maint-vi:checked ~ .cm-maint__top [for="cm-maint-vi"],
#cm-maint-en:checked ~ .cm-maint__top [for="cm-maint-en"] { background: var(--surface); color: var(--foreground); box-shadow: 0 1px 2px rgb(15 23 42 / .08); }
#cm-maint-vi:focus-visible ~ .cm-maint__top [for="cm-maint-vi"],
#cm-maint-en:focus-visible ~ .cm-maint__top [for="cm-maint-en"] { outline: 2px solid var(--primary); outline-offset: 1px; }
.cm-maint__doc--en { display: none; }
#cm-maint-en:checked ~ .cm-maint__doc--en { display: block; }
#cm-maint-en:checked ~ .cm-maint__doc--vi { display: none; }

.cm-maint__update { margin-top: 32px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--foreground); font-size: 14px; line-height: 1.6; }
.cm-maint__update p { margin: 0; }
.cm-maint__doc { margin-top: 48px; }
@media (min-width: 768px) { .cm-maint__doc { margin-top: 72px; } }

.cm-maint__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.cm-maint__badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 9999px; background: var(--warning-bg); color: var(--warning); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.cm-maint__badge::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
html body .cm-maint .cm-maint__title { margin: 0 !important; max-width: 24ch; font-size: 26px !important; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--foreground); text-wrap: balance; }
@media (min-width: 768px) { html body .cm-maint .cm-maint__title { font-size: 36px !important; } }
.cm-maint__lead { margin: 0; max-width: 72ch; font-size: 16px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }
@media (min-width: 768px) { .cm-maint__lead { font-size: 17px; } }

.cm-maint__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 32px; }
@media (min-width: 1024px) { .cm-maint__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.cm-maint__sec { min-width: 0; }
html body .cm-maint .cm-maint__h { margin: 0 0 10px !important; font-size: 15px !important; font-weight: 600; line-height: 1.4; color: var(--foreground); }
.cm-maint__sec p, .cm-maint__sign { margin: 0; font-size: 15px; line-height: 1.65; color: var(--foreground); text-wrap: pretty; }
.cm-maint__sec p + p { margin-top: 10px; }
.cm-maint__note { margin: 40px 0 0; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--neutral-bg); font-size: 15px; line-height: 1.6; color: var(--foreground); }
.cm-maint__note strong { font-weight: 600; }
.cm-maint__sign { margin-top: 32px; max-width: 80ch; color: var(--muted); }
.cm-maint__team { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--foreground); }

.cm-maint__actions { margin-top: 32px; display: flex; justify-content: flex-start; }
html body .cm-app .cm-maint__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px; font-size: 14px; font-weight: 500; border-radius: var(--radius-sm); }
.cm-maint__dot { color: var(--muted); }
@media (max-width: 639.98px) { html body .cm-app .cm-maint__btn { width: 100%; } }
@media (min-width: 768px) { html body .cm-app .cm-maint__btn { height: 40px; } }
.cm-maint__foot { margin: auto 0 0; padding-top: 48px; font-size: 12px; color: var(--muted); }
.cm-maint__foot a { color: var(--muted) !important; }
.cm-maint__foot a:hover { color: var(--foreground) !important; }


/* ==== portal-x-A.css ==== */
/* portal-x-A.css — topbar additions (agent A, 2026-10-18):
   account menu "Quay lại trang quản trị" / "Đổi người dùng", language switcher, cart preview, Status module widget. */

/* ---------- Account menu: staff-only return-to-admin row (warning tone, right under the name). ---------- */
.cm-acct-menu__admin {
  display: flex; align-items: center; gap: 10px; margin: 6px 6px 0; padding: 8px 10px;
  border: 1px solid var(--warning-border); border-radius: 8px;
  background: var(--warning-bg);
  color: var(--foreground) !important; text-decoration: none !important;
}
.cm-acct-menu__admin > .cm-i { flex-shrink: 0; color: var(--warning); }
.cm-acct-menu__admin > .cm-i--sm { margin-left: auto; color: var(--muted); }
.cm-acct-menu__admin:hover, .cm-acct-menu__admin:focus-visible { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); outline: none; }
.cm-acct-menu__admin-text { display: flex; flex-direction: column; min-width: 0; }
.cm-acct-menu__admin-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cm-acct-menu__admin-sub { font-size: 12px; line-height: 1.3; color: var(--muted); }
/* "Đổi người dùng" + "Đăng xuất" side by side. */
.cm-acct-menu__foot.is-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 767.98px) { .cm-acct-menu__admin { min-height: 44px; } }

/* ---------- Language switcher: icon + code button, names in the menu. ---------- */
.cm-lang { position: relative; flex-shrink: 0; }
.cm-lang__btn {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  color: color-mix(in srgb, var(--foreground) 72%, transparent);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.cm-lang__btn:hover, .cm-lang.show .cm-lang__btn { background: var(--item-hover); color: var(--foreground); }
.cm-lang__btn:focus { outline: none; }
.cm-lang__btn:focus-visible { box-shadow: 0 0 0 2px var(--ring-focus); }
.cm-lang__chevron { color: var(--muted); transition: transform .2s ease-out; }
.cm-lang.show .cm-lang__chevron { transform: rotate(180deg); }
html body .cm-app .cm-lang__menu.dropdown-menu { min-width: 200px; margin-top: 8px; }
.cm-lang__tag {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 28px; height: 20px; padding: 0 4px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--muted);
}
.cm-lang__menu .dropdown-item.active .cm-lang__tag { border-color: var(--primary); color: var(--primary); }
.cm-lang__menu .dropdown-item.active .cm-i { color: var(--primary); }

/* ---------- Cart preview (reuses .cm-notif head/list). ---------- */
.cm-cartdd { position: relative; flex-shrink: 0; }
html body .cm-app .cm-cartdd__menu.dropdown-menu { width: 360px; max-width: calc(100vw - 24px); margin-top: 8px; padding: 0; }
.cm-cartdd__count { font-size: 12px; font-weight: 500; color: var(--muted); }
.cm-cartdd__list { max-height: 320px; }
.cm-cartdd__item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius);
  color: var(--foreground) !important; text-decoration: none !important;
}
.cm-cartdd__item:hover, .cm-cartdd__item:focus-visible { background: var(--item-hover); outline: none; }
.cm-cartdd__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.cm-cartdd__name { font-size: 14px; font-weight: 500; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-cartdd__meta { font-size: 12px; line-height: 1.35; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-cartdd__price { flex-shrink: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-cartdd__total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted);
}
.cm-cartdd__total strong { font-size: 16px; font-weight: 700; color: var(--foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-cartdd__actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.cm-cartdd__actions .btn { flex: 1 1 0; justify-content: center; }
.cm-cartdd__menu .cm-empty { padding: 24px 16px 8px; }

/* ---------- Status module widget (stock 2019 markup: li.nav-item > a.nav-link > i + .badge). ---------- */
.cm-statusbar > li { list-style: none; position: relative; }
.cm-statusbar > li.nav-item > .nav-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm); color: color-mix(in srgb, var(--foreground) 72%, transparent) !important;
}
.cm-statusbar > li.nav-item > .nav-link:hover, .cm-statusbar > li.nav-item.show > .nav-link { background: var(--item-hover); color: var(--foreground) !important; }
.cm-statusbar > li.nav-item > .nav-link .material-icons { font-size: 20px; }
.cm-statusbar > li.nav-item > .nav-link .material-icons.text-warning { color: var(--warning) !important; }
.cm-statusbar > li.nav-item > .nav-link .badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px !important;
  border: 0 !important; border-radius: 9999px; box-shadow: none !important;
  font-size: 10px; font-weight: 600; line-height: 16px;
}
.cm-statusbar > li.nav-item > .nav-link .badge-warning { background: var(--warning) !important; color: #fff !important; }
.cm-statusbar > li.nav-item > .nav-link .badge-secondary { display: none; } /* 0 open notices: no badge */
html body .cm-app .cm-statusbar .notifications-drop.dropdown-menu { width: 360px; max-width: calc(100vw - 24px); margin-top: 8px; }
html body .cm-app .cm-statusbar .notifications-drop .dropdown-item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; white-space: normal; }
.cm-statusbar .notifications-drop .h5 { font-size: 14px; font-weight: 500; line-height: 1.4; }
.cm-statusbar .notifications-drop small { font-size: 12px; color: var(--muted); }
.cm-statusbar:empty { display: none !important; }
/* No open notices = the stock widget prints a bare icon with no menu: nothing to show. */
.cm-statusbar > li.nav-item:not(:has(.dropdown-menu)) { display: none !important; }
/* Stock markup hides the widget below lg (d-md-down-none is not defined in this theme): same here, the phone topbar has no room. */
@media (max-width: 992.98px) { .cm-statusbar > li.d-md-down-none { display: none !important; } }

/* ---------- Phones / small tablets: menus become sheets under the topbar (like the account menu). ---------- */
@media (max-width: 767.98px) {
  html body .cm-app .cm-cartdd__menu.dropdown-menu,
  html body .cm-app .cm-statusbar .notifications-drop.dropdown-menu {
    position: fixed; top: calc(var(--topbar-h) - 4px); left: 8px; right: 8px; width: auto; max-width: none;
    max-height: calc(100dvh - var(--topbar-h) - 8px); overflow-y: auto; overscroll-behavior: contain;
  }
  html body .cm-app .cm-lang__menu.dropdown-menu { position: fixed; top: calc(var(--topbar-h) - 4px); right: 8px; left: auto; }
  .cm-lang__btn { padding: 0 6px; }
  .cm-lang__chevron { display: none; }
  .cm-cartdd__item { min-height: 52px; }
  .cm-cartdd__actions .btn { min-height: 44px; }
}
/* Very narrow phones: language button is the icon + code only, tighter. */
@media (max-width: 400px) { .cm-lang__btn > .cm-i:first-child { display: none; } }


/* ==== portal-x-B.css ==== */
/* Agent B: signed-in sidebar groups built from the admin "Left menu editor" (menus/menu.left.logged.tpl).
   A long section name is cut with an ellipsis instead of running out of the sidebar. */
.cm-sidebar .cm-nav-group--cfg .cm-nav-label__text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ==== portal-x-C.css ==== */
/* Dashboard lists (agent C, 2026-10-18): expiring domains banner card, unpaid invoices | open tickets. */

/* Pair grid: a lone card (tickets hidden when support is off) spans the full row. */
.cm-dash-lists > .cm-card:only-child { grid-column: 1 / -1; }
.cm-dash-lists > .cm-card { display: flex; flex-direction: column; }
.cm-dash-lists .cm-empty { flex: 1 1 auto; padding: 32px 20px; }
.cm-dash-pair .cm-card__sub { font-variant-numeric: tabular-nums; }

/* Expiring domains: warning-tinted head, not a full-colour banner. */
.cm-dash-expiring .cm-card__head { background: var(--warning-bg); }
.cm-dash-expiring__icon { width: 28px; height: 28px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--warning); }
.cm-dash-row__link { color: var(--foreground) !important; }
.cm-dash-row__link:hover { color: var(--primary) !important; }

.cm-dash-row__end { gap: 10px; }
.cm-dash-row__amount { font-weight: 600; white-space: nowrap; }
.cm-dash-overdue { color: var(--error-strong); }
.cm-dash-row .badge, .cm-dash-row .cm-badge { white-space: nowrap; }

/* Phones: amount/badge/button drop under the title, aligned with the text column. */
@media (max-width: 575.98px) {
  .cm-dash-row { flex-wrap: wrap; padding: 12px 16px; gap: 6px 12px; }
  .cm-dash-row .cm-row__main { flex-basis: calc(100% - 44px); }
  .cm-dash-row__end { width: 100%; padding-left: 44px; justify-content: space-between; }
  .cm-dash-expiring .cm-card__head, .cm-dash-lists .cm-card__head { padding: 12px 16px; }
}


/* ==== portal-x-D.css ==== */
/* Agent D (2026-10-18): all-services tabs + group rows, bulk domain cancel list. */

/* clientarea/allservices.tpl — tabs (Bootstrap .nav needs nowrap to keep cm-tabs scrolling) */
.cm-allsvc__tabs.nav { flex-wrap: nowrap; }
.cm-allsvc__tabs .nav-item { list-style: none; }
.cm-allsvc .tab-content > .tab-pane { padding: 0; }

/* product-group header row inside the services table */
html body .cm-app .table tbody tr.cm-tr-group > td { background: var(--item-hover); padding-top: 8px; padding-bottom: 8px; }
html body .cm-app .table tbody tr.cm-tr-group:hover { background: transparent !important; }
.cm-tr-group__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.cm-tr-group__name { font-size: 13px; font-weight: 600; color: var(--foreground); min-width: 0; overflow-wrap: anywhere; }
.cm-tr-group .cm-link-more { height: 28px; font-size: 13px; }
.cm-tr-more > td { text-align: center; }

@media (max-width: 767.98px) {
  html body .cm-app table.cm-stack-sm tr.cm-tr-group { padding: 0; }
  html body .cm-app table.cm-stack-sm tr.cm-tr-group > td, html body .cm-app table.cm-stack-sm tr.cm-tr-more > td { grid-column: 1 / -1; }
  html body .cm-app table.cm-stack-sm tr.cm-tr-group > td { padding: 6px 16px; }
  html body .cm-app table.cm-stack-sm tr.cm-tr-more > td { text-align: center !important; }
}

/* services/cancelationrequest.tpl — bulk domain list */
.cm-bulk-cancel__list { list-style: none; margin: 0; padding: 12px 20px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; max-height: 280px; overflow-y: auto; }
.cm-bulk-cancel__list li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--foreground); }
.cm-bulk-cancel__list li .cm-i { flex-shrink: 0; color: var(--muted); }
.cm-bulk-cancel__list li .cm-mono { overflow-wrap: anywhere; min-width: 0; }

/* services/domains.tpl — billing-period column (td 4) shifts expiry/whois/autorenew to 6/7/8 on phones.
   Rows: checkbox · name / status · period / expiry / whois · autorenew / actions */
@media (max-width: 575.98px) {
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(4) { grid-column: 3; text-align: right !important; font-size: 13px; color: var(--muted); white-space: nowrap; }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(6) { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 8px; text-align: left !important; font-size: 13px; color: var(--foreground); }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(6)::before { display: inline !important; content: attr(data-label); color: var(--muted); }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(7), html body .cm-app table.domains-table.cm-stack-sm td:nth-child(8) { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); text-align: left !important; }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(7) { grid-column: 2; }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(8) { grid-column: 3; }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(7)::before, html body .cm-app table.domains-table.cm-stack-sm td:nth-child(8)::before { display: inline !important; content: attr(data-label); }
  html body .cm-app table.domains-table.cm-stack-sm td:nth-child(6) .cm-expiry-note { display: inline; }
}
/* 9 columns don't fit beside the sidebar on 15.6" laptops: drop the registration date (still on the detail page). */
@media (max-width: 1499.98px) {
  html body .cm-app table.domains-table th.cm-dom-regdate, html body .cm-app table.domains-table td.cm-dom-regdate { display: none; }
}


/* ==== portal-x-E.css ==== */
/* Agent E: two sort links in one header cell (subject/email, name/email). */
.cm-th-sorts { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.cm-th-sep { color: var(--muted); opacity: .5; font-weight: 400; }


/* ==== portal-x-F.css ==== */
/* ==========================================================================
   portal-x-F.css  ·  HiTechCloud · 2026-11-04
   --------------------------------------------------------------------------
   Lớp polish BỔ SUNG, nạp CUỐI CÙNG (sau portal-x-A..E). Mục tiêu:
     1. Safety-net chống cuộn ngang ở màn hình hẹp (<=375px) — yêu cầu cứng.
     2. Bọc an toàn các nguồn tràn thường gặp: ảnh/iframe/bảng/chuỗi dài.
     3. Tinh chỉnh gutter + tap-target ở dải hẹp cho client-area, giỏ hàng,
        trang đặt hàng (.cm-*, .cmo, .cmc).
     4. Micro-interaction nhẹ cho nút (press feedback), tôn trọng reduced-motion.

   NGUYÊN TẮC: chỉ bổ sung trình bày, KHÔNG ghi đè màu/bố cục brand. Mọi
   token dùng kèm fallback nên vẫn an toàn nếu một biến chưa định nghĩa.
   KHÔNG dùng overflow-x:hidden trên html/body/ancestor của sticky (sẽ phá
   order summary dính) — dùng overflow-x:clip (giữ nguyên position:sticky).
   ========================================================================== */

/* --- 1. Chặn tràn ngang ở các wrapper nội dung (giữ sticky summary) ------- */
body.cm-shell .cm-content,
body.cm-shell .cm-authx,
body.cm-shell .cmo,
body.cm-shell .cmc {
    overflow-x: clip;        /* clip: KHÔNG tạo scroll-container → sticky vẫn chạy */
    max-width: 100%;
}

/* --- 2. Nguồn tràn thường gặp: media co về đúng khung --------------------- */
body.cm-shell img,
body.cm-shell svg,
body.cm-shell video,
body.cm-shell canvas,
body.cm-shell iframe,
body.cm-shell embed,
body.cm-shell object {
    max-width: 100%;
}
body.cm-shell img:not([width]):not([height]) { height: auto; }

/* Chuỗi dài không ngắt (API key, hostname, URL, mã) không được đẩy giãn khung */
body.cm-shell pre,
body.cm-shell code,
body.cm-shell kbd,
body.cm-shell .text-break,
body.cm-shell .word-break,
body.cm-shell .cmo-field dd,
body.cm-shell .cm-row__val {
    overflow-wrap: anywhere;
    word-break: break-word;
}
body.cm-shell pre { overflow-x: auto; }   /* code block dài: cuộn trong chính nó */

/* --- 3. Tinh chỉnh dải hẹp (<=400px): gutter gọn, CTA xếp dọc ------------- */
@media (max-width: 400px) {
    /* Giảm gutter trang hai bên để card/nội dung không bị bóp ở màn hẹp.
       .cmo/.cmc nằm trong .cm-content nên dùng chung gutter này, không override
       padding riêng của giỏ hàng. */
    body.cm-shell .cm-content { padding-left: 14px; padding-right: 14px; }

    /* Bảng tràn: cho phép cuộn trong khung thay vì đẩy cả trang.
       (.cmo-actions / giỏ hàng đã tự xử lý xếp dọc trong style.css của nó — KHÔNG
        đụng vào để tránh lật thứ tự nút column-reverse.) */
    body.cm-shell .table-responsive,
    body.cm-shell .cm-table-wrap,
    body.cm-shell .cmo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ==========================================================================
   Đợt 2 (2026-11-04): A11Y tap-target + focus nhất quán cho orderpages
   --------------------------------------------------------------------------
   Audit tương phản token THẬT (portal.css v2, light+dark): đạt WCAG AA toàn bộ
   các cặp text/badge/link đang dùng — danger badge dùng --error-strong (5.9:1),
   alert-danger dùng --foreground (16:1), status success/warning/info/muted đều
   >=4.7:1. Focus-visible đã là global cho .btn/link; bảng client-area đã bọc
   scroll. Phần dưới chỉ BỔ SUNG, KHÔNG recolor, KHÔNG đổi layout/thứ tự nút.
   ========================================================================== */

/* Tap-target >=44px cho nút action trên toàn dải mobile (<=575.98px).
   min-height chỉ nâng lên — nút giỏ hàng đã 48px (specificity cao hơn) giữ
   nguyên. KHÔNG nhắm nút điều hướng bước (.cmo-step__btn) để tránh phình step. */
@media (max-width: 575.98px) {
    body.cm-shell .btn-primary,
    body.cm-shell .btn-success,
    body.cm-shell .cmo-plan__btn { min-height: 44px; }
    body.cm-shell .cmc-grid--compact .cmc-card { min-height: 44px; }
}

/* Focus-visible nhất quán cho thẻ-liên-kết tuỳ biến — bổ sung phòng khi global
   :focus-visible chưa phủ, dùng đúng token ring của theme. */
body.cm-shell a.cmc-card:focus-visible,
body.cm-shell a.cmo-plan:focus-visible,
body.cm-shell .cmo-step__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring-focus, rgba(9, 105, 255, 0.22));
    border-radius: var(--radius, 12px);
}

/* --- 4. Micro-interaction: phản hồi khi bấm (giữ brand, rất nhẹ) ---------- */
@media (prefers-reduced-motion: no-preference) {
    body.cm-shell .btn {
        transition: transform .12s ease, box-shadow .15s ease,
                    background-color .15s ease, border-color .15s ease, color .15s ease;
    }
    body.cm-shell .btn:active { transform: translateY(1px); }

    /* Card danh mục: nhấc nhẹ khi hover (chỉ con trỏ chuột). Chỉ nhắm
       a.cmc-card[href] — categories css hiện chỉ transition border/bg, nên đây
       là bổ sung thuần. KHÔNG đụng .cmo-plan (style.css giỏ hàng tự quản). */
    @media (hover: hover) and (pointer: fine) {
        body.cm-shell a.cmc-card[href] {
            transition: transform .15s ease, border-color .15s ease,
                        background-color .15s ease, box-shadow .15s ease;
        }
        body.cm-shell a.cmc-card[href]:hover { transform: translateY(-2px); }
    }
}


/* ==== 2026-12-04 (hostbill-upgrade-20261204): neutral brand pass — no gradients/glow on UI chrome ==== */
.cm-empty::before { content: none; }
.cm-empty__icon { box-shadow: none; background: var(--surface-tint); color: var(--muted); border: 1px solid var(--border); }
.cm-empty__icon::after { content: none; }
.cm-toggle.is-on { background: var(--success, #15803d); background-image: none; border-color: var(--success, #15803d); }
.cm-skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 10px 14px; border-radius: 8px; background: var(--surface); color: var(--foreground); border: 1px solid var(--border-strong); font-weight: 600; text-decoration: none; }
.cm-skip-link:focus { top: 12px; outline: 2px solid var(--primary); outline-offset: 2px; }


/* ==== portal-app.css ==== */
/* ==========================================================================
   HiTechCloud portal — APP MODE (2026-11-17)
   Phones, tablets < 993px and touch tablets up to 1366px look and behave like a phone app.
   Desktop (mouse / trackpad) is untouched: every rule below sits under html.cm-appmode, which the inline script
   at the top of header.shared.tpl sets from
       (max-width: 992.98px), (pointer: coarse) and (max-width: 1366px)
   Pieces: compact top bar with safe areas · floating bottom tab bar (components/app-tabbar.tpl) · off-canvas drawer
   for the full menu (also on landscape tablets) · top-bar menus become bottom sheets on phones · order steps get a
   sticky "total · Tiếp tục" bar · 16px inputs (no zoom on focus) · 44px touch targets · press feedback ·
   chat bubble lifted above the tab bar.
   ĐỔI THƯƠNG HIỆU: colours come from portal.css tokens (--primary, --surface, --danger…); nothing is hard-coded here
   except the scrim and shadows.
   ========================================================================== */

.cm-tabbar, .cm-app-only { display: none; }

html.cm-appmode {
  --topbar-h: 56px;
  --app-safe-t: env(safe-area-inset-top, 0px);
  --app-safe-b: env(safe-area-inset-bottom, 0px);
  --app-safe-l: env(safe-area-inset-left, 0px);
  --app-safe-r: env(safe-area-inset-right, 0px);
  --app-tabbar-h: 64px;
  /* room the last line of a page needs to scroll clear of the tab bar (J2: inset-bottom + 96) */
  --app-bottom-space: calc(var(--app-safe-b) + 96px);
  --app-scrim: rgb(0 0 0 / 0.4);
  -webkit-text-size-adjust: 100%;
}
html.cm-appmode body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
html.cm-appmode .cm-app-only { display: block; }

/* ---------- Top bar ---------------------------------------------------- */
/* No backdrop-filter here: it would turn the bar into the containing block of the fixed bottom sheets below. */
html.cm-appmode .cm-topbar {
  height: calc(var(--topbar-h) + var(--app-safe-t));
  padding: var(--app-safe-t) max(12px, var(--app-safe-r)) 0 max(4px, var(--app-safe-l));
  gap: 4px;
}
html.cm-appmode .cm-topbar__right { gap: 2px; }
html.cm-appmode .cm-topbar .cm-iconbtn { width: 44px; height: 44px; }
html.cm-appmode .cm-sidebar__head { height: calc(var(--topbar-h) + var(--app-safe-t)); padding-top: var(--app-safe-t); }
html.cm-appmode .cm-topbar .cm-logo.cm-mobile-only { display: inline-flex !important; }
html.cm-appmode .cm-desktop-only { display: none !important; }
/* Hamburger icon (not the desktop collapse icons) on every app-mode width, landscape tablets included. */
html.cm-appmode [data-cm-sidebar-toggle] .cm-i-open,
html.cm-appmode [data-cm-sidebar-toggle] .cm-i-close { display: none !important; }
html.cm-appmode [data-cm-sidebar-toggle] .cm-i-menu { display: inline-block !important; }
/* Signed-in phones: language and light/dark move into the account sheet (components/account-menu.tpl, .cm-acct-menu__prefs). */
@media (max-width: 599.98px) {
  html.cm-appmode .cm-topbar:has(.cm-acct) .cm-lang,
  html.cm-appmode .cm-topbar:has(.cm-acct) > .cm-topbar__right > .cm-theme-btn { display: none !important; }
}

/* ---------- Drawer for the full menu (also >= 993px on touch tablets) ---- */
html.cm-appmode .cm-sidebar {
  width: min(288px, calc(100vw - 56px)) !important;
  transform: translateX(-100%);
  box-shadow: var(--elevation-modal);
  transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-left: var(--app-safe-l);
}
html.cm-appmode body.sidenav-toggled .cm-sidebar { transform: none; transition-duration: .5s; }
html.cm-appmode .cm-overlay {
  display: block; position: fixed; inset: 0; z-index: 1035;
  background: var(--app-scrim); opacity: 0; pointer-events: none;
  transition: opacity .35s cubic-bezier(0.32, 0.72, 0, 1);
}
html.cm-appmode body.sidenav-toggled .cm-overlay { opacity: 1; pointer-events: auto; transition-duration: .5s; }
html.cm-appmode .cm-main,
html.cm-appmode body.sidenav-toggled .cm-main { margin-left: 0 !important; }
/* Undo the desktop icon-rail look that portal.css applies to body.sidenav-toggled from 993px. */
html.cm-appmode body.sidenav-toggled .cm-nav-link__text,
html.cm-appmode body.sidenav-toggled .cm-nav-count,
html.cm-appmode body.sidenav-toggled .cm-logo,
html.cm-appmode body.sidenav-toggled .cm-nav-label .cm-chevron,
html.cm-appmode body.sidenav-toggled .cm-nav-label__count { opacity: 1; }
html.cm-appmode body.sidenav-toggled .cm-nav-dot,
html.cm-appmode body.sidenav-toggled .cm-rail-mark { opacity: 0; }
html.cm-appmode body.sidenav-toggled .cm-nav-label { color: var(--muted); pointer-events: auto; }
html.cm-appmode body.sidenav-toggled .cm-nav-label .cm-nav-dash { display: none; }
html.cm-appmode .cm-sidebar .cm-nav-link,
html.cm-appmode .cm-sidebar .cm-nav-label { min-height: 44px; }

/* ---------- Page ------------------------------------------------------- */
html.cm-appmode .cm-main { padding-bottom: var(--app-bottom-space); }
html.cm-appmode .cm-content { padding-left: max(16px, var(--app-safe-l)); padding-right: max(16px, var(--app-safe-r)); }
html.cm-appmode .cm-footer { padding-left: max(16px, var(--app-safe-l)); padding-right: max(16px, var(--app-safe-r)); }
/* Root-of-tab title: large, left aligned (J3). Record pages keep their smaller title. */
html.cm-appmode .cm-page-head h1 { font-size: 28px; line-height: 34px; letter-spacing: -0.01em; }
html.cm-appmode .cm-page-head .cm-title--record { font-size: 20px; line-height: 26px; letter-spacing: 0; }
html.cm-appmode .cm-page-head__desc { font-size: 15px; }

/* Inputs at 16px: mobile browsers zoom the page on focus below that. */
html.cm-appmode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
html.cm-appmode select,
html.cm-appmode textarea,
html.cm-appmode .form-control,
html.cm-appmode .select2-container .select2-selection,
html.cm-appmode .selectize-input { font-size: 16px !important; }
html.cm-appmode .form-control:not(textarea):not([multiple]),
html.cm-appmode select:not([multiple]) { min-height: 44px; }

/* Touch targets (J4): 44px. */
html.cm-appmode .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
html.cm-appmode .btn.btn-block { display: flex; }
html.cm-appmode .btn-sm { min-height: 40px; }
html.cm-appmode .dropdown-item { min-height: 44px; display: flex; align-items: center; gap: 8px; }
html.cm-appmode .cm-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }

/* Press feedback instead of hover (J7). */
html.cm-appmode .btn,
html.cm-appmode .cm-tabbar__item,
html.cm-appmode .cm-stat,
html.cm-appmode .cm-quicknav a,
html.cm-appmode .cm-linkgrid a,
html.cm-appmode .cm-iconbtn,
html.cm-appmode .cm-acct__btn { transition: transform .12s ease-out, background-color .12s ease-out; }
html.cm-appmode .btn:active,
html.cm-appmode .cm-stat:active,
html.cm-appmode .cm-quicknav a:active,
html.cm-appmode .cm-linkgrid a:active,
html.cm-appmode .cm-iconbtn:active,
html.cm-appmode .cm-acct__btn:active { transform: scale(0.97); }
@media (hover: none) {
  html.cm-appmode .cm-iconbtn:hover:not(:active) { background: transparent; }
}

/* ---------- Bottom tab bar (J2, float) ---------------------------------- */
html.cm-appmode .cm-tabbar {
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; z-index: 1020;
  left: max(16px, var(--app-safe-l)); right: max(16px, var(--app-safe-r));
  bottom: calc(var(--app-safe-b) + 8px);
  max-width: 560px; height: var(--app-tabbar-h); margin: 0 auto; padding: 0 8px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 6%, transparent), 0 10px 30px -10px rgb(11 23 48 / 0.28);
}
html.cm-appmode .cm-tabbar__item {
  position: relative; flex: 1 1 0; min-width: 0; height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 9999px; padding: 0 4px;
  color: var(--muted) !important; text-decoration: none !important;
}
html.cm-appmode .cm-tabbar__item .cm-i { width: 24px; height: 24px; }
html.cm-appmode .cm-tabbar__icon { position: relative; display: inline-flex; }
html.cm-appmode .cm-tabbar__label {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; line-height: 13px; font-weight: 500;
}
html.cm-appmode .cm-tabbar__item.is-active { color: var(--primary) !important; }
html.cm-appmode .cm-tabbar__item.is-active .cm-tabbar__label { font-weight: 600; }
html.cm-appmode .cm-tabbar__item:active { transform: scale(0.94); }
html.cm-appmode .cm-tabbar__item:focus { outline: none; }
html.cm-appmode .cm-tabbar__item:focus-visible { box-shadow: inset 0 0 0 2px var(--ring-focus); }
html.cm-appmode .cm-tabbar__badge {
  position: absolute; top: -4px; left: calc(100% - 8px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9999px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--surface);
}
/* 360px phones: five two-word labels ("Tổng quan") need every pixel. */
@media (max-width: 379.98px) {
  html.cm-appmode .cm-tabbar { left: max(12px, var(--app-safe-l)); right: max(12px, var(--app-safe-r)); padding: 0 4px; }
  html.cm-appmode .cm-tabbar__item { padding: 0 1px; }
  html.cm-appmode .cm-tabbar__item.is-active .cm-tabbar__label { font-weight: 500; }
}
/* Task pages own the bottom edge (J2): order steps with a summary + "Tiếp tục" (both order pages). Below 993px only:
   from there the summary is a sticky side column and the tab bar has room. */
@media (max-width: 992.98px) {
  html.cm-appmode body:has(#cart-wrapper a.cartSummaryContinue) .cm-tabbar { display: none; }
}

/* ---------- Top-bar menus as bottom sheets on phones (J6) ---------------- */
@media (max-width: 767.98px) {
  html.cm-appmode body .cm-app .cm-topbar .dropdown-menu,
  html.cm-appmode body .cm-app .cm-topbar .cm-acct-menu.dropdown-menu {
    position: fixed !important; inset: auto 0 0 0 !important; top: auto !important;
    width: auto !important; max-width: none; max-height: 85dvh; margin: 0 !important;
    overflow-y: auto; overscroll-behavior: contain;
    padding-top: 20px; padding-bottom: calc(8px + var(--app-safe-b));
    border: 0; border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px -10px rgb(11 23 48 / 0.25);
    transform: none !important; transform-origin: bottom center; z-index: 1050;
  }
  html.cm-appmode body .cm-app .cm-topbar .dropdown-menu::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
    border-radius: 9999px; background: var(--border-strong);
  }
  html.cm-appmode body .cm-app .cm-topbar .dropdown-menu.show { animation: cm-sheet-in .32s cubic-bezier(0.32, 0.72, 0, 1); }
  html.cm-appmode body .cm-app .cm-topbar .dropdown.show::after {
    content: ""; position: fixed; inset: 0; z-index: 1045; background: var(--app-scrim);
  }
  html.cm-appmode .cm-acct-menu__item { min-height: 48px; font-size: 15px; }
  html.cm-appmode .cm-acct-menu__stat-value { font-size: 17px; }
}
@keyframes cm-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html.cm-appmode body .cm-app .cm-topbar .dropdown-menu.show { animation: none; }
  html.cm-appmode .cm-sidebar, html.cm-appmode .cm-overlay { transition-duration: .01s !important; }
}

/* Top-bar touch targets (J4): avatar and language buttons were 36px tall. */
html.cm-appmode .cm-acct__btn { height: 44px; min-width: 44px; justify-content: center; }
html.cm-appmode .cm-lang__btn { height: 44px; }
/* Shared bell (hc-bell.js): its size comes from --hcb-size; 36px on desktop, 44px touch target here. */
html.cm-appmode .cm-bell { --hcb-size: 44px; }
html.cm-appmode .cm-bell:not([data-hc-bell-ready]) { width: 44px; height: 44px; }
/* Account menu rows: 44px on every app-mode width (tablet popovers kept the 34px desktop rows). */
html.cm-appmode .cm-acct-menu__item { min-height: 44px; }
/* Names wrap, never cut (J4): the account sheet head and the dashboard quick-nav groups. */
html.cm-appmode .cm-acct-menu__head { flex-direction: column; align-items: flex-start; }
html.cm-appmode .cm-acct-menu__name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 16px; font-weight: 600; }
html.cm-appmode .cm-quicknav__name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* Account sheet: light/dark + language rows, only where the top bar dropped them (< 600px). */
html.cm-appmode .cm-acct-menu__prefs { display: none !important; }
@media (max-width: 599.98px) { html.cm-appmode .cm-acct-menu__prefs { display: grid !important; } }
html.cm-appmode .cm-acct-menu__prefs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 4px; padding: 6px; border-top: 1px solid var(--border); }
html.cm-appmode .cm-acct-menu__prefs .cm-acct-menu__item { border: 0; background: transparent; cursor: pointer; text-align: left; }
html.cm-appmode .cm-acct-menu__prefs .cm-acct-menu__item.is-current { color: var(--primary-strong) !important; font-weight: 600; }
html.cm-appmode .cm-acct-menu__prefs .cm-acct-menu__item.is-current .cm-i { color: var(--primary-strong); }

/* ---------- Order flow: sticky "total · Tiếp tục" bar (J5) on phones / portrait tablets ----
   Both order pages put the order summary in #cartSummary (re-rendered by AJAX) with a.cartSummaryContinue:
   cart_cloudmanager (.cmo-summary__total) and cart_2019wizard (.summary-section). CSS only: the bar background is a
   fixed ::after of #cartSummary, the total sits on its left, the button on its right. */
@media (max-width: 992.98px) {
  html.cm-appmode #cart-wrapper #cartSummary::after {
    content: ""; position: fixed; z-index: 1024; left: 0; right: 0; bottom: 0;
    height: calc(76px + var(--app-safe-b));
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px -16px rgb(11 23 48 / 0.25);
  }
  html.cm-appmode #cart-wrapper .cmo-summary__foot { margin: 0; padding: 0; border: 0; }
  html.cm-appmode #cart-wrapper a.cartSummaryContinue {
    position: fixed; z-index: 1026; right: max(16px, var(--app-safe-r)); bottom: calc(12px + var(--app-safe-b));
    width: 52% !important; min-height: 52px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 16px; font-size: 16px; font-weight: 600; line-height: 20px; padding: 0 16px;
  }
  html.cm-appmode #cart-wrapper .cmo-summary__total,
  html.cm-appmode #cart-wrapper #cartSummary .summary-section {
    position: fixed; z-index: 1026; left: max(16px, var(--app-safe-l)); bottom: calc(12px + var(--app-safe-b));
    width: calc(48% - 28px); height: 52px; margin: 0 !important; padding: 0; border: 0; background: none;
    display: flex; flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 0;
  }
  html.cm-appmode #cart-wrapper .cmo-summary__total-label,
  html.cm-appmode #cart-wrapper #cartSummary .summary-section > strong { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; text-transform: none !important; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  html.cm-appmode #cart-wrapper #cartSummary .summary-section > strong small { font-size: inherit; }
  html.cm-appmode #cart-wrapper .cmo-summary__total-value,
  html.cm-appmode #cart-wrapper #cartSummary .summary-section > .h1 {
    max-width: 100%; margin: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 18px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums;
  }
  /* the summary card's last lines must scroll clear of the bar */
  html.cm-appmode #cart-wrapper { padding-bottom: 24px; }
}

/* ---------- Order pages (2019 wizard / categories_list) on phones ---------------------- */
@media (max-width: 767.98px) {
  /* Page head: title, description, then the currency picker on its own line (it was squeezed beside the title). */
  html.cm-appmode .orderpage .section-account-header { flex-direction: column !important; gap: 12px; margin-bottom: 16px !important; }
  html.cm-appmode .orderpage .section-account-header h1 { margin: 0 0 8px !important; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
  html.cm-appmode .orderpage .section-account-header h4 { margin: 0 !important; font-size: 15px; line-height: 22px; font-weight: 400; color: var(--muted); }
  html.cm-appmode .orderpage .section-account-header > div:last-child { justify-content: flex-start !important; margin: 0 !important; }
  html.cm-appmode .orderpage #currform { flex-wrap: nowrap; gap: 12px; }
  html.cm-appmode .orderpage #currform > span { margin: 0 !important; white-space: nowrap; color: var(--muted); }
  html.cm-appmode .orderpage #currform select { width: auto; min-width: 96px; }
  /* Sibling categories: one horizontally scrolling chip row instead of a 1,000px stack before the plans. */
  html.cm-appmode .orderpage-categories_list > .row {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 0 -24px; padding: 0 24px 4px; /* 16px page + 8px #cart-wrapper.px-2 */
    scroll-padding-inline: 24px;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html.cm-appmode .orderpage-categories_list > .row::-webkit-scrollbar { display: none; }
  html.cm-appmode .orderpage-categories_list > .row > [class*="col-"] { flex: 0 0 auto; width: auto; max-width: none; padding: 0; scroll-snap-align: start; }
  html.cm-appmode .orderpage-categories_list .cart-category {
    display: inline-flex; align-items: center; min-height: 44px; margin: 0 !important; padding: 0 16px !important;
    border-radius: 9999px !important; white-space: nowrap; box-shadow: none !important;
  }
  html.cm-appmode .orderpage-categories_list .cart-category .h3 { font-size: 15px; line-height: 20px; font-weight: 500; }
  html.cm-appmode .orderpage-categories_list .cart-category.selected { background: var(--primary) !important; border-color: var(--primary) !important; }
  html.cm-appmode .orderpage-categories_list .cart-category.selected .h3 { color: var(--primary-foreground) !important; }
}

/* ---------- Chat bubble (Chatwoot): icon-only, above the tab bar / sticky bar ---- */
html.cm-appmode .woot-widget-bubble.woot-elements--right {
  bottom: calc(var(--app-safe-b) + 84px) !important; right: max(16px, var(--app-safe-r)) !important;
}
html.cm-appmode .woot-widget-bubble.woot-widget--expanded {
  width: 56px !important; height: 56px !important; min-width: 0 !important; padding: 0 !important;
  border-radius: 9999px !important; justify-content: center;
}
html.cm-appmode .woot-widget-bubble.woot-widget--expanded #woot-widget--expanded__text { display: none !important; }
/* Out of the way while the drawer or a sheet is open. */
html.cm-appmode body.sidenav-toggled .woot-widget-bubble,
html.cm-appmode body:has(.cm-topbar .dropdown.show) .woot-widget-bubble { opacity: 0; pointer-events: none; }

/* ---------- Installed app (standalone): no browser chrome around the page ---- */
html.cm-appmode.cm-standalone body { -webkit-user-select: none; user-select: none; }
html.cm-appmode.cm-standalone input, html.cm-appmode.cm-standalone textarea,
html.cm-appmode.cm-standalone [contenteditable], html.cm-appmode.cm-standalone .cm-content p,
html.cm-appmode.cm-standalone .cm-content td, html.cm-appmode.cm-standalone .cm-content dd,
html.cm-appmode.cm-standalone .cm-num { -webkit-user-select: text; user-select: text; }


/* ==== portal-fields.css ==== */
/* ==========================================================================
   HiTechCloud portal — field & data icons (2026-11-26)
   Loaded LAST (after portal-app.css) from header.shared.tpl, on every client
   area page including the orderpages (they share header.shared.tpl).

   Icon set: Bootstrap Icons 1.13.1, self-hosted at
   dist/fonts/bootstrap-icons/ (bootstrap-icons.min.css + woff2/woff).
   Shared markup for icons in templates (theme + orderpage agents):
       <i class="hc-ic bi bi-<name>" aria-hidden="true"></i>
   Modifiers: hc-ic--sm / hc-ic--lg / hc-ic--fw,  tone: is-primary / is-success /
   is-warning / is-danger / is-info / is-muted (default = muted).
   Everything below reads the portal tokens (--muted, --primary, --success …)
   that portal.css redefines under html.darkmode, so dark mode follows.

   Sections
     1. .hc-ic base
     2. Field labels  (CSS only, keyed on label[for] — no template change)
     3. Status badges (icon replaces the 6px dot)
     4. Data cells    (icons inserted in list templates)
     5. Empty states without an icon tile
     6. UI sync: input-group, focus, small polish
   ROLLBACK: remove the <link> to this file in header.shared.tpl.
   ========================================================================== */

/* ---------- 1. Base ----------------------------------------------------- */
.hc-ic {
  display: inline-block;
  flex-shrink: 0;
  width: 1.25em;                    /* fixed box: icons line up in columns */
  font-size: 1em;
  line-height: 1;
  text-align: center;
  vertical-align: -0.125em;
  color: var(--muted, #5a6478);
  margin-inline-end: .375rem;
  speak: never;
}
.hc-ic.bi::before { vertical-align: 0; line-height: 1; }
.hc-ic--sm { font-size: .875em; }
.hc-ic--lg { font-size: 1.25em; }
.hc-ic--only, .btn .hc-ic:only-child { margin-inline-end: 0; }
.hc-ic.is-muted   { color: var(--muted, #5a6478); }
.hc-ic.is-primary { color: var(--primary, #0969ff); }
.hc-ic.is-success { color: var(--success, #15803d); }
.hc-ic.is-warning { color: var(--warning, #b45309); }
.hc-ic.is-danger  { color: var(--error-strong, #b91c1c); }
.hc-ic.is-info    { color: var(--info, #0753cc); }
/* Inside coloured containers the icon follows the text colour. */
.btn .hc-ic, .badge .hc-ic, .cm-badge .hc-ic, .alert .hc-ic, a:hover > .hc-ic, .input-group-text .hc-ic { color: inherit; }
.btn .hc-ic { margin-inline-end: 0; }   /* .btn is inline-flex with gap */
.input-group-text .hc-ic { margin: 0; width: auto; }

/* ---------- 2. Field labels -------------------------------------------- */
/* Each label sets --hc-lbl to a Bootstrap Icons glyph; unmapped labels get no icon. */
.cm-field > label[for]::before, label.cm-field__label[for]::before, label.cm-field-label[for]::before,
.cm-auth-field > label[for]::before, .form-group > label[for]:not(.cm-check):not(.fileinput-button):not(.custom-control-label):not(.btn):not(.cm-choice)::before {
  content: var(--hc-lbl, none);
  display: inline-block;
  width: 1.25em;
  margin-inline-end: .45rem;
  font-family: bootstrap-icons !important;
  font-style: normal; font-weight: normal !important; font-variant: normal; text-transform: none;
  font-size: 1em;
  line-height: 1;
  text-align: center;
  vertical-align: -0.125em;
  color: var(--muted, #5a6478);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  flex-shrink: 0;
}
/* Account / contact */
label[for^="field_email"], label[for^="username_"], label[for="email_remind"],
label[for="addTicketEmail"], label[for="slm_value"]                         { --hc-lbl: "\f32f"; } /* envelope */
label[for^="field_firstname"], label[for^="field_lastname"], label[for="field_name"],
label[for="addTicketName"], label[for^="field_bankaccountname"]             { --hc-lbl: "\f4e1"; } /* person */
label[for^="field_gender"]                                                  { --hc-lbl: "\f641"; } /* gender-ambiguous */
label[for^="field_birthday"]                                                { --hc-lbl: "\f214"; } /* calendar3 */
label[for^="field_phonenumber"], label[for^="field_phone"]                  { --hc-lbl: "\f5c1"; } /* telephone */
label[for^="field_type"]                                                    { --hc-lbl: "\f4d3"; } /* person-badge */
label[for^="field_nationalid"], label[for^="field_customerid"]              { --hc-lbl: "\f8c9"; } /* person-vcard */
label[for^="field_language"]                                                { --hc-lbl: "\f658"; } /* translate */
label[for="field_status"]                                                   { --hc-lbl: "\f52f"; } /* shield-check */
label[for^="field_crpoints"]                                                { --hc-lbl: "\f588"; } /* star */
/* Company / tax */
label[for^="field_companyname"], label[for^="field_comapny"]                { --hc-lbl: "\f1dd"; } /* building */
label[for^="field_taxid"]                                                   { --hc-lbl: "\f50f"; } /* receipt (MST) */
label[for^="field_managementagency"]                                        { --hc-lbl: "\f87d"; } /* buildings */
/* Address */
label[for^="field_address"]                                                 { --hc-lbl: "\f423"; } /* house-door */
label[for^="field_city"], label[for^="field_state"]                         { --hc-lbl: "\f3e8"; } /* geo-alt */
label[for^="field_postcode"]                                                { --hc-lbl: "\f47c"; } /* mailbox */
label[for^="field_country"]                                                 { --hc-lbl: "\f3ef"; } /* globe2 */
/* Billing / bank */
label[for^="field_bankname"]                                                { --hc-lbl: "\f62e"; } /* bank */
label[for^="field_bankaccount"]:not([for^="field_bankaccountname"])         { --hc-lbl: "\f2dc"; } /* credit-card */
/* Security */
label[for^="field_password"], label[for^="password_"], label[for="new_password"],
label[for="new_password_confirmation"], label[for^="cm_newpassword"]        { --hc-lbl: "\f47b"; } /* lock */
label[for="cm_oldpassword"]                                                 { --hc-lbl: "\f44f"; } /* key */
label[for="captcha"], label[for="field_captcha"], label[for^="field_captcha_"],
label[for="cm-ticket-captcha"]                                              { --hc-lbl: "\f538"; } /* shield-lock */
/* Support ticket */
label[for="addTicketDepartment"]                                            { --hc-lbl: "\f4d0"; } /* people */
label[for^="addTicketPriority"]                                             { --hc-lbl: "\f3cc"; } /* flag */
label[for="addTicketSubject"]                                               { --hc-lbl: "\f5b0"; } /* tag */
label[for="ticketmessage"]                                                  { --hc-lbl: "\f252"; } /* chat-left-text */

/* Focus-within: the label icon takes the accent colour while its field is active. */
.cm-field:focus-within > label[for]::before,
.cm-auth-field:focus-within > label[for]::before,
.form-group:focus-within > label[for]::before { color: var(--primary, #0969ff); transition: color .15s ease; }
/* Invalid field (parsley / bootstrap): label icon turns red. */
.form-group:has(.parsley-error, .is-invalid) > label[for]::before,
.cm-field:has(.parsley-error, .is-invalid) > label[for]::before { color: var(--error-strong, #b91c1c); }

/* ---------- 3. Status badges ------------------------------------------- */
/* portal.css draws a 6px dot in .badge::before; for known statuses the dot becomes an icon. */
html body .cm-app .badge.badge-Active::before, html body .cm-app .badge.badge-Paid::before,
html body .cm-app .badge.badge-Accepted::before, html body .cm-app .badge.badge-Completed::before,
html body .cm-app .badge.badge-Approved::before, html body .cm-app .badge.badge-success::before,
html body .cm-badge.is-success::before                       { --hc-st: "\f26a"; } /* check-circle-fill */
html body .cm-app .badge.badge-Pending::before, html body .cm-app .badge.badge-Unpaid::before,
html body .cm-app .badge.badge-Receiptunpaid::before, html body .cm-app .badge.badge-Draft::before,
html body .cm-app .badge.badge-Sent::before, html body .cm-app .badge.badge-In-Progress::before,
html body .cm-app .badge.badge-warning::before,
html body .cm-badge.is-warning::before                       { --hc-st: "\f291"; } /* clock-fill */
html body .cm-app .badge.badge-Open::before, html body .cm-app .badge.badge-Opened::before
                                                             { --hc-st: "\f264"; } /* chat-square-text */
html body .cm-app .badge.badge-Answered::before, html body .cm-app .badge.badge-Customer-Reply::before,
html body .cm-app .badge.badge-Client-Reply::before         { --hc-st: "\f51f"; } /* reply-fill */
html body .cm-app .badge.badge-info::before,
html body .cm-badge.is-info::before                          { --hc-st: "\f430"; } /* info-circle-fill */
html body .cm-app .badge.badge-Suspended::before             { --hc-st: "\f4c1"; } /* pause-circle-fill */
html body .cm-app .badge.badge-Overdue::before, html body .cm-app .badge.badge-Collections::before,
html body .cm-app .badge.badge-Chargeback::before, html body .cm-app .badge.badge-danger::before,
html body .cm-badge.is-danger::before                        { --hc-st: "\f332"; } /* exclamation-circle-fill */
html body .cm-app .badge.badge-Fraud::before                 { --hc-st: "\f33a"; } /* exclamation-triangle-fill */
html body .cm-app .badge.badge-Terminated::before, html body .cm-app .badge.badge-Cancelled::before,
html body .cm-app .badge.badge-Canceled::before, html body .cm-app .badge.badge-Expired::before,
html body .cm-app .badge.badge-Dead::before                  { --hc-st: "\f622"; } /* x-circle-fill */
html body .cm-app .badge.badge-Closed::before, html body .cm-app .badge.badge-Close::before
                                                             { --hc-st: "\f270"; } /* check2-circle */
html body .cm-app .badge.badge-Refunded::before              { --hc-st: "\f117"; } /* arrow-counterclockwise */
html body .cm-app .badge.badge-Transferred::before           { --hc-st: "\f12b"; } /* arrow-left-right */

/* Apply the glyph only where a status was mapped (others keep the dot). */
html body .cm-app .badge:is(.badge-Active,.badge-Paid,.badge-Accepted,.badge-Completed,.badge-Approved,.badge-success,
  .badge-Pending,.badge-Unpaid,.badge-Receiptunpaid,.badge-Draft,.badge-Sent,.badge-In-Progress,.badge-warning,
  .badge-Open,.badge-Opened,.badge-Answered,.badge-Customer-Reply,.badge-Client-Reply,.badge-info,
  .badge-Suspended,.badge-Overdue,.badge-Collections,.badge-Chargeback,.badge-danger,.badge-Fraud,
  .badge-Terminated,.badge-Cancelled,.badge-Canceled,.badge-Expired,.badge-Dead,.badge-Closed,.badge-Close,
  .badge-Refunded,.badge-Transferred)::before,
html body .cm-badge:is(.is-success,.is-warning,.is-info,.is-danger)::before {
  content: var(--hc-st);
  width: auto; height: auto;
  border-radius: 0; background: none;
  font-family: bootstrap-icons !important;
  font-style: normal; font-weight: normal !important;
  font-size: 11px; line-height: 1;
  opacity: 1;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 4. Data cells ---------------------------------------------- */
/* <i class="hc-ic bi …"> inserted in services / invoices / domains / tickets rows. */
td .hc-ic { margin-inline-end: .3rem; }
.cm-td-num .hc-ic, td.cm-num .hc-ic { opacity: .85; }
.cm-td-sub .hc-ic { font-size: .95em; margin-inline-end: .2rem; }
td.cm-overdue .hc-ic, .cm-expiry-note.is-warning .hc-ic { color: inherit; }
.cm-mono .hc-ic, .cm-svc-name__sub .hc-ic { font-family: bootstrap-icons; }
/* Mobile stacked rows: amounts stay right-aligned, icon never wraps alone. */
@media (max-width: 575.98px) {
  td.cm-td-num, td.cm-num { white-space: nowrap; }
  td .hc-ic--hide-sm { display: none; }
}

/* ---------- 5. Empty states without an icon tile ----------------------- */
/* .cm-empty::before is the dot-grid backdrop (portal.css); the fallback icon uses ::after, moved first by order. */
.cm-empty:not(:has(.cm-empty__icon))::after {
  content: "\f42d";                 /* inbox */
  order: -1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 6px;
  border-radius: 16px;
  background: var(--primary-light, rgba(9,105,255,.08));
  color: var(--primary, #0969ff);
  font-family: bootstrap-icons !important; font-style: normal; font-weight: normal !important;
  font-size: 22px; line-height: 1;
  -webkit-font-smoothing: antialiased;
}
/* Compact empty rows inside tables / dropdowns. */
td .cm-empty:not(:has(.cm-empty__icon))::after, .cm-cartdd__menu .cm-empty::after { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }

/* ---------- 6. UI sync -------------------------------------------------- */
/* Input groups: same height / radius / border as .form-control, icon centred. */
html body .cm-app .input-group > .input-group-prepend > .input-group-text,
html body .cm-app .input-group > .input-group-append > .input-group-text {
  min-width: 40px; justify-content: center;
  border-color: var(--border-strong); color: var(--muted);
}
html body .cm-app .input-group:focus-within .input-group-text { border-color: var(--border-focus, var(--primary)); color: var(--primary); }
/* Required marker aligned with the label text, not the icon. */
.cm-req { margin-inline-start: 2px; }
/* Disabled / read-only controls read as such in both themes. */
html body .cm-app .form-control:disabled, html body .cm-app .form-control[readonly] {
  background: var(--surface-tint); color: var(--muted); cursor: not-allowed;
}
/* Keyboard focus on links/buttons that have no own ring (sidebar, row links). */
html body .cm-app a:focus-visible, html body .cm-app [role="button"]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .cm-field:focus-within > label[for]::before, .form-group:focus-within > label[for]::before { transition: none; }
}


/* ==== portal-tools.css ==== */
/* ==========================================================================
   HiTechCloud portal — client-portal tools (2026-11-26)
   Loaded after portal-fields.css from header.shared.tpl.
     1. Quick list search   ([data-hc-search] input, dist/js/portal-tools.js)
     2. Overdue invoice banner (components/hc-overdue-banner.tpl)
     3. API access page links (clientarea/top_nav.tpl account tab)
   Colours read only the portal tokens (portal.css redefines them under
   html.darkmode), so dark mode follows automatically.
   ROLLBACK: remove the <link> + <script> lines tagged "portal-tools" in
   header.shared.tpl and the include in header.tpl.
   ========================================================================== */

/* ---------- 1. Quick list search ---------------------------------------- */
.hc-qsearch {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 320px;
  min-width: 0;
}
.hc-qsearch > .hc-ic {
  position: absolute;
  inset-inline-start: 10px;
  pointer-events: none;
  margin: 0;
  z-index: 1;
}
.hc-qsearch input[type="search"] {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 34px;
  border: 1px solid var(--border-strong, #d3dae5);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface, #fff);
  color: var(--foreground, #0b1730);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
html.darkmode .hc-qsearch input[type="search"],
.cm-shell .hc-qsearch input[type="search"] { background-color: var(--surface, #fff); color: var(--foreground, #0b1730); }
.hc-qsearch input[type="search"]::placeholder { color: var(--muted, #5a6478); opacity: 1; }
.hc-qsearch input[type="search"]::-webkit-search-cancel-button { display: none; }
.hc-qsearch input[type="search"]:focus {
  outline: none;
  border-color: var(--border-focus, #0969ff);
  box-shadow: 0 0 0 3px var(--ring-focus, rgba(9, 105, 255, .22));
}
.hc-qsearch__clear {
  position: absolute;
  inset-inline-end: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, #5a6478);
  cursor: pointer;
}
.hc-qsearch__clear:hover, .hc-qsearch__clear:focus-visible { background: var(--item-hover, #f0f4fb); color: var(--foreground, #0b1730); }
.hc-qsearch__clear .hc-ic { margin: 0; color: inherit; }
.hc-qsearch__clear[hidden] { display: none; }

/* rows the search hides (separate from [hidden], which the status chips own) */
tr.hc-search-miss { display: none !important; }
.hc-search-empty td {
  padding: 28px 16px !important;
  text-align: center;
  color: var(--muted, #5a6478);
}
.hc-search-empty .hc-ic { color: inherit; }

/* card head with chips + search: let them wrap on narrow screens */
.hc-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; width: 100%; }
.hc-head-tools .cm-seg { flex: 0 1 auto; min-width: 0; }
.hc-head-tools .hc-qsearch { margin-inline-start: auto; }
.cm-toolbar .hc-qsearch { margin-inline-start: auto; }
.cm-card__head:has(.hc-qsearch) { flex-wrap: wrap; }
.cm-card__head-actions .hc-qsearch { flex: 0 1 260px; }

@media (max-width: 575.98px) {
  .hc-qsearch, .hc-head-tools .hc-qsearch, .cm-toolbar .hc-qsearch { flex-basis: 100%; max-width: none; margin-inline-start: 0; }
  .hc-qsearch input[type="search"] { height: 40px; font-size: 16px; } /* 16px: no iOS zoom on focus */
  .cm-card__head-actions:has(.hc-qsearch) { flex-basis: 100%; margin-left: 0; }
  .cm-card__head-actions .hc-qsearch { flex: 1 1 auto; }
}

/* ---------- 2. Overdue invoice banner ----------------------------------- */
.hc-overdue {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger, #dc2626) 35%, transparent);
  border-radius: var(--radius, 12px);
  background: var(--danger-bg, rgb(220 38 38 / .08));
  color: var(--foreground, #0b1730);
}
.hc-overdue[hidden] { display: none; }
.hc-overdue__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger, #dc2626) 14%, transparent);
}
.hc-overdue__icon .hc-ic { margin: 0; font-size: 18px; color: var(--danger, #dc2626); }
.hc-overdue__text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.45; }
.hc-overdue__text strong { font-weight: 600; }
.hc-overdue__sub { display: block; color: var(--muted, #5a6478); font-size: 13px; }
.hc-overdue__actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.hc-overdue__actions .btn { white-space: nowrap; }
.hc-overdue__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #5a6478);
  cursor: pointer;
}
.hc-overdue__close:hover, .hc-overdue__close:focus-visible { background: var(--danger-bg-hover, rgb(220 38 38 / .14)); color: var(--foreground, #0b1730); }
.hc-overdue__close .hc-ic { margin: 0; color: inherit; }
@media (max-width: 575.98px) {
  .hc-overdue { flex-wrap: wrap; align-items: flex-start; }
  .hc-overdue__text { flex-basis: calc(100% - 48px - 44px); }
  .hc-overdue__actions { flex-basis: 100%; justify-content: flex-start; padding-inline-start: 48px; }
}

/* ---------- 3. API access ---------------------------------------------- */
.hc-api-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

