/* ==========================================================================
   Hostento — WHMCS client area theme
   --------------------------------------------------------------------------
   The Laravel storefront is the visual source of truth. Every token below is
   copied from resources/css/app.css so the two codebases cannot drift on
   colour, type, radius or shadow.

   Loaded after WHMCS's own stylesheets, so this file overrides Bootstrap 4
   and twenty-one rather than fighting them with !important.
   ========================================================================== */

:root {
    /* Brand blues — sampled from the Hostento design */
    --hostento-primary-50: #f0f9ff;
    --hostento-primary-100: #e6f6ff;
    --hostento-primary-200: #c0e9fe;
    --hostento-primary-300: #7ad3fe;
    --hostento-primary-400: #35bdfd;
    --hostento-primary: #0da9f5;
    --hostento-primary-600: #0284c9;
    --hostento-primary-700: #026ba3;
    --hostento-primary-800: #075985;
    --hostento-primary-900: #0c4a6e;

    /* Filled buttons carry white text, so the fill must clear WCAG AA (4.5:1).
       primary-500 measures 2.62:1 and fails; primary-700 measures 5.78:1.
       Accents, links, borders and focus rings keep primary-500. */
    --hostento-primary-action: #026ba3;
    --hostento-primary-action-hover: #075985;

    /* Same rule for the semantic fills: the light tints stay for badges and
       alert backgrounds (dark text on them), the -solid shades are for
       filled buttons that carry white text. */
    --hostento-success-solid: #047857;
    --hostento-warning-solid: #b45309;
    --hostento-danger-solid: #b91c1c;

    /* Muted grey is fine on large/decorative text but fails AA at body size,
       so secondary copy uses the body ink instead. */
    --hostento-muted-accessible: #55657e;

    /* Ink — headings and body copy */
    --hostento-text: #2d3c58;
    --hostento-body: #55657e;
    --hostento-muted: #8b96a9;            /* decorative / placeholder only */

    /* Deep navy for secondary actions */
    --hostento-secondary: #111c44;
    --hostento-secondary-hover: #16245a;

    /* Semantic */
    --hostento-success: #10b981;
    --hostento-success-bg: #ecfdf5;
    --hostento-warning: #f59e0b;
    --hostento-warning-bg: #fffbeb;
    --hostento-danger: #ef4444;
    --hostento-danger-bg: #fef2f2;
    --hostento-info: var(--hostento-primary);
    --hostento-info-bg: var(--hostento-primary-50);

    /* Surfaces */
    --hostento-background: #ffffff;
    --hostento-surface: #f7fbff;
    --hostento-border: #e6f6ff;
    --hostento-border-strong: #c0e9fe;

    /* Shape */
    --hostento-radius-sm: 0.5rem;
    --hostento-radius: 0.75rem;
    --hostento-radius-lg: 1rem;
    --hostento-radius-pill: 9999px;

    --hostento-shadow-sm: 0 1px 2px 0 rgb(45 60 88 / 0.05);
    --hostento-shadow: 0 18px 40px -18px rgb(13 169 245 / 0.25);
    --hostento-shadow-lg: 0 24px 60px -20px rgb(13 169 245 / 0.35);

    /* Type */
    --hostento-font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system,
        'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Layout */
    --hostento-container: 72rem;
    --hostento-header-height: 5rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

body,
body.primary-bg-color {
    background: var(--hostento-background);
    font-family: var(--hostento-font);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--hostento-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--hostento-font);
    color: var(--hostento-text);
    font-weight: 700;
    line-height: 1.25;
}

h1, .h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.0625rem; }
h5, .h5 { font-size: 0.9375rem; }
h6, .h6 { font-size: 0.8125rem; }

a { color: var(--hostento-primary-action); text-decoration: none; }
a:hover, a:focus { color: var(--hostento-primary-700); text-decoration: none; }

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

/* A visible, consistent focus ring everywhere — never removed. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--hostento-primary-400);
    outline-offset: 2px;
    box-shadow: none;
}

.container { max-width: var(--hostento-container); }

/* ==========================================================================
   Header — mirrors the storefront's utility strip + main bar
   ========================================================================== */

.hostento-topbar {
    background: rgb(2 107 163 / 0.25);
    border-bottom: 1px solid rgb(255 255 255 / 0.15);
    color: #fff;
    font-size: 0.75rem;
}

.hostento-topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.75rem;
}

.hostento-topbar a { color: rgb(255 255 255 / 0.9); }
.hostento-topbar a:hover { color: #fff; }
.hostento-topbar .topbar-divider {
    width: 1px;
    height: 1rem;
    background: rgb(255 255 255 / 0.2);
}

#header.header,
.hostento-header {
    /* Every stop must clear 4.5:1 against the white nav text it carries.
       The original 400 -> 500 -> 700 ramp measured 2.13:1 at the light end. */
    background: linear-gradient(135deg,
        var(--hostento-primary-700) 0%,
        var(--hostento-primary-800) 45%,
        var(--hostento-primary-900) 100%);
    border: 0;
    box-shadow: none;
}

.hostento-header .navbar {
    min-height: var(--hostento-header-height);
    padding-top: 0;
    padding-bottom: 0;
}

.hostento-header .navbar-brand {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: var(--hostento-radius-sm);
    padding: 0.5rem 1rem;
    box-shadow: var(--hostento-shadow-sm);
}

/* One rule for the lockup: height drives the size and width follows the
   artwork's own ratio, so a re-export at another resolution cannot distort it.
   Sized by height alone — mixing height with max-height meant whichever was
   smaller silently won. */
.hostento-header .navbar-brand .logo-img,
.hostento-header .navbar-brand img {
    height: 2.25rem;
    width: auto;
    max-width: 100%;
    display: block;
}

/* Kept for the text fallback WHMCS uses if no logo file is present at all. */
.hostento-header .navbar-brand .brand-text {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--hostento-text);
    letter-spacing: -0.01em;
    line-height: 1;
}

.hostento-header .navbar-brand .brand-sub {
    display: block;
    font-size: 0.4375rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--hostento-muted-accessible);
    font-weight: 600;
}

/* Primary navigation.

   WHMCS's navbar.tpl emits plain `<li><a class="pr-4">` — there is no
   `.nav-item` or `.nav-link` anywhere in it. The parent theme colours those
   links with `header.header .navbar a { color:#444 }`, specificity (0,2,2),
   so the id selector below is what actually wins. Do not "simplify" these to
   class-only selectors: the links go dark-on-dark and the menu disappears. */
#header .navbar a,
#header .navbar-nav > li > a {
    color: #fff;
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--hostento-radius-sm);
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

#header .navbar-nav > li > a {
    padding: 0.5rem 0.875rem;
}

#header .navbar-nav > li > a:hover,
#header .navbar-nav > li > a:focus {
    color: #fff;
    background: rgb(0 0 0 / 0.16);
    text-decoration: none;
}

/* WHMCS marks the current item on the <li>, not the <a>. */
#header .navbar-nav > li.active > a,
#header .navbar-nav > li > a.active {
    color: #fff;
    /* A white scrim lightens the header behind this white label and drops it to
       4.39:1; a dark scrim reads the same as "current page" and clears AA. */
    background: rgb(0 0 0 / 0.22);
    font-weight: 600;
}

/* Caret on dropdown parents */
#header .navbar-nav > li > a.dropdown-toggle::after { opacity: 0.7; }

/* The menus themselves are light panels, so their links stay dark. */
#header .navbar-nav .dropdown-menu {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow);
    padding: 0.5rem;
    margin-top: 0.25rem;
}
#header .navbar-nav .dropdown-menu a,
#header .navbar-nav .dropdown-menu .dropdown-item {
    color: var(--hostento-body);
    border-radius: var(--hostento-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    white-space: normal;
}
#header .navbar-nav .dropdown-menu a:hover,
#header .navbar-nav .dropdown-menu .dropdown-item:hover,
#header .dropdown-item.active,
#header .dropdown-item:active {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
}
#header .navbar-nav .dropdown-menu .dropdown-divider {
    border-top-color: var(--hostento-border);
}

/* Brand + toolbar controls sit on the same dark bar, so they are white too. */
#header .navbar-brand,
#header .navbar-brand:hover { color: var(--hostento-text); }

#header .cart-btn,
#header .cart-btn i,
#header .btn-default,
#header .btn-default i,
#header .hostento-navbar-toggle {
    color: #fff;
}
#header .btn-default:hover i,
#header .cart-btn:hover i { color: #fff; opacity: 0.85; }

/* Return-to-admin control — parent theme paints it light grey on grey. */
#header .btn-return-to-admin,
#header .btn-return-to-admin i,
#header .btn-return-to-admin span {
    color: #fff;
}
#header .btn-return-to-admin {
    background: rgb(0 0 0 / 0.25);
    border: 1px solid rgb(255 255 255 / 0.35);
}
#header .btn-return-to-admin:hover { background: rgb(0 0 0 / 0.4); }

/* Notification button.
   
   Two separate problems produced a clipped "No Notification[s]":
   
   1. the parent theme sets `.btn { overflow: hidden }`, so anything wider than
      the button's box is cut rather than shown, and
   2. as a flex item it was allowed to shrink below the width of its own label.
   
   Fixed at both ends: never clip, never shrink. The label is a fixed string,
   so it should always dictate its own width. */
#header #accountNotifications {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    overflow: visible;
    flex: 0 0 auto;
}

/* Only the fixed-width parts hold their size. The account chip must still be
   able to shrink — pinning it too made a long company name run off the side of
   the bar instead of ellipsising, which `overflow-x: hidden` on the body then
   hid rather than fixed. min-width:0 is what lets a flex item shrink below its
   content and actually engage the ellipsis. */
#header .hostento-topbar .container > * { min-width: 0; }
#header .hostento-topbar .topbar-divider { flex: 0 0 auto; }
#header .hostento-topbar .active-client {
    flex: 0 1 auto;
    min-width: 0;
}
#header .hostento-topbar .active-client .btn-group { min-width: 0; }

/* The account name is the one genuinely variable-length thing up here — a
   company name can be any length — so it is what gives way when space runs
   short, with an ellipsis rather than a hard cut. */
#header .btn-active-client {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 22ch;
    display: inline-block;
}
#header .btn-active-client > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.hostento-header .toolbar .nav-link { color: #fff; }

.hostento-header .cart-btn { position: relative; }
.hostento-header .cart-btn .badge {
    position: absolute;
    top: -0.125rem;
    inset-inline-end: -0.25rem;
    background: var(--hostento-primary-action);
    color: #fff;
    border: 2px solid #fff;
    border-radius: var(--hostento-radius-pill);
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 1.25rem;
    padding: 0.0625rem 0.25rem;
}

/* Account / CTA buttons in the bar */
.hostento-header .btn-header-outline {
    border: 1px solid rgb(255 255 255 / 0.5);
    color: #fff;
    background: transparent;
    border-radius: var(--hostento-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.hostento-header .btn-header-outline:hover {
    background: #fff;
    color: var(--hostento-primary-action);
}

.hostento-header .btn-header-solid {
    background: #fff;
    color: var(--hostento-primary-action);
    border-radius: var(--hostento-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: 0;
}
.hostento-header .btn-header-solid:hover { background: var(--hostento-primary-50); }

/* Logged-in identity chip */
.hostento-header .active-client .btn,
.hostento-header .btn-active-client {
    background: transparent;
    border: 1px solid rgb(255 255 255 / 0.4);
    color: #fff;
    border-radius: var(--hostento-radius-pill);
    font-size: 0.875rem;
}
.hostento-header .active-client .input-group-text {
    background: transparent;
    border: 0;
    color: rgb(255 255 255 / 0.95);
    font-size: 0.75rem;
}

/* Knowledgebase search in the bar */
.hostento-header .search .form-control {
    border: 1px solid rgb(255 255 255 / 0.35);
    background: rgb(255 255 255 / 0.12);
    color: #fff;
    border-radius: 0 var(--hostento-radius-sm) var(--hostento-radius-sm) 0;
}
.hostento-header .search .form-control::placeholder { color: rgb(255 255 255 / 0.85); }
.hostento-header .search .btn {
    border: 1px solid rgb(255 255 255 / 0.35);
    border-inline-end: 0;
    background: rgb(255 255 255 / 0.12);
    color: #fff;
    border-radius: var(--hostento-radius-sm) 0 0 var(--hostento-radius-sm);
}

/* ==========================================================================
   Mobile navigation
   ========================================================================== */

.hostento-navbar-toggle {
    background: transparent;
    border: 1px solid rgb(255 255 255 / 0.4);
    color: #fff;
    border-radius: var(--hostento-radius-sm);
    padding: 0.5rem 0.625rem;
    line-height: 1;
}

@media (max-width: 1199.98px) {
    .hostento-header .main-navbar-wrapper .navbar-collapse {
        background: #fff;
        border: 1px solid var(--hostento-border);
        border-radius: var(--hostento-radius-lg);
        box-shadow: var(--hostento-shadow-lg);
        padding: 0.75rem;
        margin: 0 0 1rem;
        max-height: calc(100vh - var(--hostento-header-height) - 2rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* The panel is white here, so the white link colour set for the dark bar
       has to be reversed. Real markup is `<li><a class="pr-4">` — see the
       navigation block above for why there is no .nav-link to hook. */
    #header .main-navbar-wrapper .navbar-nav > li > a,
    #header .main-navbar-wrapper .navbar a {
        color: var(--hostento-body);
        padding: 0.75rem 1rem;
        border-radius: var(--hostento-radius-sm);
        display: block;
    }

    #header .main-navbar-wrapper .navbar-nav > li > a:hover,
    #header .main-navbar-wrapper .navbar-nav > li > a:focus {
        background: var(--hostento-primary-50);
        color: var(--hostento-primary-action);
    }

    #header .main-navbar-wrapper .navbar-nav > li.active > a {
        background: var(--hostento-primary-action);
        color: #fff;
    }

    /* Sub-menus are rendered inline in the panel rather than as popovers. */
    #header .main-navbar-wrapper .dropdown-menu a,
    #header .main-navbar-wrapper .dropdown-menu .dropdown-item {
        color: var(--hostento-body);
        padding: 0.5rem 1rem;
    }
    #header .main-navbar-wrapper .navbar-nav .dropdown-menu {
        background: transparent;
        box-shadow: none;
        border: 0;
        border-inline-start: 2px solid var(--hostento-border);
        border-radius: 0;
        margin-inline-start: 1rem;
    }

    .hostento-header .main-navbar-wrapper .dropdown-menu {
        border: 0;
        box-shadow: none;
        padding-inline-start: 0.75rem;
    }
}

/* Stops the page scrolling behind an open mobile menu. */
body.hostento-nav-open { overflow: hidden; }

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.master-breadcrumb {
    background: var(--hostento-surface);
    border-bottom: 1px solid var(--hostento-border);
}

.master-breadcrumb .breadcrumb,
.breadcrumb {
    background: transparent;
    padding: 0.875rem 0;
    margin: 0;
    font-size: 0.8125rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--hostento-muted-accessible);
}
.breadcrumb-item.active { color: var(--hostento-text); font-weight: 600; }

/* ==========================================================================
   Main body
   ========================================================================== */

#main-body { padding: 2.5rem 0 3.5rem; background: var(--hostento-background); }

/* ==========================================================================
   Buttons — identical geometry to the storefront's .btn-*
   ========================================================================== */

.btn {
    font-family: var(--hostento-font);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--hostento-radius-sm);
    padding: 0.75rem 1.5rem;
    line-height: 1.2;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.9375rem 2rem; font-size: 0.9375rem; }

.btn-primary,
.btn-info {
    background: var(--hostento-primary-action);
    border-color: var(--hostento-primary-action);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-info:hover, .btn-info:focus {
    background: var(--hostento-primary-action-hover);
    border-color: var(--hostento-primary-action-hover);
    color: #fff;
}

.btn-secondary,
.btn-default {
    background: #fff;
    border: 1px solid var(--hostento-primary-400);
    color: var(--hostento-primary-action);
}
.btn-secondary:hover, .btn-default:hover,
.btn-secondary:focus, .btn-default:focus {
    background: var(--hostento-primary-50);
    border-color: var(--hostento-primary-400);
    color: var(--hostento-primary-700);
}

.btn-dark { background: var(--hostento-secondary); border-color: var(--hostento-secondary); color: #fff; }
.btn-dark:hover { background: var(--hostento-secondary-hover); border-color: var(--hostento-secondary-hover); }

.btn-success { background: var(--hostento-success-solid); border-color: var(--hostento-success-solid); color: #fff; }
.btn-warning { background: var(--hostento-warning-solid); border-color: var(--hostento-warning-solid); color: #fff; }
.btn-danger  { background: var(--hostento-danger-solid);  border-color: var(--hostento-danger-solid);  color: #fff; }

.btn-link { color: var(--hostento-primary-action); font-weight: 600; }

.btn-outline-primary {
    color: var(--hostento-primary-action);
    border-color: var(--hostento-primary-400);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--hostento-primary-action);
    border-color: var(--hostento-primary-action);
    color: #fff;
}

.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

/* ==========================================================================
   Cards and panels — the storefront's rounded, softly-shadowed surface
   ========================================================================== */

.card,
.panel {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow-sm);
}

.card-header,
.panel-heading {
    background: #fff;
    border-bottom: 1px solid var(--hostento-border);
    padding: 1.125rem 1.5rem;
    font-weight: 700;
    color: var(--hostento-text);
    border-radius: var(--hostento-radius) var(--hostento-radius) 0 0;
    font-size: 1rem;
}

.card-body, .panel-body { padding: 1.5rem; }
.card-footer, .panel-footer {
    background: var(--hostento-surface);
    border-top: 1px solid var(--hostento-border);
    border-radius: 0 0 var(--hostento-radius) var(--hostento-radius);
}

/* twenty-one's coloured panels */
.panel-primary > .panel-heading,
.card-primary > .card-header {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-700);
}

/* Dashboard tiles */
.hostento-stat {
    display: block;
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    padding: 1.5rem;
    box-shadow: var(--hostento-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.hostento-stat:hover { transform: translateY(-2px); box-shadow: var(--hostento-shadow); }
.hostento-stat .stat-value {
    display: block;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--hostento-text);
    line-height: 1;
}
.hostento-stat .stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--hostento-body);
    margin-top: 0.375rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */

label, .control-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hostento-text);
    margin-bottom: 0.375rem;
}

.form-control,
.custom-select,
select.form-control {
    font-family: var(--hostento-font);
    font-size: 0.875rem;
    color: var(--hostento-text);
    background: #fff;
    border: 1px solid rgb(139 150 169 / 0.35);
    border-radius: var(--hostento-radius-sm);
    padding: 0.6875rem 1rem;
    height: auto;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control::placeholder { color: var(--hostento-muted); }

.form-control:focus,
.custom-select:focus {
    border-color: var(--hostento-primary-400);
    box-shadow: 0 0 0 3px var(--hostento-primary-100);
    outline: none;
}

.form-control.is-invalid,
.has-error .form-control {
    border-color: var(--hostento-danger);
}
.invalid-feedback, .help-block.text-danger { color: var(--hostento-danger); font-size: 0.75rem; }

.input-group-text {
    background: var(--hostento-surface);
    border: 1px solid rgb(139 150 169 / 0.35);
    color: var(--hostento-body);
    border-radius: var(--hostento-radius-sm);
    font-size: 0.875rem;
}

/* Checkboxes and radios */
.custom-control-label::before {
    border: 1px solid rgb(139 150 169 / 0.5);
    background: #fff;
}
.custom-control-input:checked ~ .custom-control-label::before {
    background: var(--hostento-primary-action);
    border-color: var(--hostento-primary-action);
}
.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px var(--hostento-primary-100);
}

/* ==========================================================================
   Tables — with a mobile strategy, not a horizontal scrollbar by accident
   ========================================================================== */

.table {
    color: var(--hostento-body);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    background: var(--hostento-surface);
    border-bottom: 1px solid var(--hostento-border);
    border-top: 0;
    color: var(--hostento-text);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    white-space: nowrap;
}

.table td { padding: 1rem; border-top: 1px solid var(--hostento-border); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--hostento-primary-50); }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--hostento-border); }

/* Wrap any table in a scroller so a wide table never breaks the page. */
.table-responsive { border-radius: var(--hostento-radius); }

/* Below sm, turn data tables into stacked rows using the header labels that
   WHMCS already emits via data-title where available. */
@media (max-width: 575.98px) {
    .table-stack thead { display: none; }
    .table-stack tbody tr {
        display: block;
        border: 1px solid var(--hostento-border);
        border-radius: var(--hostento-radius);
        margin-bottom: 0.75rem;
        padding: 0.5rem 0;
        background: #fff;
    }
    .table-stack tbody td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border: 0;
        padding: 0.5rem 1rem;
        text-align: end;
    }
    .table-stack tbody td::before {
        content: attr(data-title);
        font-weight: 700;
        color: var(--hostento-text);
        text-align: start;
    }
}

/* ==========================================================================
   Alerts, badges, labels
   ========================================================================== */

.alert {
    border: 1px solid transparent;
    border-radius: var(--hostento-radius);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.alert-success { background: var(--hostento-success-bg); border-color: #a7f3d0; color: #047857; }
.alert-info    { background: var(--hostento-info-bg);    border-color: var(--hostento-primary-200); color: var(--hostento-primary-700); }
.alert-warning { background: var(--hostento-warning-bg); border-color: #fde68a; color: #b45309; }
.alert-danger  { background: var(--hostento-danger-bg);  border-color: #fecaca; color: #b91c1c; }

.badge, .label {
    font-family: var(--hostento-font);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--hostento-radius-pill);
    letter-spacing: 0.01em;
}

.badge-success, .label-success { background: var(--hostento-success-bg); color: #047857; }
.badge-info,    .label-info    { background: var(--hostento-info-bg);    color: var(--hostento-primary-700); }
.badge-warning, .label-warning { background: var(--hostento-warning-bg); color: #b45309; }
.badge-danger,  .label-danger  { background: var(--hostento-danger-bg);  color: #b91c1c; }
.badge-primary { background: var(--hostento-primary-action); color: #fff; }
.badge-secondary, .label-default { background: var(--hostento-primary-50); color: var(--hostento-primary-700); }

/* WHMCS status pills */
.status, .client-status {
    border-radius: var(--hostento-radius-pill);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.375rem 0.75rem;
}

/* ==========================================================================
   Dropdowns, tabs, pagination, modals, tooltips
   ========================================================================== */

.dropdown-menu {
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow-lg);
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--hostento-body);
}
.dropdown-item {
    border-radius: var(--hostento-radius-sm);
    padding: 0.5rem 0.875rem;
    color: var(--hostento-body);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
}
.dropdown-divider { border-top-color: var(--hostento-border); }

.nav-tabs { border-bottom: 1px solid var(--hostento-border); gap: 0.25rem; }
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--hostento-body);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--hostento-primary-action); border-bottom-color: var(--hostento-primary-200); }
.nav-tabs .nav-link.active {
    color: var(--hostento-primary-action);
    background: transparent;
    border-bottom-color: var(--hostento-primary);
}

.nav-pills .nav-link { border-radius: var(--hostento-radius-pill); font-weight: 600; font-size: 0.875rem; }
.nav-pills .nav-link.active { background: var(--hostento-primary-action); }

.pagination { gap: 0.25rem; }
.page-link {
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius-sm);
    color: var(--hostento-body);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
}
.page-link:hover { background: var(--hostento-primary-50); color: var(--hostento-primary-action); }
.page-item.active .page-link { background: var(--hostento-primary-action); border-color: var(--hostento-primary-action); color: #fff; }

.modal-content {
    border: 0;
    border-radius: var(--hostento-radius-lg);
    box-shadow: var(--hostento-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--hostento-border); padding: 1.25rem 1.5rem; }
.modal-title { font-weight: 700; color: var(--hostento-text); }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--hostento-border); padding: 1rem 1.5rem; }

.tooltip-inner {
    background: var(--hostento-secondary);
    border-radius: var(--hostento-radius-sm);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.progress { background: var(--hostento-primary-50); border-radius: var(--hostento-radius-pill); height: 0.5rem; }
.progress-bar { background: var(--hostento-primary-action); border-radius: var(--hostento-radius-pill); }

/* ==========================================================================
   Sidebar (client area navigation)
   ========================================================================== */

.sidebar .panel,
.sidebar .card {
    border-radius: var(--hostento-radius);
    border: 1px solid var(--hostento-border);
    box-shadow: var(--hostento-shadow-sm);
}

.sidebar .list-group-item {
    border: 0;
    border-radius: var(--hostento-radius-sm);
    color: var(--hostento-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.6875rem 1rem;
}
.sidebar .list-group-item:hover { background: var(--hostento-primary-50); color: var(--hostento-primary-action); }
.sidebar .list-group-item.active {
    background: var(--hostento-primary-action);
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   Cart and checkout — the seam a customer would notice first
   ========================================================================== */

#order-standard_cart .product,
#order-standard_cart .products .product,
.cart-product-card {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius-lg);
    box-shadow: var(--hostento-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
#order-standard_cart .product:hover,
.cart-product-card:hover {
    transform: translateY(-3px);
    border-color: var(--hostento-primary-300);
    box-shadow: var(--hostento-shadow);
}

#order-standard_cart .product header,
#order-standard_cart .product h3 {
    background: transparent;
    color: var(--hostento-text);
    font-weight: 700;
    font-size: 1.125rem;
    border: 0;
}

#order-standard_cart .product .price,
.cart-price {
    color: var(--hostento-text);
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.02em;
}
#order-standard_cart .product .price small,
.cart-price small { font-size: 0.875rem; font-weight: 500; color: var(--hostento-muted-accessible); }

#order-standard_cart .summary-container,
.order-summary {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow-sm);
}

#order-standard_cart .cart-buttons .btn,
.cart-actions .btn { min-width: 10rem; }

/* Promo / discount presentation */
.cart-discount, .promo-applied {
    background: var(--hostento-success-bg);
    color: #047857;
    border-radius: var(--hostento-radius-pill);
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* ==========================================================================
   Auth screens (login, register, reset) — centred card like the storefront
   ========================================================================== */

.hostento-auth {
    min-height: calc(100vh - var(--hostento-header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: var(--hostento-background);
}

.hostento-auth-card {
    width: 100%;
    max-width: 34rem;
    background: rgb(240 249 255 / 0.6);
    border-radius: var(--hostento-radius-lg);
    padding: 3rem 2rem;
}

@media (min-width: 576px) { .hostento-auth-card { padding: 3rem; } }

.hostento-auth-card.is-wide { max-width: 48rem; }

.hostento-auth-brand {
    display: inline-flex;
    background: #fff;
    border-radius: var(--hostento-radius-sm);
    padding: 0.625rem 1rem;
    box-shadow: var(--hostento-shadow-sm);
}

.hostento-auth h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--hostento-text);
    margin: 2rem 0 0;
}

.hostento-auth .form-group { margin-bottom: 1rem; }
.hostento-auth .btn-primary { width: 100%; }
.hostento-auth-footnote { color: var(--hostento-muted-accessible); font-size: 0.875rem; }

/* ==========================================================================
   Empty, loading and error states
   ========================================================================== */

.hostento-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--hostento-body);
}
.hostento-empty .empty-icon {
    width: 3.5rem; height: 3.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--hostento-radius-pill);
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
    margin-bottom: 1rem;
}
.hostento-empty p { margin-bottom: 1.25rem; }

.hostento-skeleton {
    background: linear-gradient(90deg, var(--hostento-primary-50) 25%, #fff 50%, var(--hostento-primary-50) 75%);
    background-size: 200% 100%;
    animation: hostento-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--hostento-radius-sm);
}
@keyframes hostento-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hostento-skeleton { animation: none; }
    * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.hostento-error-code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--hostento-primary-200);
    line-height: 1;
}

/* ==========================================================================
   Footer — mirrors the storefront's four-column layout
   ========================================================================== */

#footer.hostento-footer {
    background: #fff;
    border-top: 1px solid var(--hostento-border);
    margin-top: 4rem;
    color: var(--hostento-body);
}

#footer.hostento-footer .footer-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hostento-text);
    margin-bottom: 1.5rem;
}

#footer.hostento-footer a { color: var(--hostento-body); font-size: 0.875rem; }
#footer.hostento-footer a:hover { color: var(--hostento-primary-action); }
#footer.hostento-footer ul { list-style: none; padding: 0; margin: 0; }
#footer.hostento-footer li + li { margin-top: 0.875rem; }

#footer.hostento-footer .footer-contact-icon {
    width: 2rem; height: 2rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hostento-primary-action);
    color: #fff;
    border-radius: var(--hostento-radius-sm);
}

#footer.hostento-footer .footer-social a {
    width: 2.25rem; height: 2.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--hostento-border-strong);
    border-radius: var(--hostento-radius-sm);
    color: var(--hostento-primary);
}
#footer.hostento-footer .footer-social a:hover { background: var(--hostento-primary-action); color: #fff; }

#footer .hostento-footer-bottom {
    border-top: 1px solid var(--hostento-border);
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

#footer.hostento-footer .btn {
    background: transparent;
    color: var(--hostento-body);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
}
#footer.hostento-footer .btn-secondary {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
    border: 1px solid var(--hostento-border);
}
#footer.hostento-footer .nav-link { color: var(--hostento-body); }
#footer.hostento-footer .btn-icon { padding: 0; }

/* ==========================================================================
   RTL — logical properties handle most of it; these are the exceptions
   ========================================================================== */

[dir="rtl"] body { text-align: right; }

[dir="rtl"] .mr-auto { margin-right: 0 !important; margin-left: auto !important; }
[dir="rtl"] .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .text-left  { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }

[dir="rtl"] .breadcrumb-item + .breadcrumb-item { padding-right: 0.5rem; padding-left: 0; }
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before { padding-left: 0.5rem; padding-right: 0; float: right; }

[dir="rtl"] .table thead th,
[dir="rtl"] .table td { text-align: right; }

[dir="rtl"] .dropdown-menu { text-align: right; }

[dir="rtl"] .input-group > .form-control:not(:last-child) { border-radius: var(--hostento-radius-sm) 0 0 var(--hostento-radius-sm); }
[dir="rtl"] .input-group > .form-control:not(:first-child) { border-radius: 0 var(--hostento-radius-sm) var(--hostento-radius-sm) 0; }

/* Directional glyphs must flip; status and brand marks must not. */
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-long-arrow-right,
[dir="rtl"] .fa-caret-right { transform: scaleX(-1); }

[dir="rtl"] .hostento-header .cart-btn .badge { inset-inline-end: -0.25rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
    #main-body { padding: 2rem 0 3rem; }
    .card-body, .panel-body { padding: 1.25rem; }
    h1, .h1 { font-size: 1.625rem; }
}

@media (max-width: 767.98px) {
    :root { --hostento-header-height: 4.25rem; }
    .hostento-topbar { font-size: 0.6875rem; }
    .hostento-topbar .container { min-height: 2.5rem; }
    .card-header, .panel-heading { padding: 1rem 1.25rem; }
    .btn { padding: 0.6875rem 1.25rem; }
    .hostento-auth-card { padding: 2rem 1.25rem; }
}

@media (max-width: 575.98px) {
    .hostento-header .navbar-brand { padding: 0.375rem 0.75rem; }
    .hostento-header .navbar-brand .logo-img,
    .hostento-header .navbar-brand img { height: 1.625rem; }
    h1, .h1 { font-size: 1.5rem; }
    #order-standard_cart .product .price, .cart-price { font-size: 1.625rem; }
    .btn-block-xs { display: block; width: 100%; }
}

/* Nothing may push the page sideways at any width. */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, video, table { max-width: 100%; }

/* Print — invoices are printed far more often than any other page. */
@media print {
    .hostento-header, .hostento-footer, .master-breadcrumb, .sidebar, .btn { display: none !important; }
    #main-body { padding: 0; }
    .card, .panel { border: 1px solid #ddd; box-shadow: none; }
}

/* ==========================================================================
   Real WHMCS client-area components

   Everything below targets markup WHMCS actually emits, verified against a
   rendered page rather than assumed. The parent theme styles most of these
   with element+class selectors, so several rules here need the `#main-body`
   id to win. Check specificity before editing.
   ========================================================================== */

/* Client-area home tiles (a.tile) — the parent paints these #f8f8f8 flat
   boxes. These are the storefront's stat cards. */
#main-body a.tile,
#main-body .tile {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow-sm);
    color: var(--hostento-text);
    padding: 1.5rem 1.25rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#main-body a.tile:hover {
    border-color: var(--hostento-primary-300);
    box-shadow: var(--hostento-shadow);
    transform: translateY(-2px);
    text-decoration: none;
}
#main-body .tile .stat {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--hostento-text);
    line-height: 1.1;
}
#main-body .tile .title {
    color: var(--hostento-body);
    font-size: 0.875rem;
    font-weight: 500;
}
#main-body .tile i { color: var(--hostento-primary-action); }

/* The parent's colour utility classes are used for tile accents and small
   pills. Keep the semantics, restate them in the Hostento palette. */
#main-body .bg-color-blue,
#main-body .highlight.bg-color-blue { background-color: var(--hostento-primary-action) !important; color: #fff; }
#main-body .bg-color-green   { background-color: var(--hostento-success-solid) !important; color: #fff; }
#main-body .bg-color-red     { background-color: var(--hostento-danger-solid) !important; color: #fff; }
#main-body .bg-color-gold,
#main-body .bg-color-orange  { background-color: var(--hostento-warning-solid) !important; color: #fff; }
#main-body .bg-color-asbestos{ background-color: var(--hostento-body) !important; color: #fff; }

/* Service status ribbon on the product-details page. */
#main-body .div-service-status,
#main-body .service-status {
    border-radius: 0 0 var(--hostento-radius) var(--hostento-radius);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8125rem;
}
#main-body .div-service-status.active,
#main-body .service-status-active   { background: var(--hostento-success-solid); color: #fff; }
#main-body .service-status-pending  { background: var(--hostento-warning-solid); color: #fff; }
#main-body .service-status-suspended,
#main-body .service-status-terminated,
#main-body .service-status-cancelled { background: var(--hostento-danger-solid); color: #fff; }

/* WHMCS uses .btn-default as its neutral button; Bootstrap 4 has no such
   class, so the parent theme defines it and it lands unstyled otherwise. */
#main-body .btn-default {
    background: #fff;
    border: 1px solid var(--hostento-border-strong);
    color: var(--hostento-primary-action);
    font-weight: 600;
}
#main-body .btn-default:hover {
    background: var(--hostento-primary-50);
    border-color: var(--hostento-primary-300);
    color: var(--hostento-primary-action);
}

/* Sidebar cards (card-sidebar) */
#main-body .card-sidebar .card-header {
    background: #fff;
    border-bottom: 1px solid var(--hostento-border);
}
#main-body .card-sidebar .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hostento-text);
}
#main-body .card-sidebar .list-group-item {
    border: 0;
    border-top: 1px solid var(--hostento-border);
    color: var(--hostento-body);
    font-size: 0.9375rem;
    padding: 0.75rem 1.25rem;
}
#main-body .card-sidebar .list-group-item:hover {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
}
#main-body .card-sidebar .list-group-item.active {
    background: var(--hostento-primary-action);
    border-color: var(--hostento-primary-action);
    color: #fff;
    font-weight: 600;
}
#main-body .card-sidebar .card-minimise { color: var(--hostento-muted); font-size: 0.875rem; }

/* Generic list groups elsewhere in the client area (ticket lists, etc). */
#main-body .list-group-item-action { color: var(--hostento-body); }
#main-body .list-group-item-action:hover {
    background: var(--hostento-primary-50);
    color: var(--hostento-primary-action);
}

/* Card footers — parent uses a grey; keep the storefront's tinted surface. */
#main-body .card-footer {
    background: var(--hostento-surface);
    border-top: 1px solid var(--hostento-border);
}

/* MarketConnect promo panels and SSO panels ship their own markup. */
#main-body .panel-mc-sso,
#main-body .mc-promo-manage,
#main-body .mc-promo-login,
#main-body .promo-container {
    background: #fff;
    border: 1px solid var(--hostento-border);
    border-radius: var(--hostento-radius);
    box-shadow: var(--hostento-shadow-sm);
}
#main-body .promo-container .header h3 {
    color: var(--hostento-text);
    font-weight: 700;
}

/* Third-party addon widgets (SiteLock, 360 Monitoring) use their own colours;
   only the supporting labels are ours to correct. */
#main-body .threesixtymonitoring-title,
#main-body .title,
#main-body small.text-muted,
#main-body .text-muted {
    color: var(--hostento-body);
}

/* --------------------------------------------------------------------------
   Corrections that need to outrank the parent theme

   These are grouped at the end deliberately: each one beats a parent rule that
   is either more specific than a plain class selector or uses !important.
   Keep them last so source order works in our favour.
   -------------------------------------------------------------------------- */

/* Colour utilities are applied *with* .btn, so they must outrank the
   .btn-default colour above or the label matches its own background. */
#main-body .btn.bg-color-blue,
#main-body .btn.bg-color-green,
#main-body .btn.bg-color-red,
#main-body .btn.bg-color-gold,
#main-body .btn.bg-color-orange,
#main-body .btn.bg-color-asbestos {
    color: #fff;
    border-color: transparent;
}

/* WHMCS uses .btn-xs in several addon panels; Bootstrap 4 dropped it, so it
   inherits the full-size padding from .btn without this. */
#main-body .btn-xs {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Client-home tile icons. The parent floats a 55px glyph in the corner and
   grows it to 70px on hover, which overwhelms the storefront's card. */
#main-body .tiles .tile i {
    font-size: 1.5rem;
    color: var(--hostento-primary-300);
    top: 1.25rem;
    inset-inline-end: 1.25rem;
    transition: color .15s ease;
}
#main-body .tiles .tile:hover i {
    font-size: 1.5rem;
    color: var(--hostento-primary-action);
}
#main-body .tiles .tile { border-right: 0; }
#main-body .tiles .tile:hover { background: #fff; }
#main-body .tiles .tile .stat { margin-top: 0.5rem; font-size: 2rem; }
#main-body .tiles .tile .title {
    text-transform: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hostento-body);
}
/* The parent's 2px accent bar reads as a stray underline in a card. */
#main-body .tiles .tile .highlight { display: none; }
/* no-gutters would butt the cards together edge to edge. */
#main-body .tiles .row.no-gutters { margin: 0 -0.5rem; }
#main-body .tiles .row.no-gutters > [class*="col-"] { padding: 0 0.5rem 1rem; }

/* Admin-only affordance. Every declaration in the parent is !important, so
   matching it is the only way to restyle this control. */
#header .btn-return-to-admin,
#header .btn-return-to-admin:hover {
    background-color: var(--hostento-primary-action) !important;
    color: #fff !important;
    border-radius: 0 0 var(--hostento-radius-sm) var(--hostento-radius-sm) !important;
    font-size: 0.8125rem !important;
}
#header .btn-return-to-admin:hover {
    background-color: var(--hostento-primary-action-hover) !important;
}
#header .btn-return-to-admin i,
#header .btn-return-to-admin span { color: #fff !important; }

/* Bootstrap's caret uses a left margin, which lands on the wrong side in RTL. */
[dir="rtl"] #header .navbar-nav > li > a.dropdown-toggle::after {
    margin-inline-start: 0.35em;
    margin-inline-end: 0;
}
/* navbar.tpl adds pr-4 for spacing; that is a physical class, so mirror it. */
[dir="rtl"] #header .navbar-nav > li > a.pr-4 {
    padding-right: 0.875rem !important;
    padding-left: 1.5rem !important;
}
