@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* ==========================================================================
   Avalanche Host — WHMCS client area theme
   Child of twenty-one. This file is loaded by the parent's includes/head.tpl
   AFTER theme.min.css, so equal-specificity rules here win without !important.
   !important appears only where Bootstrap's own utilities use it, or where a
   later-loading stylesheet (the order form) would otherwise take precedence.

   Ported from avalanchehost.ca — assets/css/style.css. Token names are
   prefixed --ah- because Bootstrap 4 already owns --blue/--cyan/--primary in
   :root, and a bare redefinition here would be confusing to read later.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens

   Two palettes. Dark is the default and the brand default — it is what
   avalanchehost.ca looks like. Light exists because the client area is a tool
   people use in daylight offices, and is opt-in per visitor.

   The theme is selected by data-theme on <html>, written before first paint by
   the bootstrap script in includes/head.tpl. :root carries dark so that any
   context which never gets the attribute (print, a stripped page, JS off)
   still renders the brand.

   Structural tokens (radius, fonts, easing) are declared once and never
   re-declared per theme.
   -------------------------------------------------------------------------- */

:root {
    /* structure — theme-independent */
    --ah-radius: 12px;
    --ah-radius-lg: 18px;
    --ah-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ah-font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --ah-ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);

    /* Page shell. Bootstrap 4 caps .container at 1140px, a width drawn for
       2013 laptops: on a 1440p or ultrawide monitor the client area used about
       a third of the glass while every table scrolled inside a narrow well.

       Capped rather than fluid. An uncapped container keeps stretching, and a
       ticket message set 200 characters to the line is harder to read, not
       easier — the win from extra width belongs to tables and side-by-side
       blocks, not to prose. */
    --ah-page-max: 1560px;
    --ah-page-gutter: 28px;

    /* The vertical step between stacked blocks in the content column. Declared
       as a token because it is set on six different selectors and the wide
       breakpoint needs to move all of them together. */
    --ah-stack: 20px;

    /* brand accents — identical in both themes, they are the brand */
    --ah-blue: #0082ff;
    --ah-blue-hover: #339cff;
    --ah-blue-tint: rgba(0, 130, 255, 0.14);
    --ah-cyan: #52aaff;
    --ah-ice: #7dd3fc;
    --ah-success: #34d399;
    --ah-warning: #f59e0b;
    --ah-danger: #f0616d;

    /* Text on a filled brand/state background. White in both themes because
       the fill is the same colour in both. */
    --ah-on-accent: #ffffff;

    /* Status tint fills. Left as low-alpha overlays rather than solid colours
       precisely so one value reads correctly on a near-black surface and on
       white — only the paired foreground below needs to change per theme. */
    --ah-tint-info: rgba(0, 130, 255, 0.14);
    --ah-tint-success: rgba(52, 211, 153, 0.15);
    --ah-tint-warn: rgba(245, 158, 11, 0.16);
    --ah-tint-danger: rgba(240, 97, 109, 0.14);
    --ah-tint-purple: rgba(167, 139, 250, 0.18);
}

/* ---------- Dark (default) ---------- */

:root,
:root[data-theme="dark"] {
    --ah-bg: #0b1120;
    --ah-bg-soft: #121a2e;
    --ah-surface: #161f36;
    --ah-surface-2: #1d2942;
    --ah-navy: #101a30;
    --ah-navy-deep: #0d1526;

    --ah-ink: #f2f6fc;
    --ah-body: #b0bdcf;
    --ah-muted: #8fa0b6;

    --ah-line: rgba(255, 255, 255, 0.10);
    --ah-line-soft: rgba(255, 255, 255, 0.07);
    --ah-line-strong: rgba(255, 255, 255, 0.24);
    --ah-line-hover: rgba(255, 255, 255, 0.40);

    /* Subtle surface lift for card headers and table heads. */
    --ah-raise: rgba(255, 255, 255, 0.03);
    --ah-raise-soft: rgba(255, 255, 255, 0.02);
    --ah-raise-strong: rgba(255, 255, 255, 0.06);
    --ah-sunken: rgba(0, 0, 0, 0.18);

    /* Foregrounds paired with the tint fills above. */
    --ah-fg-info: #cfe6ff;
    --ah-fg-success: #a7f3d0;
    --ah-fg-warn: #fbd38d;
    --ah-fg-danger: #fecdd3;
    --ah-fg-purple: #ddd6fe;

    --ah-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --ah-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45), 0 20px 48px rgba(0, 0, 0, 0.35);

    /* Translucent so the backdrop-filter blur has something to work with. */
    --ah-header-bg: rgba(11, 17, 32, 0.85);
    --ah-overlay-bg: rgba(11, 17, 32, 0.9);

    /* Avatar initials — pale, for a low-alpha fill over a near-black card. */
    --ah-av-0: #bfdcff;
    --ah-av-1: #a7f3d0;
    --ah-av-2: #ddd6fe;
    --ah-av-3: #fde3b0;
    --ah-av-4: #fbcfe8;
    --ah-av-5: #bae6fd;
    --ah-av-6: #99f6e4;
    --ah-av-7: #fecaca;
}

/* ---------- Light ---------- */

:root[data-theme="light"] {
    --ah-bg: #f4f7fb;
    --ah-bg-soft: #eaf0f7;
    --ah-surface: #ffffff;
    --ah-surface-2: #eef3f9;
    --ah-navy: #eaf0f7;
    --ah-navy-deep: #ffffff;

    --ah-ink: #0b1120;
    --ah-body: #3d4d63;
    /* Not #64748b: that clears AA against pure white but the page sits on
       --ah-bg (#f4f7fb), where it drops to 4.43:1 and takes the table headers,
       DataTables' "showing 1 to 4 of 4" and every section label with it. */
    --ah-muted: #5a6878;

    --ah-line: rgba(11, 17, 32, 0.12);
    --ah-line-soft: rgba(11, 17, 32, 0.07);
    --ah-line-strong: rgba(11, 17, 32, 0.20);
    --ah-line-hover: rgba(11, 17, 32, 0.38);

    --ah-raise: rgba(11, 17, 32, 0.025);
    --ah-raise-soft: rgba(11, 17, 32, 0.015);
    --ah-raise-strong: rgba(11, 17, 32, 0.05);
    --ah-sunken: rgba(11, 17, 32, 0.04);

    /* Darkened so each still clears AA against its own tint on white. */
    --ah-fg-info: #0a4a8f;
    --ah-fg-success: #065f46;
    --ah-fg-warn: #92400e;
    --ah-fg-danger: #9f1239;
    --ah-fg-purple: #5b21b6;

    --ah-shadow-sm: 0 1px 2px rgba(11, 17, 32, 0.06), 0 2px 8px rgba(11, 17, 32, 0.05);
    --ah-shadow-md: 0 6px 18px rgba(11, 17, 32, 0.10), 0 16px 40px rgba(11, 17, 32, 0.08);

    /* On a light page a hairline cyan link is too pale; darken to the same
       family without changing the brand blue itself. */
    --ah-cyan: #0069d1;
    --ah-ice: #0a4a8f;

    --ah-header-bg: rgba(255, 255, 255, 0.85);
    --ah-overlay-bg: rgba(244, 247, 251, 0.92);

    /* Saturated, for the same low-alpha fill over a white card. */
    --ah-av-0: #0a4a8f;
    --ah-av-1: #065f46;
    --ah-av-2: #5b21b6;
    --ah-av-3: #92400e;
    --ah-av-4: #9d174d;
    --ah-av-5: #075985;
    --ah-av-6: #115e59;
    --ah-av-7: #991b1b;
}

/* White snow on a white page is nothing but wasted paint. */
:root[data-theme="light"] body::before,
:root[data-theme="light"] body::after {
    display: none;
}

/* Colour transitions on the toggle, but never on first paint and never for
   people who asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
    :root.ah-theme-ready body,
    :root.ah-theme-ready .card,
    :root.ah-theme-ready header.header,
    :root.ah-theme-ready footer.footer,
    :root.ah-theme-ready .table-list > tbody > tr > td {
        transition: background-color 0.2s var(--ah-ease-out), color 0.2s var(--ah-ease-out),
                    border-color 0.2s var(--ah-ease-out);
    }
}

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */

body,
body.primary-bg-color {
    background-color: var(--ah-bg);
    color: var(--ah-body);
    font-family: var(--ah-font);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

/* WHMCS leans on <small>/.small for metadata under headings; keep it legible. */
small, .small { color: var(--ah-muted); }

a { color: var(--ah-cyan); }
a:hover, a:focus { color: var(--ah-ice); text-decoration: none; }

hr { border-top-color: var(--ah-line); }

code, kbd, pre, samp { font-family: ui-monospace, Consolas, monospace; }

code {
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line);
    border-radius: 6px;
    color: var(--ah-ice);
    padding: 2px 6px;
}

pre {
    background: var(--ah-navy-deep);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius);
    color: var(--ah-body);
    padding: 16px 18px;
}

blockquote, .blockquote {
    border-left: 3px solid var(--ah-blue);
    color: var(--ah-muted);
    padding-left: 16px;
}

/* Match the marketing site's focus ring. WHMCS ships a lot of keyboard-driven
   forms, so this must be visible on every focusable control, not just links. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(79, 209, 255, 0.65);
    outline-offset: 2px;
}

::selection { background: var(--ah-blue); color: #fff; }

/* Scrollbars, so the chrome around dark content isn't a bright strip. */
* { scrollbar-color: var(--ah-surface-2) var(--ah-bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ah-bg); }
::-webkit-scrollbar-thumb {
    background: var(--ah-surface-2);
    border: 2px solid var(--ah-bg);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #2b3a5c; }

/* --------------------------------------------------------------------------
   2. Ambient snowfall
   Two fixed parallax layers built from radial-gradient dots — no JS, no DOM.
   Sits at z-index 0; the page chrome below is lifted to 1 so it stays behind
   everything without needing a wrapper element the parent theme doesn't emit.
   -------------------------------------------------------------------------- */

body::before,
body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    top: -100vh;
    height: 200vh;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        radial-gradient(2.5px 2.5px at 12% 14%, rgba(255, 255, 255, 0.75), transparent 60%),
        radial-gradient(2px 2px   at 63% 33%, rgba(226, 240, 255, 0.65), transparent 60%),
        radial-gradient(3px 3px   at 84% 68%, rgba(255, 255, 255, 0.60), transparent 60%),
        radial-gradient(2px 2px   at 34% 82%, rgba(226, 240, 255, 0.55), transparent 60%);
    background-size: 520px 520px;
}

/* Far layer: smaller, dimmer, slower — the depth cue does the work, so it is
   deliberately not blurred (a sub-pixel blur on a fixed layer costs a
   compositor pass and buys nothing you can see). */
body::after {
    background-image:
        radial-gradient(1.5px 1.5px at 27% 22%, rgba(255, 255, 255, 0.40), transparent 60%),
        radial-gradient(1.5px 1.5px at 71% 58%, rgba(200, 226, 255, 0.35), transparent 60%),
        radial-gradient(1px 1px     at 45% 91%, rgba(255, 255, 255, 0.30), transparent 60%);
    background-size: 310px 310px;
}

@media (prefers-reduced-motion: no-preference) {
    body::before { animation: ah-snow 26s linear infinite; }
    body::after  { animation: ah-snow 44s linear infinite; }

    @keyframes ah-snow {
        from { transform: translateY(0); }
        to   { transform: translateY(520px); }
    }
}

/* Phones get no snow: it is the first thing worth cutting on a small screen,
   and a fixed animated layer is the expensive one on mobile GPUs. */
@media (max-width: 767.98px) {
    body::before, body::after { display: none; }
}

/* Lift the page chrome above the fixed snow layer at z-index 0.

   Deliberately does NOT include .modal, .modal-backdrop or #fullpage-overlay.
   Those are position:fixed with z-index 1000-1050 in Bootstrap and are already
   far above the snow — and forcing them to position:relative drops them into
   the document flow, so modals render as a panel at the bottom of the page
   instead of a centred overlay and the loading overlay stops covering
   anything. */
header.header,
.master-breadcrumb,
section#main-body,
footer.footer {
    position: relative;
    z-index: 1;
}

/* The header has to outrank the content, not merely the snow.

   Giving every band the same z-index means the later one in the DOM wins, so
   the page content painted over the header — and the nav dropdowns ("More",
   "Hello, Kolton!") opened *behind* the dashboard tiles and the order summary.
   A stacking context that only lifts things off the background is not enough
   once anything in the header overflows it. */
header.header { z-index: 30; }
.master-breadcrumb { z-index: 2; }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */

header.header {
    background-color: var(--ah-header-bg);
    background-image:
        radial-gradient(700px 380px at 80% -60%, rgba(79, 209, 255, 0.12), transparent 60%),
        radial-gradient(600px 340px at 10% 160%, rgba(59, 130, 246, 0.14), transparent 55%);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ah-line);
}

header.header .topbar {
    background-color: var(--ah-navy-deep);
    border-bottom: 1px solid var(--ah-line-soft);
    color: var(--ah-muted);
}

header.header .topbar .btn,
header.header .topbar .active-client .btn,
header.header .topbar .active-client .input-group-text {
    color: var(--ah-muted);
}

header.header .topbar .btn:hover { color: var(--ah-ink); }

header.header .topbar .active-client .btn.btn-active-client span {
    border-bottom-color: var(--ah-line-strong);
    color: var(--ah-body);
}

header.header .logo-img { max-height: 46px; }

header.header .navbar a,
header.header .navbar-nav a {
    color: var(--ah-body);
}

header.header .navbar a:hover { color: var(--ah-ink); }

header.header .navbar-brand {
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Header search — the parent's light-gray border disappears on a dark bar. */
header.header .search {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
}

header.header .search .form-control {
    background: transparent;
    color: var(--ah-ink);
}

header.header .search .form-control::placeholder { color: var(--ah-muted); }

header.header .search .btn { color: var(--ah-muted); }

header.header .search:focus-within {
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
}

/* Cart / hamburger pills in the top bar. */
header.header .toolbar .nav-link {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
    color: var(--ah-body);
}

header.header .toolbar .nav-link:hover {
    background: var(--ah-surface-2);
    border-color: var(--ah-line-hover);
    color: var(--ah-ink);
}

header.header .toolbar .nav-link .badge-info {
    background-color: var(--ah-blue);
    color: #fff;
}

header.header .main-navbar-wrapper {
    background: rgba(18, 26, 46, 0.6);
    border-top: 1px solid var(--ah-line-soft);
}

/* Main nav items get the marketing site's pill-hover treatment. */
header.header .main-navbar-wrapper .navbar-nav > li > a {
    border-radius: 999px;
    font-weight: 500;
    padding: 8px 12px;
    transition: color 0.15s ease, background 0.15s ease;
}

header.header .main-navbar-wrapper .navbar-nav > li > a:hover {
    background: var(--ah-surface);
    color: var(--ah-ink);
}

header.header .main-navbar-wrapper .navbar-nav > li.active > a {
    color: var(--ah-ink);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Dropdowns
   -------------------------------------------------------------------------- */

.dropdown-menu {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius);
    box-shadow: var(--ah-shadow-md);
    color: var(--ah-body);
    padding: 8px;
}

.dropdown-item,
.dropdown-menu > li > a {
    border-radius: 8px;
    color: var(--ah-body);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu > li > a:hover {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

header.header .dropdown-item.active,
header.header .dropdown-item:active,
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--ah-blue);
    color: #fff;
}

.dropdown-divider { border-top-color: var(--ah-line); }

.dropdown-header { color: var(--ah-muted); }

/* --------------------------------------------------------------------------
   5. Breadcrumb
   -------------------------------------------------------------------------- */

.master-breadcrumb {
    background-color: var(--ah-bg-soft);
    border-bottom: 1px solid var(--ah-line);
}

.breadcrumb {
    background-color: transparent;
    color: var(--ah-muted);
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--ah-muted); }
.breadcrumb-item.active { color: var(--ah-body); }
.breadcrumb a { color: var(--ah-cyan); }

/* --------------------------------------------------------------------------
   6. Page shell, main body, cards, panels
   -------------------------------------------------------------------------- */

/* One width for every band. The header, breadcrumb, content, footer and the
   order form all sit on Bootstrap's .container, so the page width is widened
   in exactly one place — a wider content column under a 1140px header bar
   would read as a broken page rather than a wide one.

   Bootstrap declares its max-widths inside breakpoint media queries at (0,1,0).
   These rules have the same shape and come later in the cascade, so they win
   without !important. The min() keeps a real gutter on the viewports just past
   the cap, where the container would otherwise touch both edges. */
@media (min-width: 1200px) {
    .container {
        max-width: min(var(--ah-page-max), calc(100% - var(--ah-page-gutter) * 2));
    }
}

/* Past the cap the sidebar is a navigation column, not a proportional one: at
   Bootstrap's 25% of 1560px it becomes a 390px strip of mostly empty card
   while the table beside it gives up width it can actually use. Fixing the
   sidebar hands every pixel of further growth to the content.

   The id is in the selector because Bootstrap's `.col-lg-3` (0,1,0) lives in
   its own media query, and a plain class rule here could not outrank it. If
   Twenty-One ever changes that wrapper the selector simply stops matching and
   the stock columns stand — the failure mode is "no change", not a broken
   layout. */
@media (min-width: 1400px) {
    #main-body .row > .sidebar {
        flex: 0 0 300px;
        max-width: 300px;
    }

    #main-body .row > .primary-content {
        flex: 1 1 0%;
        max-width: none;
    }
}

section#main-body {
    background-color: transparent;
    padding-bottom: 64px;
    padding-top: 32px;
}

/* A wider page needs deeper breathing room, or the extra width just reads as
   the same crowded layout with more air beside it. This block sits after the
   base rule on purpose: `section#main-body` is (1,0,1) in both, so a media
   query alone would not have beaten it — only source order does. */
@media (min-width: 1200px) {
    :root { --ah-stack: 24px; }

    section#main-body {
        padding-bottom: 80px;
        padding-top: 40px;
    }
}

/* One vertical rhythm for the whole content column.

   The parent spaces stacked cards 10px apart, which reads as crowded next to
   the 20-24px gutters used inside them and by the grids this theme adds. Every
   sibling block in .primary-content now sits on the same step. */
.primary-content .card,
.primary-content .table-container,
.primary-content .ah-dash,
.primary-content .ah-stat-row,
.primary-content .mc-promo-manage,
.primary-content .mc-promo-login {
    margin-bottom: var(--ah-stack);
}

.card,
.mc-promo-manage,
.mc-promo-login {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow-sm);
    color: var(--ah-body);
}

.card-header {
    background-color: var(--ah-raise-soft);
    border-bottom: 1px solid var(--ah-line);
    color: var(--ah-ink);
}

/* The dashboard's home panels ("Your Active Products/Services", "Recent
   Support Tickets", "Register a New Domain", "Recent News").

   The parent sets `.client-home-cards .card-header { background-color: #fff }`
   at (0,2,0); a bare `.card-header` (0,1,0) loses to it, so every panel header
   on the dashboard rendered as a white bar with near-white text on it. */
.client-home-cards .card-header {
    background-color: var(--ah-raise);
    border-bottom: 1px solid var(--ah-line);
    color: var(--ah-ink);
}

.client-home-cards .card-title { color: var(--ah-ink); }

/* The parent forces white on these so they read against its own coloured
   accent header; against this theme's header they need button treatment. */
.client-home-cards .card-header .btn {
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line-strong) !important;
    color: var(--ah-body) !important;
}

.client-home-cards .card-header .btn:hover {
    background: var(--ah-blue);
    border-color: var(--ah-blue) !important;
    color: #fff !important;
}

/* .card-accent-* is a 3px top border in the parent — keep it, it is the only
   thing separating one dashboard panel from the next — but remap Bootstrap's
   palette onto brand colours. */
.client-home-cards .card-accent-blue,
.client-home-cards .card-accent-turquoise,
.client-home-cards .card-accent-teal { border-top-color: var(--ah-blue); }
.client-home-cards .card-accent-green,
.client-home-cards .card-accent-emerald,
.client-home-cards .card-accent-lime { border-top-color: var(--ah-success); }
.client-home-cards .card-accent-gold,
.client-home-cards .card-accent-orange,
.client-home-cards .card-accent-sun-flower { border-top-color: var(--ah-warning); }
.client-home-cards .card-accent-red,
.client-home-cards .card-accent-pomegranate { border-top-color: var(--ah-danger); }
.client-home-cards .card-accent-purple,
.client-home-cards .card-accent-amethyst,
.client-home-cards .card-accent-magenta,
.client-home-cards .card-accent-pink { border-top-color: #a78bfa; }

.card-footer {
    background-color: var(--ah-sunken);
    border-top: 1px solid var(--ah-line);
    color: var(--ah-body);
}

.card-title,
.primary-content .card-title {
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
    letter-spacing: -0.02em;
}

.card-text, .card-body { color: var(--ah-body); }

/* No `.card a` colour rule here on purpose. The parent theme has none to beat,
   and any descendant rule of that shape (0,2,x) silently outranks the
   component rules for everything WHMCS nests inside a card — pagination,
   sidebar menu entries, tabs. Plain content links are already handled by the
   bare `a` selector above, which is specific enough to colour prose and weak
   enough to lose to every component. */

/* Homepage product-group tiles and the "how can we help" icon row lift on
   hover the same way .card does on the marketing site. */
.card-columns.home .card,
.action-icon-btns a {
    transition: border-color 0.22s var(--ah-ease-out),
                box-shadow 0.22s var(--ah-ease-out),
                transform 0.22s var(--ah-ease-out);
}

.card-columns.home .card:hover {
    border-color: var(--ah-line-strong);
    box-shadow: var(--ah-shadow-md);
    transform: translateY(-3px);
}

.action-icon-btns a {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
    color: var(--ah-body);
    display: block;
    padding: 24px 12px;
    text-align: center;
}

.action-icon-btns a:hover {
    border-color: var(--ah-line-strong);
    box-shadow: var(--ah-shadow-md);
    color: var(--ah-ink);
    transform: translateY(-3px);
}

.action-icon-btns .ico-container {
    align-items: center;
    background: var(--ah-blue-tint);
    border: 1px solid rgba(79, 209, 255, 0.3);
    border-radius: 14px;
    color: var(--ah-cyan);
    display: flex;
    height: 56px;
    justify-content: center;
    margin: 0 auto 14px;
    width: 56px;
}

.action-icon-btns .ico-container i { color: var(--ah-cyan); font-size: 1.5rem; }

/* Domain search band on the homepage — mirrors .page-hero. */
.home-domain-search {
    background-color: var(--ah-navy);
    background-image:
        radial-gradient(700px 380px at 80% -20%, rgba(79, 209, 255, 0.12), transparent 60%),
        radial-gradient(600px 340px at 10% 120%, rgba(59, 130, 246, 0.16), transparent 55%);
    border-bottom: 1px solid var(--ah-line);
    position: relative;
    z-index: 1;
}

.home-domain-search h2 { color: #fff; }

/* The wrapper is the white sheet the whole search sits on. */
.home-domain-search .input-group-wrapper {
    background-color: var(--ah-navy-deep);
    border-color: var(--ah-line-strong);
    border-radius: var(--ah-radius);
}

.home-domain-search .input-group-wrapper .form-control {
    background: var(--ah-navy-deep);
    border: 1px solid var(--ah-line-strong);
    color: var(--ah-ink);
}

.home-domain-search .input-group-wrapper .form-control:focus {
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
}

/* The AI/advanced search swaps the input for a bare <textarea> with no
   .form-control class at all, so none of the form rules above reach it — that
   is the white box on the domain page. */
.home-domain-search .input-group-wrapper .advanced-input textarea,
.home-domain-search .advanced-input textarea {
    background-color: var(--ah-navy-deep);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
    color: var(--ah-ink);
    padding: 12px 14px;
}

.home-domain-search .advanced-input textarea::placeholder { color: var(--ah-muted); }

.home-domain-search .advanced-input textarea:focus {
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
    outline: none;
}

/* "Include TLDs" / "Maximum Length" are bootstrap-multiselect buttons, and
   "Safe Search" is a plain label the parent paints #333. */
.home-domain-search .advanced-input .multiselect,
.home-domain-search .advanced-input .btn-group > .btn {
    background-color: var(--ah-surface-2);
    border: 1px solid var(--ah-line-strong) !important;
    border-radius: 8px !important;
    color: var(--ah-body);
}

.home-domain-search .advanced-input label { color: var(--ah-body); }

/* The parent hardcodes a darker green here, outside the bg-color remap. */
.home-domain-search .input-group-wrapper .advanced-input .btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: #04231a;
}

.home-domain-search .tld-logos { color: var(--ah-muted); }
.home-domain-search .tld-logos li { color: var(--ah-muted); }

/* --------------------------------------------------------------------------
   7. Sidebar
   -------------------------------------------------------------------------- */

.sidebar .card,
.sidebar .card-sidebar {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
}

.sidebar .card-header {
    background-color: var(--ah-raise);
    border-bottom: 1px solid var(--ah-line);
}

.sidebar .card-title {
    color: var(--ah-ink);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.sidebar .card-minimise { color: var(--ah-muted); }

.sidebar .list-group,
.sidebar .list-group-flush { background: transparent; }

.list-group-item,
.sidebar .list-group-item {
    background-color: transparent;
    border-color: var(--ah-line-soft);
    color: var(--ah-body);
}

.list-group-item-action:hover,
.list-group-item-action:focus,
.sidebar .list-group-item:hover {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

.list-group-item.active,
.sidebar .list-group-item.active,
.sidebar .list-group-item.active:hover,
.sidebar .list-group-item.active:focus {
    background-color: var(--ah-blue-tint);
    border-color: rgba(79, 209, 255, 0.3);
    box-shadow: inset 3px 0 0 var(--ah-blue);
    color: var(--ah-ink);
    font-weight: 600;
}

.sidebar .list-group-item .badge,
.list-group-item .badge {
    background-color: var(--ah-surface-2);
    color: var(--ah-body);
}

.sidebar .list-group-item.disabled {
    color: var(--ah-muted);
    opacity: 0.55;
}

.sidebar-menu-item-icon { color: var(--ah-cyan); }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.18s var(--ah-ease-out),
                color 0.18s var(--ah-ease-out),
                border-color 0.18s var(--ah-ease-out),
                box-shadow 0.18s var(--ah-ease-out),
                transform 0.18s var(--ah-ease-out);
}

.btn-primary,
.btn-info {
    background-color: var(--ah-blue);
    border-color: var(--ah-blue);
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus,
.btn-info:hover, .btn-info:focus {
    background-color: var(--ah-blue-hover);
    border-color: var(--ah-blue-hover);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: #0069d1;
    border-color: #0069d1;
    transform: none;
}

.btn-default,
.btn-secondary,
.btn-light {
    background-color: var(--ah-surface);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.btn-default:hover, .btn-default:focus,
.btn-secondary:hover, .btn-secondary:focus,
.btn-light:hover, .btn-light:focus {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line-hover);
    color: var(--ah-ink);
    transform: translateY(-1px);
}

.btn-default:not(:disabled):not(.disabled):active,
.btn-default.active,
.btn-secondary:not(:disabled):not(.disabled):active {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.btn-outline-primary {
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--ah-blue);
    border-color: var(--ah-blue);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--ah-line-strong);
    color: var(--ah-body);
}

.btn-outline-secondary:hover {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line-hover);
    color: var(--ah-ink);
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: #04231a;
}

.btn-success:hover, .btn-success:focus {
    background-color: var(--ah-success);
    border-color: var(--ah-success);
    color: #04231a;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #e0384a;
    border-color: #e0384a;
    color: #fff;
}

.btn-danger:hover, .btn-danger:focus {
    background-color: var(--ah-danger);
    border-color: var(--ah-danger);
    color: #fff;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--ah-warning);
    border-color: var(--ah-warning);
    color: #251a02;
}

.btn-warning:hover, .btn-warning:focus {
    background-color: #fbbf24;
    border-color: #fbbf24;
    color: #251a02;
    transform: translateY(-1px);
}

.btn-link { color: var(--ah-cyan); }
.btn-link:hover { color: var(--ah-ice); }

.btn.disabled, .btn:disabled {
    box-shadow: none;
    opacity: 0.45;
    transform: none;
}

.btn-group > .btn:not(:first-child),
.btn-group > .btn:not(:last-child) { border-radius: 0; }
.btn-group > .btn:first-child { border-bottom-left-radius: 10px; border-top-left-radius: 10px; }
.btn-group > .btn:last-child { border-bottom-right-radius: 10px; border-top-right-radius: 10px; }

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */

.form-control,
.custom-select,
select.form-control,
textarea.form-control,
.input-group-text {
    background-color: var(--ah-navy-deep);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
    color: var(--ah-ink);
}

.form-control:focus,
.custom-select:focus {
    background-color: var(--ah-navy-deep);
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
    color: var(--ah-ink);
}

.form-control::placeholder { color: var(--ah-muted); opacity: 1; }

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--ah-bg-soft);
    color: var(--ah-muted);
}

/* The native dropdown arrow is a dark SVG data-URI in Bootstrap; on a dark
   field it vanishes, so redraw it in the body text colour. */
.custom-select,
select.form-control:not([multiple]):not([size]) {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23b0bdcf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    padding-right: 34px;
}

select.form-control option,
.custom-select option {
    background-color: var(--ah-surface);
    color: var(--ah-ink);
}

label, .control-label, .col-form-label { color: var(--ah-ink); font-weight: 500; }

.form-text, .help-block { color: var(--ah-muted); }

fieldset legend {
    border-bottom: 1px solid var(--ah-line);
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
}

.custom-control-label::before {
    background-color: var(--ah-navy-deep);
    border-color: var(--ah-line-strong);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--ah-blue);
    border-color: var(--ah-blue);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
}

.custom-file-label,
.custom-file-label::after {
    background-color: var(--ah-navy-deep);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.input-group-text { color: var(--ah-muted); }

.was-validated .form-control:invalid,
.form-control.is-invalid { border-color: var(--ah-danger); }

.was-validated .form-control:valid,
.form-control.is-valid { border-color: var(--ah-success); }

.invalid-feedback { color: var(--ah-danger); }
.valid-feedback { color: var(--ah-success); }

/* WHMCS bundles iCheck for radios/checkboxes on several forms; its sprite is
   drawn for a light background, so knock the container back rather than
   letting a white square sit in the middle of a dark form row. */
.iradio_square-blue, .icheckbox_square-blue { filter: brightness(0.92); }

/* --------------------------------------------------------------------------
   10. Tables
   -------------------------------------------------------------------------- */

.table {
    color: var(--ah-body);
}

.table th,
.table td {
    border-color: var(--ah-line-soft);
}

.table thead th {
    background-color: var(--ah-raise);
    border-bottom: 1px solid var(--ah-line);
    color: var(--ah-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--ah-raise-soft);
}

.table-hover tbody tr:hover {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

.table-bordered,
.table-bordered th,
.table-bordered td { border-color: var(--ah-line); }

/* :not(.btn) so the rule cannot match the action buttons WHMCS renders in the
   last column of the invoice and service tables. */
.table a:not(.btn) { color: var(--ah-cyan); }

/* Contextual row states — Bootstrap's pastel fills are unreadable on dark. */
.table .table-active, .table .table-active > td, .table .table-active > th { background-color: var(--ah-surface-2); }
.table .table-success, .table .table-success > td { background-color: rgba(52, 211, 153, 0.12); color: var(--ah-ink); }
.table .table-warning, .table .table-warning > td { background-color: rgba(245, 158, 11, 0.12); color: var(--ah-ink); }
.table .table-danger,  .table .table-danger > td  { background-color: rgba(240, 97, 109, 0.12); color: var(--ah-ink); }
.table .table-info,    .table .table-info > td    { background-color: var(--ah-blue-tint); color: var(--ah-ink); }

/* DataTables chrome (WHMCS uses it for the invoice/service/ticket lists). */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { color: var(--ah-muted); }

/* DataTables emits its length menu and search box as bare <select>/<input>
   with no class at all, so none of the .form-control rules above reach them —
   they stayed white-on-white on every list page in the client area. */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 8px;
    color: var(--ah-ink);
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
    outline: none;
}

.dataTables_wrapper .dataTables_length select option {
    background-color: var(--ah-surface);
    color: var(--ah-ink);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--ah-surface) !important;
    border: 1px solid var(--ah-line) !important;
    border-radius: 8px;
    color: var(--ah-body) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--ah-blue) !important;
    border-color: var(--ah-blue) !important;
    color: #fff !important;
}

/* List tables sit in .table-container, which is NOT inside a .card-body — so
   unlike the cards elsewhere they get no overflow containment from the parent.
   WHMCS relies on DataTables Responsive (`responsive: true` in
   includes/tablelist.tpl) to collapse columns on narrow screens, which works,
   but means a page whose JS has not run or has failed scrolls sideways instead.
   This is the belt to that braces: the table scrolls within its own container
   and the page body never does. */
.table-container {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* .table-list — the class on every WHMCS list (invoices, tickets, services,
   domains, quotes). The parent fills its cells with #fff through
   `.table-list > tbody > tr > td` (0,1,3) and `table.table-list thead th`
   (0,1,2); a plain `.table td` override (0,1,1) loses to both, so these mirror
   the parent's selectors exactly and win on load order instead. */
.dataTables_wrapper table.table-list {
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius);
    overflow: hidden;
}

table.table-list thead th {
    background-color: var(--ah-raise);
    border-bottom: 1px solid var(--ah-line);
    color: var(--ah-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dataTables_wrapper table.table-list thead th {
    border-bottom: 1px solid var(--ah-line);
}

.dataTables_wrapper table.table-list thead th.sorting_asc,
.dataTables_wrapper table.table-list thead th.sorting_desc {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

.table-list > tbody > tr > td {
    background-color: var(--ah-surface);
    border-color: var(--ah-line-soft);
    color: var(--ah-body);
}

.table-list > tbody > tr:hover > td {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

.table-list > tbody > tr > td a.border-left {
    border-left-color: var(--ah-line) !important;
}

.table-list .ticket-number { color: var(--ah-muted); }
.table-list .ticket-subject { color: var(--ah-body); }
.table-list > tbody > tr:hover .ticket-subject { color: var(--ah-ink); }
.table-list .ticket-subject.unread { color: var(--ah-ink); }

/* --------------------------------------------------------------------------
   11. Alerts, badges, labels, progress
   -------------------------------------------------------------------------- */

.alert {
    border-radius: var(--ah-radius);
    border-width: 1px;
}

.alert-primary, .alert-info {
    background-color: var(--ah-blue-tint);
    border-color: rgba(79, 209, 255, 0.35);
    color: var(--ah-fg-info);
}

.alert-success {
    background-color: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--ah-fg-success);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--ah-fg-warn);
}

.alert-danger {
    background-color: rgba(240, 97, 109, 0.12);
    border-color: rgba(240, 97, 109, 0.4);
    color: var(--ah-fg-danger);
}

.alert-secondary, .alert-light, .alert-dark {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.alert a:not(.btn), .alert .alert-link { color: inherit; text-decoration: underline; }
.alert-heading { color: inherit; }

.badge-primary, .badge-info { background-color: var(--ah-blue); color: #fff; }
.badge-success { background-color: #10b981; color: #04231a; }
.badge-warning { background-color: var(--ah-warning); color: #251a02; }
.badge-danger  { background-color: #e0384a; color: #fff; }
.badge-secondary, .badge-light, .badge-dark {
    background-color: var(--ah-surface-2);
    color: var(--ah-body);
}

/* WHMCS status pills (Active / Pending / Suspended / Cancelled …). */
.label, .status {
    border-radius: 999px;
    font-weight: 600;
}

.progress { background-color: var(--ah-navy-deep); border-radius: 999px; }
.progress-bar { background-color: var(--ah-blue); }

/* --------------------------------------------------------------------------
   12. Modals, popovers, tooltips
   -------------------------------------------------------------------------- */

.modal-content {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow-md);
    color: var(--ah-body);
}

.modal-header,
.modal-footer { border-color: var(--ah-line); }

.modal-title { color: var(--ah-ink); }

.modal-backdrop.show { opacity: 0.7; }

.close, .modal .close {
    color: var(--ah-ink);
    opacity: 0.6;
    text-shadow: none;
}

.close:hover { color: var(--ah-ink); opacity: 1; }

.modal-localisation .item {
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line);
    border-radius: 8px;
    color: var(--ah-body);
    display: block;
    margin-bottom: 8px;
    padding: 8px 12px;
}

.modal-localisation .item:hover,
.modal-localisation .item.active {
    background: var(--ah-blue-tint);
    border-color: rgba(79, 209, 255, 0.35);
    color: var(--ah-ink);
}

.popover {
    background-color: var(--ah-surface);
    border-color: var(--ah-line-strong);
    border-radius: var(--ah-radius);
    box-shadow: var(--ah-shadow-md);
    color: var(--ah-body);
}

.popover-header {
    background-color: var(--ah-surface-2);
    border-bottom-color: var(--ah-line);
    color: var(--ah-ink);
}

.popover-body { color: var(--ah-body); }

.bs-popover-top > .arrow::after,
.bs-popover-auto[x-placement^="top"] > .arrow::after { border-top-color: var(--ah-surface); }
.bs-popover-bottom > .arrow::after,
.bs-popover-auto[x-placement^="bottom"] > .arrow::after { border-bottom-color: var(--ah-surface); }
.bs-popover-left > .arrow::after,
.bs-popover-auto[x-placement^="left"] > .arrow::after { border-left-color: var(--ah-surface); }
.bs-popover-right > .arrow::after,
.bs-popover-auto[x-placement^="right"] > .arrow::after { border-right-color: var(--ah-surface); }

.tooltip-inner {
    background-color: var(--ah-surface-2);
    border-radius: 8px;
    color: var(--ah-ink);
}

.bs-tooltip-top .arrow::before { border-top-color: var(--ah-surface-2); }
.bs-tooltip-bottom .arrow::before { border-bottom-color: var(--ah-surface-2); }
.bs-tooltip-left .arrow::before { border-left-color: var(--ah-surface-2); }
.bs-tooltip-right .arrow::before { border-right-color: var(--ah-surface-2); }

.client-alerts li a { color: var(--ah-body); }
.client-alerts li a:hover { color: var(--ah-ink); }
.client-alerts li.none { color: var(--ah-muted); }

#fullpage-overlay { background-color: var(--ah-overlay-bg); }
#fullpage-overlay .msg { color: var(--ah-ink); }

/* --------------------------------------------------------------------------
   13. Tabs, pills, pagination, accordion
   -------------------------------------------------------------------------- */

.nav-tabs { border-bottom-color: var(--ah-line); }

.nav-tabs .nav-link {
    border: 1px solid transparent;
    color: var(--ah-muted);
}

.nav-tabs .nav-link:hover {
    border-color: transparent transparent var(--ah-line-strong);
    color: var(--ah-ink);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border-color: transparent transparent var(--ah-blue);
    border-bottom-width: 2px;
    color: var(--ah-ink);
    font-weight: 600;
}

.nav-pills .nav-link { border-radius: 999px; color: var(--ah-body); }
.nav-pills .nav-link:hover { background-color: var(--ah-surface); color: var(--ah-ink); }
.nav-pills .nav-link.active { background-color: var(--ah-blue); color: #fff; }

/* The child selectors are needed, not decorative: the parent theme carries a
   Bootstrap-3 compatibility rule `.pagination > li > a` (0,2,1) setting #444,
   which outranks a bare `.page-link` (0,1,0) and leaves dark grey digits on a
   dark surface. .page-item.active/.disabled below are (0,3,0) and still win. */
.page-link,
.pagination > li > a,
.pagination > li > span {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.page-link:hover,
.pagination > li > a:hover,
.pagination > li > span:hover {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.page-item.active .page-link {
    background-color: var(--ah-blue);
    border-color: var(--ah-blue);
    color: #fff;
}

.page-item.disabled .page-link {
    background-color: var(--ah-bg-soft);
    border-color: var(--ah-line-soft);
    color: var(--ah-muted);
}

.accordion .card-header { cursor: pointer; }

/* --------------------------------------------------------------------------
   14. Bootstrap utility neutralisation
   These are declared !important by Bootstrap itself, and WHMCS templates use
   them liberally (bg-white cards, text-dark headings). Left alone they punch
   white holes in a dark page, so each needs an !important counterpart.
   -------------------------------------------------------------------------- */

.bg-white  { background-color: var(--ah-surface) !important; }
.bg-light  { background-color: var(--ah-bg-soft) !important; }
.bg-dark   { background-color: var(--ah-navy-deep) !important; }
.bg-secondary { background-color: var(--ah-surface-2) !important; }
.bg-primary, .bg-info { background-color: var(--ah-blue) !important; }
.bg-success { background-color: #10b981 !important; }
.bg-warning { background-color: var(--ah-warning) !important; }
.bg-danger  { background-color: #e0384a !important; }

.text-dark  { color: var(--ah-ink) !important; }
.text-light, .text-white { color: var(--ah-ink) !important; }
.text-muted { color: var(--ah-muted) !important; }
.text-black-50 { color: var(--ah-muted) !important; }
.text-primary, .text-info { color: var(--ah-cyan) !important; }
.text-success { color: var(--ah-success) !important; }
.text-warning { color: var(--ah-fg-warn) !important; }
.text-danger  { color: var(--ah-danger) !important; }
.text-secondary { color: var(--ah-body) !important; }

.border { border-color: var(--ah-line) !important; }
.border-top, .border-right, .border-bottom, .border-left { border-color: var(--ah-line) !important; }
.border-light, .border-white, .border-secondary { border-color: var(--ah-line) !important; }

/* .bg-{$type} inside includes/panel.tpl pairs with .text-white; keep the
   contrast pairing intact rather than letting the override above win. */
.card-title.bg-primary, .card-title.bg-info,
.card-title.bg-success, .card-title.bg-danger,
.card-title.bg-warning, .card-title.bg-secondary {
    border-radius: var(--ah-radius) var(--ah-radius) 0 0;
    color: #fff !important;
}

.card-title.bg-warning { color: #251a02 !important; }
.card-title.bg-success { color: #04231a !important; }

.jumbotron, .well {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
    color: var(--ah-body);
}

/* --------------------------------------------------------------------------
   15. Order form (standard_cart) and store pages
   The order form's own stylesheet is linked from inside the page body, so it
   loads after this file. These rules need !important to win — that is a
   load-order fact about WHMCS, not a specificity shortcut.
   -------------------------------------------------------------------------- */

#order-standard_cart,
#order-standard_cart .cart-body,
.cart-body {
    color: var(--ah-body) !important;
}

#order-standard_cart .header-lined,
#order-standard_cart h1, #order-standard_cart h2,
#order-standard_cart h3, #order-standard_cart h4 {
    border-color: var(--ah-line) !important;
    color: var(--ah-ink) !important;
}

#order-standard_cart .product,
#order-standard_cart .product-info,
#order-standard_cart .summary-container,
#order-standard_cart .order-summary,
#order-standard_cart .domain-selection-options,
#order-standard_cart .view-cart-items,
#order-standard_cart .panel,
#order-standard_cart .cart-sidebar {
    background-color: var(--ah-surface) !important;
    border: 1px solid var(--ah-line) !important;
    border-radius: var(--ah-radius-lg) !important;
    box-shadow: var(--ah-shadow-sm) !important;
    color: var(--ah-body) !important;
}

#order-standard_cart .product:hover,
#order-standard_cart .product-selected {
    border-color: var(--ah-line-strong) !important;
}

#order-standard_cart .product-selected {
    box-shadow: 0 0 0 2px var(--ah-blue), var(--ah-shadow-md) !important;
}

#order-standard_cart .product h3,
#order-standard_cart .product-name {
    color: #fff !important;
    font-family: var(--ah-font-display) !important;
}

#order-standard_cart .price,
#order-standard_cart .product-pricing,
#order-standard_cart .cart-total,
#order-standard_cart .total-due-today {
    color: var(--ah-cyan) !important;
    font-variant-numeric: tabular-nums;
}

#order-standard_cart .product-desc,
#order-standard_cart .product-info small { color: var(--ah-muted) !important; }

#order-standard_cart .table,
#order-standard_cart .table td,
#order-standard_cart .table th {
    border-color: var(--ah-line-soft) !important;
    color: var(--ah-body) !important;
}

#order-standard_cart .form-control,
#order-standard_cart select,
#order-standard_cart input[type="text"],
#order-standard_cart input[type="email"],
#order-standard_cart input[type="password"],
#order-standard_cart textarea {
    background-color: var(--ah-navy-deep) !important;
    border: 1px solid var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

#order-standard_cart .btn-primary,
#order-standard_cart .btn-checkout {
    background-color: var(--ah-blue) !important;
    border-color: var(--ah-blue) !important;
    color: #fff !important;
}

/* Domain availability results — keep the semantic green/red readable. */
#order-standard_cart .domain-available,
#order-standard_cart .available { color: var(--ah-success) !important; }
#order-standard_cart .domain-unavailable,
#order-standard_cart .unavailable { color: var(--ah-danger) !important; }

/* ---------- Cart sweep ----------

   The same mechanical audit run against standard_cart's own style.css. These
   live here rather than in the forked order form's stylesheet on purpose: the
   fork is optional, and an install still on stock standard_cart needs them
   just as much. That also means they load *before* the cart's own stylesheet,
   hence !important throughout. */

/* The cart header bar and the rule under the line items are a hardcoded #058
   — a blue that belongs to no part of this brand. */
#order-standard_cart .view-cart-items-header {
    background-color: var(--ah-surface-2) !important;
    border-radius: var(--ah-radius) var(--ah-radius) 0 0 !important;
    color: var(--ah-muted) !important;
    font-size: 0.76rem !important;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#order-standard_cart .view-cart-items { border-bottom-color: var(--ah-line) !important; }

/* The promo area. Its active tab and panel are both #f8f8f8, which rendered as
   a white stub floating above a white box — the most obviously broken thing on
   the page. */
#order-standard_cart .view-cart-tabs .tab-content,
#order-standard_cart .view-cart-tabs .nav-tabs a[aria-selected="true"],
#order-standard_cart .view-cart-tabs .nav-tabs a[aria-expanded="true"] {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-ink) !important;
}

#order-standard_cart .view-cart-tabs .nav-tabs { border-bottom-color: var(--ah-line) !important; }
#order-standard_cart .view-cart-tabs .nav-tabs a { color: var(--ah-muted) !important; }

#order-standard_cart .view-cart-promotion-code {
    background-color: var(--ah-tint-success) !important;
    border: 1px dashed rgba(52, 211, 153, 0.45) !important;
    border-radius: 10px !important;
    color: var(--ah-fg-success) !important;
}

/* Domain search and suggestions */
#order-standard_cart .domain-checker-container {
    background: var(--ah-navy) !important;
    border: 1px solid var(--ah-line) !important;
    border-radius: var(--ah-radius-lg) !important;
}

#order-standard_cart .domain-checker-container .input-group-box,
#order-standard_cart .domain-checker-advanced {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

#order-standard_cart .domain-checker-unavailable,
#order-standard_cart .domain-checker-invalid { color: var(--ah-danger) !important; }

#order-standard_cart .spotlight-tlds,
#order-standard_cart .spotlight-tld,
#order-standard_cart .domain-promo-box,
#order-standard_cart .suggested-domains .domain-lookup-suggestions-message {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-body) !important;
}

#order-standard_cart .transfer-eligible { color: var(--ah-success) !important; }
#order-standard_cart .transfer-not-eligible { color: var(--ah-danger) !important; }

/* Renewals */
#order-standard_cart .domain-renewals,
#order-standard_cart .service-renewals,
#order-standard_cart .addon-renewals .service-renewal,
#order-standard_cart .addon-renewals > div {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-body) !important;
}

#order-standard_cart .domain-renewals .domain-renewal:nth-child(even),
#order-standard_cart .service-renewals .service-renewal:nth-child(even) {
    background-color: var(--ah-raise) !important;
}

#order-standard_cart .service-renewals .div-renewal-ineligible { color: var(--ah-muted) !important; }

/* Checkout: card entry, captcha, account switcher */
#order-standard_cart .cc-input-container,
#order-standard_cart .account-select-container,
#order-standard_cart .account,
#order-standard_cart .default-captcha,
#order-standard_cart .panel-addon,
#order-standard_cart .panel-price,
#order-standard_cart .apply-credit-container,
#order-standard_cart .view-cart-gateway-checkout {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-body) !important;
}

#order-standard_cart .btn-remove-from-cart { color: var(--ah-muted) !important; }
#order-standard_cart .btn-remove-from-cart:hover { color: var(--ah-danger) !important; }

#order-standard_cart .domain-checker-available {
    background-color: var(--ah-tint-success) !important;
    color: var(--ah-fg-success) !important;
}

#order-standard_cart .addon-promo-container {
    background-color: var(--ah-surface) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-body) !important;
}

/* --------------------------------------------------------------------------
   16. Invoices
   -------------------------------------------------------------------------- */

.invoice-container,
#invoice {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
    color: var(--ah-body);
}

.invoice-header, .invoice-details { color: var(--ah-ink); }
.invoice-total { color: var(--ah-cyan); }

/* Paid/unpaid stamps ship as background images tinted for a white sheet;
   soften them so they read as an overlay rather than a bright decal. */
.invoice-paid-stamp, .invoice-unpaid-stamp { opacity: 0.75; }

/* --------------------------------------------------------------------------
   17. Support tickets & knowledgebase
   -------------------------------------------------------------------------- */

.ticket-reply,
.ticket-message,
.support-ticket-reply {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius);
    color: var(--ah-body);
}

/* Staff replies get the brand tint so the thread is scannable at a glance. */
.ticket-reply.staff,
.ticket-message.staff,
.ticket-reply-staff {
    background-color: var(--ah-blue-tint);
    border-color: rgba(79, 209, 255, 0.3);
}

.kb-article, .kbarticle { color: var(--ah-body); }
.kb-article a:not(.btn), .kbarticle a:not(.btn) { color: var(--ah-cyan); }

/* Markdown editor (SimpleMDE) used on ticket replies. */
.CodeMirror,
.editor-toolbar,
.editor-preview,
.editor-statusbar {
    background-color: var(--ah-navy-deep) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

.editor-toolbar a { color: var(--ah-body) !important; }
.editor-toolbar a:hover, .editor-toolbar a.active {
    background: var(--ah-surface-2) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

.CodeMirror-cursor { border-left-color: var(--ah-ink) !important; }

/* --------------------------------------------------------------------------
   18. Footer
   -------------------------------------------------------------------------- */

footer.footer {
    background-color: var(--ah-navy-deep);
    border-top: 1px solid var(--ah-line);
    color: var(--ah-body);
}

footer.footer .nav-link { color: var(--ah-body); }
footer.footer .nav-link:hover { color: #fff; }

footer.footer .btn {
    background-color: var(--ah-raise-strong);
    border: 1px solid var(--ah-line-strong);
    color: var(--ah-body);
}

footer.footer .btn:hover {
    background-color: var(--ah-raise-strong);
    border-color: var(--ah-line-hover);
    color: #fff;
}

footer.footer .btn-icon { border-radius: 999px; }

footer.footer .copyright,
footer.footer .notices { color: var(--ah-muted); }

/* Links added by the optional hook (see hooks/avalanche_nav.php). */
.ah-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    justify-content: center;
    margin-bottom: 22px;
}

.ah-footer-links a {
    color: var(--ah-body);
    font-size: 0.9rem;
}

.ah-footer-links a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   19. Misc third-party widgets bundled with WHMCS
   -------------------------------------------------------------------------- */

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-dropdown,
.select2-search__field {
    background-color: var(--ah-navy-deep) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--highlighted {
    background-color: var(--ah-blue) !important;
    color: #fff !important;
}

.multiselect-container,
.multiselect-container li a {
    background-color: var(--ah-surface) !important;
    color: var(--ah-body) !important;
}

.multiselect-container li a:hover {
    background-color: var(--ah-surface-2) !important;
    color: var(--ah-ink) !important;
}

.datepicker, .datepicker table tr td, .datepicker table tr th {
    background-color: var(--ah-surface) !important;
    color: var(--ah-body) !important;
}

.datepicker table tr td.active,
.datepicker table tr td.today {
    background-color: var(--ah-blue) !important;
    color: #fff !important;
}

/* intl-tel-input country dropdown. */
.iti__country-list {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.iti__country.iti__highlight { background-color: var(--ah-surface-2); }
.iti__dial-code { color: var(--ah-muted); }

/* Password strength meter. */
.password-strength-meter .progress-bar { border-radius: 999px; }

/* --------------------------------------------------------------------------
   20. Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .btn,
    .card-columns.home .card,
    .action-icon-btns a {
        transition: none;
    }

    .btn:hover,
    .card-columns.home .card:hover,
    .action-icon-btns a:hover {
        transform: none;
    }
}

/* ==========================================================================
   SaaS dashboard components

   Everything below styles markup this theme adds via its own template
   overrides (clientareahome, clientareainvoices, viewticket) plus the
   notification bell the parent already renders. Class names are all ah-*
   prefixed so they can never collide with Bootstrap or WHMCS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   D1. Dashboard stat cards
   -------------------------------------------------------------------------- */

.ah-dash {
    display: grid;
    gap: var(--ah-stack);
    grid-template-columns: repeat(4, 1fr);
}

.ah-dash-card {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow-sm);
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    position: relative;
    transition: border-color 0.22s var(--ah-ease-out),
                box-shadow 0.22s var(--ah-ease-out),
                transform 0.22s var(--ah-ease-out);
}

.ah-dash-card:hover {
    border-color: var(--ah-line-strong);
    box-shadow: var(--ah-shadow-md);
    color: inherit;
    transform: translateY(-3px);
}

.ah-dash-icon {
    align-items: center;
    background: var(--ah-blue-tint);
    border: 1px solid rgba(79, 209, 255, 0.3);
    border-radius: 12px;
    color: var(--ah-cyan);
    display: flex;
    height: 40px;
    justify-content: center;
    margin-bottom: 16px;
    width: 40px;
}

.ah-dash-icon-cyan   { background: rgba(125, 211, 252, 0.14); border-color: rgba(125, 211, 252, 0.3); color: var(--ah-ice); }
.ah-dash-icon-purple { background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.3); color: #c4b5fd; }
.ah-dash-icon-gold   { background: rgba(245, 158, 11, 0.14);  border-color: rgba(245, 158, 11, 0.3);  color: var(--ah-fg-warn); }

.ah-dash-value {
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Currency runs longer than a count, so it gets a smaller size rather than
   wrapping or overflowing the card. */
.ah-dash-value-money {
    font-size: 1.35rem;
    white-space: nowrap;
}

.ah-dash-label {
    color: var(--ah-body);
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 4px;
}

.ah-dash-meta {
    color: var(--ah-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* A left accent bar carries the state, so the card body stays calm. */
.ah-dash-card::before {
    border-radius: var(--ah-radius-lg) 0 0 var(--ah-radius-lg);
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    top: 0;
    width: 3px;
}

.ah-dash-card-active::before  { background: var(--ah-blue); }
.ah-dash-card-warning::before { background: var(--ah-warning); }
.ah-dash-card-danger::before  { background: var(--ah-danger); }

.ah-dash-card-danger .ah-dash-meta  { color: var(--ah-fg-danger); }
.ah-dash-card-warning .ah-dash-meta { color: var(--ah-fg-warn); }

@media (max-width: 991.98px) { .ah-dash { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .ah-dash { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   D2. Invoice summary strip
   -------------------------------------------------------------------------- */

/* 210px, not 190px: a formatted total like "$1,248.00 USD" at this type size
   needs ~205px, and at the smaller track it wrapped onto two lines. */
.ah-stat-row {
    display: grid;
    gap: var(--ah-stack);
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* The accent bar is reserved for cards that need attention. Giving every card
   a bright left edge — including the purely informational ones — was what made
   the summary strip read as noise rather than as a hierarchy. */
.ah-stat {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-left: 3px solid var(--ah-line);
    border-radius: var(--ah-radius);
    padding: 18px 20px;
}

.ah-stat-danger  { border-left-color: var(--ah-danger); }
.ah-stat-warning { border-left-color: var(--ah-warning); }

.ah-stat-label {
    color: var(--ah-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.ah-stat-value {
    color: var(--ah-ink);
    font-family: var(--ah-font-display);
    font-size: 1.6rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 6px;
    /* A currency total must never break across lines mid-amount. */
    white-space: nowrap;
}

.ah-stat-meta { color: var(--ah-muted); font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   D3. Invoice table — due countdown and row actions
   -------------------------------------------------------------------------- */

.ah-due {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-left: 8px;
    padding: 2px 9px;
    vertical-align: middle;
    white-space: nowrap;
}

.ah-due-overdue { background: rgba(240, 97, 109, 0.16); color: var(--ah-fg-danger); }
.ah-due-today   { background: rgba(245, 158, 11, 0.18); color: var(--ah-fg-warn); }
.ah-due-soon    { background: rgba(245, 158, 11, 0.12); color: var(--ah-fg-warn); }
.ah-due-later   { background: var(--ah-surface-2); color: var(--ah-muted); }

/* Header alignment.

   The parent centres every header in a list table (`table.table-list thead th`)
   while the cells below are left-aligned, so each column's label floats away
   from its own data — the single biggest source of visual noise in these
   tables. Headers are realigned to their column's content here.

   Only the two tables this theme owns are touched. Other stock lists differ:
   clientareaproducts.tpl centres most of its cells, so its centred headers
   already match, and blanket-aligning would break it. */
/* The `table.` prefix is required, not stylistic. The parent's rules are
   `table.table-list thead th` and `table.table-list tbody td` — (0,1,3). A
   selector of the shape `.ah-invoice-table thead th` is only (0,1,2) and
   silently loses, leaving the headers centred and the padding untouched. */
table.table-list.ah-invoice-table thead th,
table.table-list.ah-ticket-table thead th {
    padding: 10px 12px;
    text-align: left;
}

table.table-list.ah-invoice-table thead th.ah-col-actions { text-align: right; }

/* Ticket "last updated" cells carry Bootstrap's .text-center (declared
   !important), so that header stays centred to match. */
table.table-list.ah-ticket-table thead th:nth-child(4) { text-align: center; }

/* Room to breathe. The parent's 10px/8px cell padding is tight once a row
   carries a status pill, a countdown chip and two buttons. */
table.table-list.ah-invoice-table tbody td,
table.table-list.ah-ticket-table tbody td {
    padding: 14px 12px;
}

.ah-col-actions { text-align: right; white-space: nowrap; width: 1%; }

.ah-action { margin-left: 6px; }

/* .btn is display:inline-block here, so an icon and its label sit flush
   together. Lay the button out as a flex row to get a real gap. */
.ah-action {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

/* The PDF download is secondary to Pay: keep it quiet until hover so each row
   presents one obvious action rather than two competing ones. */
.ah-action-icon {
    background: transparent;
    border-color: transparent;
    color: var(--ah-muted);
    padding-left: 10px;
    padding-right: 10px;
}

.ah-action-icon:hover {
    background: var(--ah-surface-2);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

@media (max-width: 767.98px) {
    .ah-action-label { display: none; }
}

.ah-ticket-unread .ticket-subject.unread { color: var(--ah-ink); font-weight: 700; }

.ah-ticket-unread td:first-child { box-shadow: inset 3px 0 0 var(--ah-blue); }

/* Invoice page: table beside the balance panel. The panel drops above the
   table on narrow screens — the amount owed is the headline, so it should not
   end up below a long list. */
.ah-invoice-layout {
    align-items: start;
    display: grid;
    gap: var(--ah-stack);
    grid-template-columns: minmax(0, 1fr) 290px;
}

.ah-invoice-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 16px;
}

@media (max-width: 991.98px) {
    .ah-invoice-layout { grid-template-columns: minmax(0, 1fr); }
    .ah-invoice-side { order: -1; position: static; }
}

/* --------------------------------------------------------------------------
   D4. Payment history
   -------------------------------------------------------------------------- */

.ah-payment-list { display: flex; flex-direction: column; gap: 2px; }

.ah-payment {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 14px;
    padding: 12px 14px;
    transition: background 0.15s ease;
}

.ah-payment:hover { background: var(--ah-surface-2); }

.ah-payment-icon {
    align-items: center;
    background: rgba(52, 211, 153, 0.15);
    border-radius: 50%;
    color: var(--ah-success);
    display: flex;
    flex-shrink: 0;
    font-size: 0.7rem;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.ah-payment-main { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }

.ah-payment-amount {
    color: var(--ah-ink);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.ah-payment-main a { color: var(--ah-cyan); font-size: 0.84rem; }

.ah-payment-meta {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    font-size: 0.8rem;
    text-align: right;
}

.ah-payment-gateway { color: var(--ah-body); text-transform: capitalize; }
.ah-payment-date { color: var(--ah-muted); }

.ah-payment-more {
    border-top: 1px solid var(--ah-line-soft);
    color: var(--ah-muted);
    font-size: 0.82rem;
    margin-top: 10px;
    padding-top: 12px;
}

/* --------------------------------------------------------------------------
   D5. Ticket thread — avatars, staff tags
   -------------------------------------------------------------------------- */

/* The parent sets `.view-ticket .posted-by` (0,2,0) to #f6f6f6/#888. A bare
   `.ah-posted-by` (0,1,0) loses to it, so the header bar is restyled through
   the parent's own selector and the ah- class only carries layout. */
.view-ticket .posted-by {
    background-color: var(--ah-raise);
    border-bottom: 1px solid var(--ah-line-soft);
    border-radius: var(--ah-radius) var(--ah-radius) 0 0;
    color: var(--ah-muted);
}

.view-ticket .posted-by .posted-by-name { color: var(--ah-ink); }
.view-ticket .posted-on { color: var(--ah-muted); }

.view-ticket .requestor-badge {
    background: var(--ah-surface-2);
    border-radius: 999px;
    color: var(--ah-body);
}

.view-ticket .requestor-type-staff {
    background: var(--ah-blue-tint);
    color: var(--ah-fg-info);
}

.view-ticket .attachments { border-top-color: var(--ah-line) !important; }
.view-ticket .attachment-list .caption { color: var(--ah-body); }
.view-ticket .attachment-list i { color: var(--ah-cyan); }

/* Ticket page layout.

   One column in DOM order — header, reply form, thread. The reply form sits
   above the thread on purpose: people arrive at a ticket to answer it, not to
   re-read it.

   Past 1400px the page splits. The thread takes the free column and the reply
   form moves beside it as a sticky rail, so the box you came to type in stays
   on screen while the history is read. Placement is by grid-template-areas
   rather than source order, so the DOM keeps reply-before-thread for narrow
   screens, keyboard order and screen readers.

   The split is opt-in through .ah-ticket-layout-split, which the template
   emits only when a reply form is actually rendered: a closed ticket has no
   reply box, and would otherwise reserve an empty 460px column beside the
   thread.

   This replaced a right-hand Ticket Information panel that repeated, field for
   field, the Ticket Information panel WHMCS already puts in the sidebar. */
/* One column, auto-placed in DOM order. Deliberately NOT named areas here: a
   closed ticket renders no reply column, and a "reply" row that nothing lands
   in still collapses to zero height between two full gaps — a 48px hole under
   the header. Auto-placement has no row to leave behind. */
.ah-ticket-layout {
    display: grid;
    gap: var(--ah-stack);
    grid-template-columns: minmax(0, 1fr);
}

.ah-ticket-reply-col,
.ah-ticket-thread-col { min-width: 0; }

/* Inside the grid the gap is the only spacer — the stack margin that every
   .primary-content .card carries would double it. */
.ah-ticket-layout > .card,
.ah-ticket-layout > * > .card { margin-bottom: 0; }

@media (min-width: 1400px) {
    /* The header spans both columns rather than sharing row 1 with the reply
       rail. It reads better full width — title left, actions hard right — and
       it sidesteps grid's height distribution: a reply card spanning two rows
       pushes its own excess height back into row 1, which left a ~200px hole
       between the header and the thread beneath it. */
    .ah-ticket-layout-split {
        align-items: start;
        grid-template-areas:
            "head   head"
            "thread reply";
        grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
    }

    .ah-ticket-layout-split .ah-ticket-head { grid-area: head; }
    .ah-ticket-layout-split .ah-ticket-thread-col { grid-area: thread; }

    /* Sticky needs somewhere to travel: the column stretches to the height of
       the row, and the card inside it is what actually sticks. */
    .ah-ticket-layout-split .ah-ticket-reply-col {
        align-self: stretch;
        grid-area: reply;
    }

    .ah-ticket-layout-split .ah-reply-card { position: sticky; top: 16px; }
}

/* Header card: identity on the left, actions hard right. Stacked, it left the
   whole right half of a full-width card empty. */
.ah-ticket-head-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: space-between;
}

.ah-ticket-head-main { min-width: 0; }

.ah-ticket-title {
    font-size: 1.35rem;
    margin: 0 0 4px;
}

.ah-ticket-head .ah-ticket-subject {
    color: var(--ah-body);
    font-size: 1.02rem;
    margin: 0;
}

.ah-ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ah-thread-heading {
    color: var(--ah-muted);
    font-family: var(--ah-font);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

/* Name and email on the reply form. Not a Bootstrap row: `col-md-*` is keyed
   to the viewport, and in the split layout these two sit in a ~420px column on
   a 1600px screen, where col-md-4 resolves to about 140px and truncates the
   address mid-word. auto-fit measures the column it is actually in. */
.ah-reply-identity {
    display: grid;
    gap: 0 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ah-reply-submit { margin-bottom: 0; }

.ah-posted-by {
    align-items: center;
    display: flex;
    gap: 12px;
}

.ah-posted-by-line { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }

.ah-posted-on { display: block; font-size: 0.8rem; }

/* Requestor badges. WHMCS emits owner / subaccount / operator /
   authorizeduser / registereduser / guest; each gets its own colour so the
   thread can be read at a glance without parsing names. */
.view-ticket .requestor-badge {
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: auto;
    padding: 3px 10px;
    text-transform: uppercase;
}

.view-ticket .requestor-type-operator {
    background: var(--ah-tint-info);
    color: var(--ah-fg-info);
}

.view-ticket .requestor-type-owner {
    background: var(--ah-tint-success);
    color: var(--ah-fg-success);
}

.view-ticket .requestor-type-subaccount,
.view-ticket .requestor-type-authorizeduser,
.view-ticket .requestor-type-registereduser {
    background: var(--ah-tint-purple);
    color: var(--ah-fg-purple);
}

.view-ticket .requestor-type-guest {
    background: var(--ah-surface-2);
    color: var(--ah-muted);
}

/* Markdown editor (ticket reply and Open Ticket).

   WHMCS ships TWO markdown editors and which one you get depends on the
   install: EasyMDE/CodeMirror, covered below, and jQuery bootstrap-markdown,
   covered after it. Both are styled, because a half-covered editor is a white
   sheet in the middle of a dark reply form and there is no way to tell from
   the template which one the install will render.

   CodeMirror's stylesheet is not part of the theme bundle — WHMCS loads it
   with the editor, after custom.css — so every rule here needs !important
   regardless of specificity.

   The whole inner tree is covered, not just .CodeMirror: CodeMirror paints the
   editing surface across .CodeMirror-scroll / -sizer / -lines and the gutter
   separately, so setting a background on the outer element alone leaves a
   white sheet sitting on top of it. That is what shipped, and it made the
   message box on the Open Ticket page a white rectangle. */
.container-markdown-editor,
.EasyMDEContainer,
.CodeMirror,
.EasyMDEContainer .CodeMirror,
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-lines,
.CodeMirror-gutters,
.CodeMirror-gutter,
.editor-preview,
.editor-preview-side,
.editor-statusbar,
.editor-toolbar {
    background-color: var(--ah-navy-deep) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

/* The gutter sits flush against the text; a hairline keeps them apart. */
.CodeMirror-gutters { border-right-color: var(--ah-line) !important; }

.editor-toolbar { border-radius: var(--ah-radius) var(--ah-radius) 0 0; }
.CodeMirror { border-radius: 0 0 var(--ah-radius) var(--ah-radius); }

.editor-toolbar a { color: var(--ah-body) !important; }

.editor-toolbar a:hover,
.editor-toolbar a.active {
    background: var(--ah-surface-2) !important;
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

.editor-toolbar i.separator {
    border-left-color: var(--ah-line) !important;
    border-right-color: transparent !important;
}

.editor-statusbar { color: var(--ah-muted) !important; font-size: 0.78rem; }

/* Caret and selection are drawn by CodeMirror in colours picked for a white
   sheet — an invisible caret in a reply box is its own small disaster. */
.CodeMirror-cursor { border-left-color: var(--ah-ink) !important; }
.CodeMirror-selected { background: var(--ah-surface-2) !important; }
.CodeMirror-focused .CodeMirror-selected { background: rgba(0, 130, 255, 0.28) !important; }
.CodeMirror-line::selection,
.CodeMirror-line > span::selection { background: rgba(0, 130, 255, 0.28) !important; }
.CodeMirror-placeholder { color: var(--ah-muted) !important; }

/* Fullscreen mode paints its own backdrop. */
.CodeMirror-fullscreen,
.editor-preview-active-side,
.editor-preview-active { background-color: var(--ah-navy-deep) !important; }

/* Markdown syntax highlighting — the defaults are tuned for white. */
.cm-s-easymde .cm-header,
.CodeMirror .cm-header { color: var(--ah-ink) !important; }
.cm-s-easymde .cm-link,
.CodeMirror .cm-link,
.CodeMirror .cm-url { color: var(--ah-cyan) !important; }
.CodeMirror .cm-quote { color: var(--ah-muted) !important; }
.CodeMirror .cm-comment { background: var(--ah-surface-2) !important; color: var(--ah-fg-info) !important; }

/* ---------- bootstrap-markdown ----------

   The other editor, and the one a stock WHMCS 8 install actually renders on
   the ticket reply and Open Ticket forms. It wraps the textarea in
   `.md-editor` and adds `.md-input` to it, keeping `.form-control`, and its
   own stylesheet then paints the editing surface `#eee` and the focused state
   `#fff`:

       .md-editor > textarea       { background: #eee }   (0,1,1)
       .md-editor > textarea:focus { background: #fff }   (0,1,2)

   `textarea.form-control` in section 9 is also (0,1,1), so whichever
   stylesheet loads last wins — and it is not this one. That tie is why the
   reply box rendered as a white rectangle in dark mode while the toolbar above
   it was correctly dark: the toolbar is `.md-header.btn-toolbar` and was
   already covered, the textarea and the footer strip were not.

   !important throughout for the same reason as CodeMirror above, plus the
   fullscreen rules below, which bootstrap-markdown declares !important itself.

   The padding is not cosmetic drift: bootstrap-markdown zeroes the textarea's
   padding, so the caret sits flush against the border. */
/* The corners are rounded on the header and footer rather than clipped with
   `overflow: hidden` on the wrapper — bootstrap-markdown appends its help
   block inside .md-editor, and clipping the wrapper would cut it off. */
.md-editor {
    background-color: var(--ah-navy-deep) !important;
    border: 1px solid var(--ah-line-strong) !important;
    border-radius: var(--ah-radius);
}

.md-editor.active {
    border-color: var(--ah-cyan) !important;
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
}

/* The toolbar and the "lines: 0 words: 0 saved" strip. `.md-header` is also a
   `.btn-toolbar`, which is how the toolbar alone used to get covered. */
.md-editor > .md-header,
.md-editor > .btn-toolbar,
.md-editor .md-footer {
    background: var(--ah-raise) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-muted) !important;
    padding: 8px 10px !important;
}

.md-editor > .md-header,
.md-editor > .btn-toolbar {
    border-bottom: 1px solid var(--ah-line) !important;
    border-radius: var(--ah-radius) var(--ah-radius) 0 0;
}

.md-editor .md-footer {
    border-radius: 0 0 var(--ah-radius) var(--ah-radius);
    border-top: 1px solid var(--ah-line) !important;
    font-size: 0.78rem;
}

/* The editing surface. `.md-input` and the child-textarea selector both appear
   because bootstrap-markdown adds the class but styles the element. */
.md-editor > textarea,
.md-editor > textarea.form-control,
.md-editor > .md-input {
    background: var(--ah-navy-deep) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--ah-ink) !important;
    font-family: var(--ah-font) !important;
    line-height: 1.6;
    padding: 14px 16px !important;
    /* `both` is the browser default and the drag would push the textarea past
       the editor's own border. */
    resize: vertical !important;
}

.md-editor > textarea:focus,
.md-editor > .md-input:focus {
    background: var(--ah-navy-deep) !important;
    box-shadow: none !important;
    color: var(--ah-ink) !important;
}

.md-editor > textarea::placeholder { color: var(--ah-muted) !important; }

.md-editor > .md-preview {
    background: var(--ah-navy-deep) !important;
    border-color: var(--ah-line) !important;
    color: var(--ah-body) !important;
    padding: 14px 16px !important;
}

/* Fullscreen. bootstrap-markdown paints the backdrop white with !important and
   drops the text to #999 on it, so the whole state has to be restated. */
.md-editor.md-fullscreen-mode {
    background: var(--ah-bg) !important;
    border: 0 !important;
}

.md-editor.md-fullscreen-mode .md-input,
.md-editor.md-fullscreen-mode .md-preview {
    background: var(--ah-bg) !important;
    border: 0 !important;
    color: var(--ah-body) !important;
}

.md-editor.md-fullscreen-mode .md-input:focus,
.md-editor.md-fullscreen-mode .md-input:hover {
    background: var(--ah-bg) !important;
    color: var(--ah-ink) !important;
}

.md-editor.md-fullscreen-mode .md-header { background: none !important; }

.md-editor.md-fullscreen-mode .md-header .btn,
.md-editor.md-fullscreen-mode .btn-default {
    background: var(--ah-surface) !important;
    border: 1px solid var(--ah-line-strong) !important;
    color: var(--ah-ink) !important;
}

/* The exit-fullscreen control, drawn near-white for a white backdrop. */
.md-editor .md-controls .md-control { color: var(--ah-muted) !important; }
.md-editor .md-controls .md-control:hover { color: var(--ah-ink) !important; }

.ah-posted-by-text { flex: 1; min-width: 0; }

.ah-avatar {
    align-items: center;
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line-strong);
    border-radius: 50%;
    color: var(--ah-ink);
    display: flex;
    flex-shrink: 0;
    font-family: var(--ah-font-display);
    font-size: 0.95rem;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    text-transform: uppercase;
    width: 38px;
}

/* Eight deterministic tints, assigned by js/avalanche.js from the poster's
   name. The neutral default above is what shows if JavaScript is unavailable.

   Each is a low-alpha fill plus a per-theme initial colour: the pale letters
   that read well on a near-black avatar drop to about 1.25:1 once the same
   fill sits on a white card, so light mode needs its own saturated set. */
.ah-avatar-0 { background: rgba(0, 130, 255, 0.22);   border-color: rgba(0, 130, 255, 0.45);   color: var(--ah-av-0); }
.ah-avatar-1 { background: rgba(52, 211, 153, 0.20);  border-color: rgba(52, 211, 153, 0.45);  color: var(--ah-av-1); }
.ah-avatar-2 { background: rgba(167, 139, 250, 0.22); border-color: rgba(167, 139, 250, 0.45); color: var(--ah-av-2); }
.ah-avatar-3 { background: rgba(245, 158, 11, 0.20);  border-color: rgba(245, 158, 11, 0.45);  color: var(--ah-av-3); }
.ah-avatar-4 { background: rgba(236, 72, 153, 0.20);  border-color: rgba(236, 72, 153, 0.45);  color: var(--ah-av-4); }
.ah-avatar-5 { background: rgba(125, 211, 252, 0.20); border-color: rgba(125, 211, 252, 0.45); color: var(--ah-av-5); }
.ah-avatar-6 { background: rgba(45, 212, 191, 0.20);  border-color: rgba(45, 212, 191, 0.45);  color: var(--ah-av-6); }
.ah-avatar-7 { background: rgba(248, 113, 113, 0.20); border-color: rgba(248, 113, 113, 0.45); color: var(--ah-av-7); }

/* Staff get a ring so the thread is scannable without reading names. */
.ah-avatar-staff { box-shadow: 0 0 0 2px rgba(0, 130, 255, 0.35); }

.ah-staff-tag {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 8px;
    padding: 2px 9px;
    text-transform: uppercase;
    vertical-align: middle;
}

.ah-staff-tag-owner   { background: rgba(245, 158, 11, 0.18);  color: var(--ah-fg-warn); }
.ah-staff-tag-tech    { background: var(--ah-blue-tint);       color: var(--ah-fg-info); }
.ah-staff-tag-billing { background: rgba(52, 211, 153, 0.16);  color: var(--ah-fg-success); }
.ah-staff-tag-support { background: rgba(167, 139, 250, 0.18); color: var(--ah-fg-purple); }

.ah-reply-row { padding-bottom: 0; }

.ah-reply-staff .message {
    background: var(--ah-blue-tint);
    border: 1px solid rgba(79, 209, 255, 0.22);
    border-radius: var(--ah-radius);
}

.ah-reply-client .message {
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line);
    border-radius: var(--ah-radius);
}

.ah-ticket-subject strong { color: var(--ah-ink); }

/* --------------------------------------------------------------------------
   D6. Drag-and-drop attachments
   -------------------------------------------------------------------------- */

/* Hidden until JS confirms the browser can assign File objects to an input;
   otherwise the stock pickers are the only control and a dead drop target
   would just be a lie. */
.ah-dropzone { display: none; }

.ah-dropzone.ah-dropzone-ready {
    background: var(--ah-raise-soft);
    border: 2px dashed var(--ah-line-strong);
    border-radius: var(--ah-radius);
    cursor: pointer;
    display: block;
    margin-bottom: 12px;
    padding: 24px 20px;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.ah-dropzone.ah-dropzone-ready:hover { border-color: var(--ah-line-hover); }

.ah-dropzone.ah-dropzone-active {
    background: var(--ah-blue-tint);
    border-color: var(--ah-cyan);
}

.ah-dropzone-hint {
    align-items: center;
    color: var(--ah-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ah-dropzone-hint i { color: var(--ah-cyan); font-size: 1.5rem; margin-bottom: 6px; }

.ah-dropzone-title { color: var(--ah-ink); font-weight: 600; }

.ah-dropzone-sub { font-size: 0.82rem; }

.ah-dropzone-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.ah-dropzone-has-files .ah-dropzone-files { margin-top: 16px; }

.ah-dropzone-file {
    align-items: center;
    background: var(--ah-surface);
    border: 1px solid var(--ah-line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    text-align: left;
}

.ah-dropzone-file-name {
    color: var(--ah-ink);
    flex: 1;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ah-dropzone-file-size { color: var(--ah-muted); font-size: 0.78rem; flex-shrink: 0; }

.ah-dropzone-remove {
    background: none;
    border: none;
    color: var(--ah-muted);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 4px;
}

.ah-dropzone-remove:hover { color: var(--ah-danger); }

/* --------------------------------------------------------------------------
   D3b. Status as icon + text

   Replaces the filled pill. A column of solid colour blocks is louder than the
   data it labels; an icon plus coloured text reads as fast and lets the row
   stay calm. The icon is a ::before on the existing .status class, so the cell
   still contains nothing but the status word — WHMCS's sidebar filter matches
   a [~>]\s*Unpaid\s*[<~] regex against the rendered cell and any added text
   node would break it.
   -------------------------------------------------------------------------- */

/* .label.status is matched on its own, not only inside a table. The parent
   theme gives every .status-* a solid fill, and these pills also appear in the
   ticket information panel and on service detail pages — scoping the reset to
   tables left those keeping the parent's fill under this theme's light text. */
.label.status {
    background: none !important;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0;
}

/* The glyph is passed through a custom property rather than set directly on
   the pseudo-element.

   Setting it directly does not work: the rule that has to carry the font and
   sizing is `.table .label.status::before` (0,2,1), and it would then also own
   `content`. Every per-status rule is a bare `.status-unpaid::before` (0,1,0),
   which loses — so inside a table every status silently fell back to the
   generic bullet while still getting its correct colour.

   A custom property is set on the *element* by the low-specificity rules and
   merely read by the pseudo-element, so the two never compete. */
.label.status::before {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.95em;
    line-height: 1;
    /* Fallback bullet for a status this theme has no icon for. */
    content: var(--ah-status-icon, '\f111');
}

/* Paid / active / done */
.status-paid, .status-active, .status-completed,
.status-accepted, .status-delivered, .status-answered {
    color: var(--ah-fg-success) !important;
}
.status-paid, .status-active, .status-completed,
.status-accepted, .status-delivered { --ah-status-icon: '\f058'; }
.status-answered { --ah-status-icon: '\f3e5'; }

/* Needs action */
.status-unpaid, .status-overdue, .status-collections {
    color: var(--ah-fg-warn) !important;
    --ah-status-icon: '\f06a';
}

/* Terminal / negative */
.status-cancelled, .status-terminated, .status-expired, .status-fraud,
.status-dead, .status-lost, .status-refunded, .status-suspended {
    color: var(--ah-fg-danger) !important;
}
.status-cancelled, .status-terminated, .status-expired,
.status-dead, .status-lost { --ah-status-icon: '\f057'; }
.status-suspended, .status-fraud { --ah-status-icon: '\f05e'; }
.status-refunded { --ah-status-icon: '\f0e2'; }

/* Waiting */
.status-pending, .status-payment-pending, .status-onhold, .status-grace,
.status-redemption, .status-pending-registration, .status-pending-transfer {
    color: var(--ah-muted) !important;
    --ah-status-icon: '\f017';
}

/* In flight */
.status-open, .status-customer-reply {
    color: var(--ah-fg-info) !important;
    --ah-status-icon: '\f075';
}

.status-inprogress {
    color: var(--ah-fg-purple) !important;
    --ah-status-icon: '\f110';
}

.status-closed {
    color: var(--ah-muted) !important;
    --ah-status-icon: '\f00d';
}

/* A per-department colour set by an admin arrives as an inline background;
   turn it into a dot rather than letting it fight the icon scheme. */
.status-custom {
    background: none !important;
    color: var(--ah-body) !important;
}

/* --------------------------------------------------------------------------
   D3c. Table controls — search + status filter
   -------------------------------------------------------------------------- */

.ah-table-controls {
    align-items: center;
    display: none;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

/* Only shown once JS has confirmed the DataTables API is present — a search
   box that does nothing is worse than no search box. */
.ah-table-controls.is-ready { display: flex; }

.ah-table-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.ah-table-search i {
    color: var(--ah-muted);
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.ah-table-search input {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
    color: var(--ah-ink);
    font-size: 0.92rem;
    padding: 10px 14px 10px 38px;
    width: 100%;
}

.ah-table-search input::placeholder { color: var(--ah-muted); }

.ah-table-search input:focus {
    border-color: var(--ah-cyan);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.18);
    outline: none;
}

.ah-table-filter select {
    background-color: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 10px;
    color: var(--ah-ink);
    font-size: 0.92rem;
    min-width: 170px;
    padding: 10px 34px 10px 14px;
}

/* DataTables draws its own search box; ours replaces it. */
.ah-table-controls.is-ready ~ .table-container .dataTables_filter,
.ah-table-controls.is-ready ~ .table-container .listtable > .dataTables_filter {
    display: none;
}

/* Small switch used by the services list's "hide inactive" control. */
.ah-toggle {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: 9px;
    margin: 0;
    user-select: none;
}

.ah-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.ah-toggle-track {
    background: var(--ah-surface-2);
    border: 1px solid var(--ah-line-strong);
    border-radius: 999px;
    display: inline-block;
    height: 20px;
    position: relative;
    transition: background 0.18s var(--ah-ease-out), border-color 0.18s var(--ah-ease-out);
    width: 36px;
}

.ah-toggle-track::after {
    background: var(--ah-muted);
    border-radius: 50%;
    content: '';
    height: 12px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.18s var(--ah-ease-out), background 0.18s var(--ah-ease-out);
    width: 12px;
}

.ah-toggle input:checked + .ah-toggle-track {
    background: var(--ah-blue-tint);
    border-color: var(--ah-blue);
}

.ah-toggle input:checked + .ah-toggle-track::after {
    background: var(--ah-blue);
    transform: translateX(16px);
}

.ah-toggle input:focus-visible + .ah-toggle-track {
    outline: 3px solid rgba(79, 209, 255, 0.65);
    outline-offset: 2px;
}

.ah-toggle-label { color: var(--ah-body); font-size: 0.88rem; }

/* Product cell: icon chip + name over domain. */
.ah-product { align-items: center; display: flex; gap: 12px; }

.ah-product-icon {
    align-items: center;
    background: var(--ah-tint-info);
    border: 1px solid rgba(79, 209, 255, 0.3);
    border-radius: 10px;
    color: var(--ah-cyan);
    display: flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.ah-product-text { display: flex; flex-direction: column; min-width: 0; }
.ah-product-text strong { color: var(--ah-ink); }
.ah-product-text a { font-size: 0.85rem; }
.ah-product-nodomain { color: var(--ah-muted); font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   D3d. Row action menu (kebab)
   -------------------------------------------------------------------------- */

.ah-kebab-wrap { display: inline-block; position: relative; }

.ah-kebab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ah-muted);
    cursor: pointer;
    height: 32px;
    line-height: 1;
    width: 32px;
}

.ah-kebab:hover,
.ah-kebab-wrap.is-open .ah-kebab {
    background: var(--ah-surface-2);
    border-color: var(--ah-line-strong);
    color: var(--ah-ink);
}

.ah-kebab-menu {
    background: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: var(--ah-radius);
    box-shadow: var(--ah-shadow-md);
    display: none;
    min-width: 190px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    text-align: left;
    z-index: 30;
}

.ah-kebab-wrap.is-open .ah-kebab-menu { display: block; }

.ah-kebab-menu a {
    align-items: center;
    border-radius: 8px;
    color: var(--ah-body);
    display: flex;
    font-size: 0.88rem;
    font-weight: 500;
    gap: 10px;
    padding: 9px 11px;
    white-space: nowrap;
}

.ah-kebab-menu a:hover {
    background: var(--ah-surface-2);
    color: var(--ah-ink);
}

.ah-kebab-menu a i { color: var(--ah-muted); width: 15px; }
.ah-kebab-menu a:hover i { color: var(--ah-cyan); }

.ah-kebab-menu a.ah-kebab-danger { color: var(--ah-fg-danger); }
.ah-kebab-menu a.ah-kebab-danger i { color: var(--ah-fg-danger); }

/* The last rows of a short table would otherwise clip the menu inside the
   card's overflow; flip it above instead. */
.table-list tr:nth-last-child(-n+2) .ah-kebab-menu {
    bottom: calc(100% + 6px);
    top: auto;
}

/* --------------------------------------------------------------------------
   D3e. Aggregate balance panel

   One loud action for the whole balance instead of a button on every row.
   -------------------------------------------------------------------------- */

/* The fill is a step darker than --ah-blue on purpose. This is a large panel
   carrying small white text ("2 overdue — settle to avoid interruption"), and
   white on #0082ff is only 3.73:1. #0060c4 takes it to 5.9:1 while still
   reading as the same brand blue — the *buttons* keep the exact brand colour,
   because they are short bold labels, not paragraphs. */
.ah-balance {
    background:
        radial-gradient(700px 320px at 90% -20%, rgba(79, 209, 255, 0.18), transparent 60%),
        radial-gradient(500px 280px at 5% 120%, rgba(0, 60, 140, 0.35), transparent 55%),
        #0060c4;
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow-md);
    color: #fff;
    padding: 26px 28px;
}

.ah-balance-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.ah-balance-value {
    font-family: var(--ah-font-display);
    font-size: 2.2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 4px 0 18px;
    white-space: nowrap;
}

.ah-balance .btn,
.ah-balance-action {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    color: #fff;
    display: flex;
    font-weight: 650;
    gap: 9px;
    justify-content: center;
    padding: 13px 20px;
    width: 100%;
}

.ah-balance-action:hover {
    background: #fff;
    border-color: #fff;
    color: var(--ah-blue);
}

.ah-balance-meta {
    font-size: 0.82rem;
    margin: 12px 0 0;
    opacity: 0.85;
    text-align: center;
}

/* --------------------------------------------------------------------------
   D3f. Dashboard alert banners
   -------------------------------------------------------------------------- */

.ah-banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.ah-banner {
    align-items: center;
    border: 1px solid var(--ah-line);
    border-left-width: 3px;
    border-radius: var(--ah-radius);
    display: flex;
    gap: 14px;
    padding: 14px 16px;
}

.ah-banner-icon { flex-shrink: 0; font-size: 1.05rem; }
.ah-banner-msg { flex: 1; font-size: 0.92rem; }
.ah-banner-msg strong { font-weight: 700; }

.ah-banner-action {
    border: 1px solid currentColor;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.84rem;
    font-weight: 650;
    padding: 7px 14px;
    white-space: nowrap;
}

.ah-banner-action:hover { background: currentColor; }
/* Invert the label against the now-filled background. */
.ah-banner-action:hover span { color: var(--ah-surface); }

.ah-banner-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.3rem;
    line-height: 1;
    opacity: 0.6;
    padding: 0 2px;
}

.ah-banner-close:hover { opacity: 1; }

.ah-banner-danger  { background: var(--ah-tint-danger);  border-left-color: var(--ah-danger);  color: var(--ah-fg-danger); }
.ah-banner-warning { background: var(--ah-tint-warn);    border-left-color: var(--ah-warning); color: var(--ah-fg-warn); }
.ah-banner-info    { background: var(--ah-tint-info);    border-left-color: var(--ah-blue);    color: var(--ah-fg-info); }
.ah-banner-success { background: var(--ah-tint-success); border-left-color: var(--ah-success); color: var(--ah-fg-success); }

/* --------------------------------------------------------------------------
   D6b. Theme toggle

   Injected into the header toolbar by js/avalanche.js rather than shipped in
   markup, so header.tpl stays inherited from the parent.
   -------------------------------------------------------------------------- */

.ah-theme-toggle {
    align-items: center;
    background: var(--ah-surface);
    border: 1px solid var(--ah-line-strong);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    height: 34px;
    padding: 0 6px 0 10px;
    transition: background 0.18s var(--ah-ease-out), border-color 0.18s var(--ah-ease-out);
}

.ah-theme-toggle:hover {
    background: var(--ah-surface-2);
    border-color: var(--ah-line-hover);
}

.ah-theme-toggle-label {
    color: var(--ah-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The track. The knob is the ::after so the whole control is two elements. */
.ah-theme-toggle-track {
    background: var(--ah-sunken);
    border-radius: 999px;
    display: inline-block;
    height: 18px;
    position: relative;
    width: 34px;
}

.ah-theme-toggle-track::after {
    background: var(--ah-blue);
    border-radius: 50%;
    content: '';
    height: 14px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform 0.2s var(--ah-ease-out);
    width: 14px;
}

:root[data-theme="light"] .ah-theme-toggle-track::after {
    transform: translateX(16px);
}

@media (prefers-reduced-motion: reduce) {
    .ah-theme-toggle-track::after { transition: none; }
}

/* Below the header's own breakpoint the label is dropped, not the control —
   the toggle itself still has to be reachable on a phone. */
@media (max-width: 575.98px) {
    .ah-theme-toggle-label { display: none; }
    .ah-theme-toggle { padding: 0 6px; }
}

/* --------------------------------------------------------------------------
   D6c. Payment gateway trust row

   Font Awesome brand glyphs, not images: WHMCS already loads
   fontawesome-brands, so this costs no extra request and no redrawn
   trademarks. Which marks appear is configured in hooks/avalanche_footer.php.
   -------------------------------------------------------------------------- */

.ah-gateways {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--ah-line-soft);
}

.ah-gateways i {
    color: var(--ah-muted);
    font-size: 1.7rem;
    transition: color 0.18s var(--ah-ease-out);
}

.ah-gateways i:hover { color: var(--ah-body); }

.ah-gateways-label {
    color: var(--ah-muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    margin-bottom: -6px;
}

/* --------------------------------------------------------------------------
   D7. Notification bell
   -------------------------------------------------------------------------- */

#accountNotifications.ah-has-alerts { color: var(--ah-ink); }

/* Dot on the bell when alerts are waiting. */
#accountNotifications.ah-has-alerts::after {
    background: var(--ah-danger);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--ah-navy-deep);
    content: '';
    display: inline-block;
    height: 7px;
    margin-left: -4px;
    position: relative;
    top: -6px;
    width: 7px;
}

.popover .client-alerts {
    margin: 0;
    max-height: 340px;
    overflow-y: auto;
    padding: 0;
}

.client-alerts li {
    border-bottom: 1px solid var(--ah-line-soft);
    list-style: none;
}

.client-alerts li:last-child { border-bottom: none; }

.client-alerts li a {
    align-items: flex-start;
    color: var(--ah-body);
    display: flex;
    gap: 10px;
    padding: 11px 12px;
    transition: background 0.15s ease;
}

.client-alerts li a:hover { background: var(--ah-surface-2); color: var(--ah-ink); }

.client-alerts li .message { font-size: 0.88rem; line-height: 1.45; }

.client-alerts li i { margin-top: 3px; }

/* Severity tints, applied by js/avalanche.js from the icon WHMCS renders. */
.client-alerts li.ah-alert-danger i  { color: var(--ah-danger); }
.client-alerts li.ah-alert-warning i { color: var(--ah-warning); }
.client-alerts li.ah-alert-info i    { color: var(--ah-cyan); }
.client-alerts li.ah-alert-success i { color: var(--ah-success); }

.client-alerts li.ah-alert-danger  { background: rgba(240, 97, 109, 0.07); }
.client-alerts li.ah-alert-warning { background: rgba(245, 158, 11, 0.07); }

.client-alerts li.none {
    color: var(--ah-muted);
    font-size: 0.88rem;
    padding: 18px 12px;
    text-align: center;
}

/* ==========================================================================
   20b. Parent sweep

   The rest of this file styles components one at a time — which only ever
   covers the components someone thought to look at. This section is the
   result of auditing twenty-one's theme.css mechanically for every rule that
   paints a light fill, dark text, or a light hairline, and overriding the
   whole set: 140 selectors the theme was otherwise leaving on their stock
   light-mode styling.

   Grouped by area rather than by property, so it stays readable. Re-run the
   audit after a WHMCS upgrade to catch anything new.
   ========================================================================== */

/* ---------- Bootstrap contextual variants ---------- */

/* Contextual table rows. The parent's pastel fills carry dark text, so both
   halves have to move together or one of them is invisible. */
.table-primary, .table-primary > th, .table-primary > td,
.table-active, .table-active > th, .table-active > td {
    background-color: var(--ah-tint-info);
    color: var(--ah-ink);
}
.table-secondary, .table-secondary > th, .table-secondary > td,
.table-light, .table-light > th, .table-light > td,
.table-dark, .table-dark > th, .table-dark > td {
    background-color: var(--ah-surface-2);
    color: var(--ah-body);
}
.table-light th, .table-light td,
.table-dark th, .table-dark td { border-color: var(--ah-line) !important; }

.list-group-item-primary { background-color: var(--ah-tint-info); color: var(--ah-fg-info); }
.list-group-item-info    { background-color: var(--ah-tint-info); color: var(--ah-fg-info); }
.list-group-item-success { background-color: var(--ah-tint-success); color: var(--ah-fg-success); }
.list-group-item-warning { background-color: var(--ah-tint-warn); color: var(--ah-fg-warn); }
.list-group-item-danger  { background-color: var(--ah-tint-danger); color: var(--ah-fg-danger); }
.list-group-item-secondary,
.list-group-item-light,
.list-group-item-dark { background-color: var(--ah-surface-2); color: var(--ah-body); }

.toast, .toast-header {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}
.toast-header { color: var(--ah-ink); }

.btn-outline-success { border-color: var(--ah-success); color: var(--ah-success); }
.btn-outline-info    { border-color: var(--ah-cyan); color: var(--ah-cyan); }
.btn-outline-danger  { border-color: var(--ah-danger); color: var(--ah-danger); }
.btn-outline-warning { border-color: var(--ah-warning); color: var(--ah-warning); }
.btn-outline-light,
.btn-outline-dark { border-color: var(--ah-line-strong); color: var(--ah-body); }

.btn-outline-success:hover { background-color: var(--ah-success); color: #04231a; }
.btn-outline-info:hover    { background-color: var(--ah-blue); border-color: var(--ah-blue); color: #fff; }
.btn-outline-danger:hover  { background-color: var(--ah-danger); color: #fff; }
.btn-outline-warning:hover { background-color: var(--ah-warning); color: #251a02; }
.btn-outline-light:hover,
.btn-outline-dark:hover {
    background-color: var(--ah-surface-2);
    border-color: var(--ah-line-hover);
    color: var(--ah-ink);
}

.img-thumbnail {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
}

mark, .mark { background-color: var(--ah-tint-warn); color: var(--ah-fg-warn); }

.text-body { color: var(--ah-body) !important; }
.blockquote-footer, .figure-caption, .form-control-plaintext { color: var(--ah-muted); }
.form-control-plaintext { background-color: transparent; }

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

.form-check-input[disabled] ~ .form-check-label,
.form-check-input:disabled ~ .form-check-label { color: var(--ah-muted); }

.custom-range::-webkit-slider-runnable-track { background-color: var(--ah-surface-2); }
.custom-range::-moz-range-track { background-color: var(--ah-surface-2); }
.custom-range::-ms-fill-lower,
.custom-range::-ms-fill-upper { background-color: var(--ah-surface-2); }
.custom-range::-webkit-slider-thumb { background-color: var(--ah-blue); }
.custom-range::-moz-range-thumb { background-color: var(--ah-blue); }

.navbar-light .navbar-text { color: var(--ah-body); }
.navbar-light .navbar-text a,
.navbar-light .navbar-text a:hover,
.navbar-light .navbar-text a:focus { color: var(--ah-cyan); }
.navbar-light .navbar-toggler {
    border-color: var(--ah-line-strong);
    color: var(--ah-body);
}

/* ---------- Markdown rendering ----------
   .markdown-content is every ticket message and knowledgebase article;
   .md-preview is the editor's preview pane. Both render user tables with a
   white fill and #ddd hairlines. */

.markdown-content, .md-preview { color: var(--ah-body); }

.md-preview table, .markdown-content table {
    background-color: transparent;
    border-color: var(--ah-line) !important;
    color: var(--ah-body);
}

.md-preview table > thead > tr > th,
.markdown-content table > thead > tr > th {
    background-color: var(--ah-raise);
    border-color: var(--ah-line) !important;
    color: var(--ah-ink);
}

.md-preview table > tbody > tr > td,
.markdown-content table > tbody > tr > td {
    border-color: var(--ah-line-soft) !important;
}

.markdown-content pre, .md-preview pre,
.markdown-content code, .md-preview code {
    background-color: var(--ah-navy-deep);
    border-color: var(--ah-line);
    color: var(--ah-ice);
}

.markdown-content blockquote, .md-preview blockquote {
    border-left-color: var(--ah-blue);
    color: var(--ah-muted);
}

/* The editor chrome itself is in section D5, with the rest of bootstrap-markdown.
   It used to be split: a `.md-editor > .btn-toolbar` rule here, later in the
   file, silently outranked the equal-specificity one there and left the toolbar
   a different shade from the footer strip directly below it. */

/* ---------- Payment ----------
   Card entry and the 3-D Secure frame. These are the last screens before money
   moves; a half-styled one reads as a phishing page. */

div.credit-card {
    background-color: var(--ah-surface);
    border-color: var(--ah-line-strong) !important;
    color: var(--ah-body);
}

.auth3d-area, .submit-3d {
    background-color: var(--ah-surface);
    border-color: var(--ah-line-strong) !important;
}

/* ---------- Store, domains, promos ---------- */

.store-order-container,
.store-order-container .store-domain-tab-content {
    background-color: var(--ah-surface);
    border-color: var(--ah-line) !important;
    color: var(--ah-body);
}

.domain-pricing, .tld-pricing-header, .domain-pricing-header {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.tld-pricing-header { color: var(--ah-ink); }

.promo-banner, .promo-container, .promo-container .header {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.product-details-tab-container,
div.product-details-tab-container {
    background-color: var(--ah-surface);
    border-color: var(--ah-line) !important;
}

.upgrade, .upgrade-package {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

/* ---------- Account, auth, onboarding ---------- */

.verification-banner {
    background-color: var(--ah-tint-warn);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--ah-fg-warn);
}

.continue-container, .invite-box {
    background-color: var(--ah-surface);
    border-color: var(--ah-line) !important;
    color: var(--ah-body);
}

.select-account a:hover { background-color: var(--ah-surface-2); color: var(--ah-ink); }

.twofa-module { border-color: var(--ah-line-strong) !important; }
.twofa-setup .activation-msg { border-color: var(--ah-line-strong) !important; }
.twofa-setup .backup-code {
    background-color: var(--ah-navy-deep);
    color: var(--ah-ink);
}

/* ---------- Chrome ---------- */

/* The notification bell's popover — WHMCS styles it separately from .popover. */
.popover-user-notifications {
    background-color: var(--ah-surface);
    border-color: var(--ah-line) !important;
}
.popover-user-notifications ul li a { color: var(--ah-body); }
.popover-user-notifications ul li a:hover {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
}

/* The stock dashboard tiles. This theme replaces them with .ah-dash on the
   client home page, but other pages and addons still emit them. */
.tiles .tile { background-color: var(--ah-surface); border: 1px solid var(--ah-line); }
.tiles .tile:hover { background-color: var(--ah-surface-2); }
.tiles .tile .title { color: var(--ah-muted); }
.tiles .tile .stat { color: var(--ah-ink); }

.responsive-tabs-sm,
.responsive-tabs-sm-connector .channel {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
}
.responsive-tabs-sm .nav-item a:hover { background-color: var(--ah-surface-2); color: var(--ah-ink); }

.kb-article-item {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}
.kb-article-item:hover { background-color: var(--ah-surface-2); }

.sub-heading, .sub-heading span {
    background-color: transparent;
    color: var(--ah-muted);
}

/* Only visible to staff masquerading as a client, but it floats over every
   page while they do — and it was a light-grey pill on a dark page. */
.btn-return-to-admin,
.btn-return-to-admin .floating {
    background-color: var(--ah-surface-2) !important;
    border: 1px solid var(--ah-line-strong) !important;
    color: var(--ah-body) !important;
}
.btn-return-to-admin:hover,
.btn-return-to-admin .floating:hover {
    background-color: var(--ah-blue) !important;
    color: #fff !important;
}

a.admin-inline-edit { color: var(--ah-muted); }
a.admin-inline-edit:hover { color: var(--ah-cyan); }

.form-group .field-error-msg { color: var(--ah-danger); }

.carousel-indicators li { background-color: var(--ah-line-strong); }
.carousel-indicators .active { background-color: var(--ah-blue); }

/* ---------- Remaining content surfaces ---------- */

.announcements .announcement article {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.kb-category a:hover { background-color: var(--ah-surface-2); color: var(--ah-ink); }

.ticketfeedbackstaffcont {
    background-color: var(--ah-surface-2);
    color: var(--ah-body);
}

/* Total rows on the invoice and mass-pay pages. Mass pay in particular is
   where the balance panel's "Pay now" sends people, so it is on the main
   payment path, not a corner. */
.invoice-summary-table td.total-row,
tr.masspay-total td {
    background-color: var(--ah-surface-2);
    color: var(--ah-ink);
    font-weight: 650;
}

.featured-tld {
    background-color: var(--ah-surface);
    border-color: var(--ah-line);
    color: var(--ah-body);
}

.dropdown-item-text { color: var(--ah-body); }
.markdown-editor-status { color: var(--ah-muted) !important; }
#registration .field-help-text { color: var(--ah-muted); }
div.tweet > i { color: var(--ah-cyan); }

/* ---------- bg-color-* utility palette ----------

   WHMCS ships nineteen of these and uses them for buttons and badges all over
   the client area — they are why an off-the-shelf install has a bright green
   "Update" button, a magenta "Link" badge and a teal "Transfer" button sitting
   next to brand-blue ones.

   Remapped onto the Avalanche palette by *meaning* rather than by hue: the
   greens become the success colour, the reds the danger colour, and the
   decorative ones (pink, purple, teal, silver) collapse to the neutral
   surface, because nothing in this brand is pink. */

.bg-color-blue, .bg-color-turquoise, .bg-color-teal,
.bg-color-wet-asphalt, .bg-color-midnight-blue { background-color: var(--ah-blue) !important; color: #fff !important; }

.bg-color-green, .bg-color-emerald, .bg-color-lime { background-color: #10b981 !important; color: #04231a !important; }

.bg-color-gold, .bg-color-orange, .bg-color-sun-flower { background-color: var(--ah-warning) !important; color: #251a02 !important; }

.bg-color-red, .bg-color-pomegranate { background-color: #e0384a !important; color: #fff !important; }

.bg-color-purple, .bg-color-amethyst, .bg-color-magenta, .bg-color-pink { background-color: #7c5cd6 !important; color: #fff !important; }

.bg-color-silver, .bg-color-asbestos { background-color: var(--ah-surface-2) !important; color: var(--ah-body) !important; }

/* --------------------------------------------------------------------------
   21. Optional: WCAG AA contrast (opt-in — commented out)

   The brand colours are carried over from avalanchehost.ca unchanged, so the
   client area matches the marketing site exactly. Two of them put white text
   below the 4.5:1 ratio AA asks for on normal-size text:

       #ffffff on --ah-blue   (#0082ff)  = 3.73:1   .btn-primary, badges,
                                                     active pagination/dropdown
       #ffffff on #e0384a                = 4.34:1   .btn-danger, .badge-danger

   Both are inherited from the existing site (style.css uses the same #0082ff
   with white button text), so this file does not change them unilaterally —
   that would make the client area a different blue from the rest of the brand.

   Uncomment the block below to clear AA. The replacements are the closest
   shades to the originals that still pass, so the two surfaces read as the
   same colour side by side:

       #0070dd = 4.81:1     #d13141 = 4.97:1
   -------------------------------------------------------------------------- */

/*
.btn-primary,
.btn-info,
.badge-primary,
.badge-info,
.page-item.active .page-link,
.dropdown-item.active,
.dropdown-item:active,
header.header .toolbar .nav-link .badge-info,
#order-standard_cart .btn-primary,
#order-standard_cart .btn-checkout {
    background-color: #0070dd !important;
    border-color: #0070dd !important;
}

.btn-danger,
.badge-danger {
    background-color: #d13141 !important;
    border-color: #d13141 !important;
}
*/

/* --------------------------------------------------------------------------
   22. Print — invoices and quotes are printed on white paper.
   Undo the dark theme so a printed invoice is not a solid ink block.
   -------------------------------------------------------------------------- */

@media print {
    body, body.primary-bg-color { background: #fff; color: #000; }
    body::before, body::after { display: none; }
    .card, .table, .invoice-container { background: #fff; border-color: #ccc; color: #000; }
    h1, h2, h3, h4, h5, h6, .card-title { color: #000; }
    header.header, footer.footer, .master-breadcrumb, .sidebar { display: none; }
}
