@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Hostlaxy brand tokens. Nexus Cart variables below are retained from 9.0.10. */
:root {
    --hlx-navy: #120851;
    --hlx-primary: #4c57d6;
    --hlx-primary-hover: #3d46b4;
    --hlx-gradient: linear-gradient(45deg, #af00e1, #ff9e35);
    --hlx-canvas: #f5f6fb;
    --hlx-ink: #20233f;
    --hlx-muted: #5d6479;
    --hlx-line: #e0e4ef;
    --hlx-radius: 12px;
    --hlx-shadow: 0 4px 20px rgb(18 8 81 / 4%);
    --hlx-focus: #4c57d6;
}

/* Complete upstream Nexus Cart contract, with the Hostlaxy palette. */
html {
    font-size: 14px;
}

:root {
    --white: #fff;

    /* Neutral shades */
    --neutral-50: #fbf9fa;
    --neutral-100: #f4f5f7;
    --neutral-200: #e4e4e7;
    --neutral-300: #d0d5dd;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    --neutral-950: #030712;

    /* Neutral shades */
    /* define own pallet with brand colors */
    --primary-50: #f5f6ff;
    --primary-100: #eceeff;
    --primary-200: #dce0ff;
    --primary-300: #bdc4ff;
    --primary-400: #929cf0;
    --primary-500: #6975e4;
    --primary-600: #4c57d6;
    --primary-700: #3d46b4;
    --primary-800: #30388f;
    --primary-900: #221963;
    --primary-950: #120851;

    /* Primary colors */
    /* Use shades from comments if `primary` colors use other colors, then neutral */
    --primary: var(--primary-600);          /* var(--primary-600) */
    --primary-lifted: var(--primary-700);   /* var(--primary-700) */
    --primary-accented: var(--primary-800); /* var(--primary-800) */

    /* Secondary colors */
    --secondary: var(--neutral-500);
    --secondary-lifted: var(--neutral-600);
    --secondary-accented: var(--neutral-700);

    /* Success colors */
    --success: #167044;
    --success-lifted: #008236;
    --success-accented: #016630;

    /* Info colors */
    --info: #2458b3;
    --info-lifted: #1447e6;
    --info-accented: #193cb8;

    /* Notice colors */
    --notice: #7f22fe;
    --notice-lifted: #7008e7;
    --notice-accented: #5d0ec0;

    /* Warning colors */
    --warning: #a33a00;
    --warning-lifted: #ca3500;
    --warning-accented: #9f2d00;

    /* Error colors */
    --error: #b42335;
    --error-lifted: #c10007;
    --error-accented: #9f0712;

    /* Grayscale colors */
    --grayscale: var(--neutral-900);
    --grayscale-lifted: var(--neutral-800);
    --grayscale-accented: var(--neutral-700);

    /* Neutral colors */
    --neutral: var(--neutral-500);
    --neutral-lifted: var(--neutral-600);
    --neutral-accented: var(--neutral-700);

    /* Text neutral colors */
    --text-inverted: var(--white);
    --text-muted: var(--neutral-600);
    --text-lifted: var(--neutral-600);
    --text-accented: var(--neutral-600);
    --text: var(--neutral-900);

    /* Border neutral colors */
    --border-muted: var(--neutral-200);
    --border: var(--neutral-300);
    --border-lifted: var(--neutral-400);
    --border-accented: var(--neutral-600);

    /* Background neutral colors */
    --bg: var(--white);
    --bg-muted: var(--neutral-50);
    --bg-lifted: var(--neutral-100);
    --bg-accented: var(--neutral-200);
    --bg-inverted: var(--neutral-900);

    /* Additional colors */
    --yellow-200: #fff085;
    --yellow-300: #ffdf20;
    --teal-300: #46edd5;
    --teal-400: #00d5be;
    --emerald-300: #5ee9b5;
    --pink-400: #fb64b6;

    /* Additional custom properties */
    /* Font sizes */
    --text-xs: 0.625rem;
    --text-sm: 0.75rem;
    --text-md: 0.875rem;
    --text-lg: 1rem;

    /* Spacing */
    --outline-sm: 1px;
    --outline-md: 2px;
    --outline-lg: 3px;

    /* Rounding */
    --rounding-sm: 0.25rem;
    --rounding-md: 0.5rem;
    --rounding-lg: 0.75rem;

    /* Other */
    --letter-spacing: 0em;
    --disabled-opacity: 25%;
}

/* 1. Shared surfaces and typography */
body, body.primary-bg-color { background: var(--hlx-canvas); color: var(--hlx-ink); }
body, input, select, textarea, button, .btn { font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1, h2, h3, h4, h5, h6 { color: var(--hlx-navy); font-weight: 600; letter-spacing: -.025em; }
a { color: var(--hlx-primary); }
a:hover { color: var(--hlx-primary-hover); }
.text-muted, .client-home-cards small { color: var(--hlx-muted) !important; }
#main-body { padding: 28px 0 48px; min-height: 60vh; }
.primary-content, .hlx-panel { min-width: 0; }
.card, .modal-content, .mc-promo-manage, .mc-promo-login {
    border: 1px solid var(--hlx-line); border-radius: var(--hlx-radius);
    background-color: #fff; box-shadow: var(--hlx-shadow);
}
.primary-content .card { margin-bottom: 20px; }
.card-header { background: #fff; border-bottom: 1px solid var(--hlx-line); padding: 18px 20px; }
.card-header:first-child { border-radius: 11px 11px 0 0; }
.card-footer { background: #fafbff; border-top: 1px solid var(--hlx-line); }
.card-footer:last-child { border-radius: 0 0 11px 11px; }
.card-title { overflow-wrap: anywhere; }
.list-group-item { border-color: var(--hlx-line); overflow-wrap: anywhere; }
.list-group-item-action { color: var(--hlx-ink); }
.list-group-item-action:hover { background: #f5f6ff; color: var(--hlx-primary-hover); }
.list-group-item.active, .nav-pills .nav-link.active { color: #fff; background: var(--hlx-primary); border-color: var(--hlx-primary); }
.sidebar .card-header { background: #fff; color: var(--hlx-navy); }
.sidebar .card-title { font-size: 1rem; font-weight: 600; }
.sidebar .list-group-item { padding: 12px 18px; }
/* Override Twenty-One's more specific grey active/hover/focus rules. */
.sidebar .list-group-item.active,
.sidebar .list-group-item.active:hover,
.sidebar .list-group-item.active:focus {
    background: rgb(76 87 214 / 10%); color: var(--hlx-primary-hover);
    border-color: var(--hlx-line); border-left: 3px solid var(--hlx-primary);
    padding-left: 15px; font-weight: 600;
}
.sidebar .list-group-item.active > i { color: inherit; }
.sidebar .card-minimise { cursor: pointer; color: var(--hlx-muted); }
/* The nested flush list must end inside the card's rounded outer border. */
.sidebar .card-sidebar { border: 1px solid var(--hlx-line); }
.sidebar .card-sidebar > .collapsable-card-body:last-child,
.sidebar .card-sidebar > .collapsable-card-body:last-child > .list-group:last-child,
.sidebar .card-sidebar > .collapsable-card-body:last-child > .list-group:last-child > .list-group-item:last-child {
    border-bottom-left-radius: 11px; border-bottom-right-radius: 11px;
}
.sidebar .card-sidebar .list-group-flush > .list-group-item:last-child { border-bottom-width: 0; }
.master-breadcrumb { background: var(--hlx-canvas); border-bottom: 1px solid var(--hlx-line); }
.master-breadcrumb .breadcrumb { padding: 13px 0; background: transparent; }

/* 2. Navy masthead. Bootstrap still owns collapse, dropdowns and popovers. */
header.header, header.header .navbar, header.header .main-navbar-wrapper { background: var(--hlx-navy); }
header.header { border-bottom: 3px solid var(--hlx-primary); }
header.header .topbar { padding: 7px 0; background: rgb(255 255 255 / 4%); border-bottom: 1px solid rgb(255 255 255 / 12%); }
header.header .topbar .btn, header.header .topbar .active-client .btn,
header.header .topbar .active-client .input-group-text { color: #e7e8ff; }
header.header .navbar-light { padding: 20px 1rem; }
header.header .navbar-brand { color: #fff; min-width: 0; }
header.header .logo-img { width: 190px; max-width: 100%; height: auto; max-height: 48px; object-fit: contain; }
header.header .navbar a, header.header .toolbar .nav-link { color: #f5f6ff; }
header.header .toolbar .nav-link { border-color: #655c91; border-radius: 8px; }
header.header .toolbar .nav-link:hover, header.header .navbar-nav > li > a:hover,
header.header .navbar-nav > li.active > a, header.header .navbar-nav > li.show > a { color: #fff; background: #383078; }
header.header .main-navbar-wrapper .navbar-collapse { padding: 0 0 12px; }
header.header .navbar-nav > li > a { display: block; padding: 11px 14px; border-radius: 8px; }
header.header .dropdown-menu { border: 1px solid #655c91; background: #1e155f; box-shadow: 0 12px 32px rgb(0 0 0 / 18%); border-radius: 10px; }
header.header .dropdown-item { background: transparent; white-space: normal; }
header.header .dropdown-item:hover, header.header .dropdown-item:focus,
header.header .dropdown-item.active, header.header .dropdown-item:active { color: #fff; background: #383078; }
header.header .search { background: #282060; border-color: #655c91; border-radius: 8px; }
header.header .search .btn, header.header .search .form-control { background: transparent; color: #fff; }
header.header .search .form-control::placeholder { color: #d4d0ed; opacity: 1; }
header.header .search:focus-within { border-color: #c2c9ff; box-shadow: 0 0 0 3px rgb(194 201 255 / 25%); }
header.header .active-client .btn.btn-active-client span { border-bottom: none; }
header.header .badge-info { background: #fff; color: var(--hlx-navy); opacity: 1 !important; }

/* 3. Actions, inputs and keyboard focus */
.btn { border-radius: 8px; font-weight: 600; padding: .6rem 1rem; }
.btn-sm { padding: .35rem .65rem; }
.btn-xs { padding: .25rem .5rem; }
.btn-primary, .btn-primary.disabled, .btn-primary:disabled { color: #fff; background: var(--hlx-primary); border-color: var(--hlx-primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active { color: #fff; background: var(--hlx-primary-hover); border-color: var(--hlx-primary-hover); }
.btn-default { color: var(--hlx-ink); background: #fff; border: 1px solid #c8cddd; }
.btn-default:hover { color: var(--hlx-primary-hover); background: #f1f3ff; border-color: #929cf0; }
.btn-outline-primary { color: var(--hlx-primary); border-color: var(--hlx-primary); }
.btn-outline-primary:hover, .btn-outline-primary:active { color: #fff; background: var(--hlx-primary); border-color: var(--hlx-primary); }
.btn-link { color: var(--hlx-primary); }
/* Your Info uses btn-success for an action, not a success state. */
.sidebar .btn-success { background: var(--hlx-primary); border-color: var(--hlx-primary); color: #fff; }
.sidebar .btn-success:hover, .sidebar .btn-success:focus,
.sidebar .btn-success:not(:disabled):not(.disabled):active, .sidebar .btn-success:not(:disabled):not(.disabled).active {
    background: var(--hlx-primary-hover); border-color: var(--hlx-primary-hover); color: #fff;
}
.sidebar .btn-success:focus { box-shadow: 0 0 0 3px rgb(76 87 214 / 18%); }
.form-control, .custom-select, #registration .field, #registration .form-control {
    border-color: #c8cddd; border-radius: 8px; color: var(--hlx-ink); background-color: #fff;
}
.form-control, .custom-select { min-height: 42px; }
textarea.form-control { min-height: 110px; }
#registration .field, #registration .form-control { height: 42px; }
#registration .field-icon { height: 42px; }
#registration label { font-weight: 500; color: var(--hlx-muted); }
.input-group-text { background-color: #f5f6fb; border-color: #c8cddd; color: var(--hlx-muted); border-radius: 8px; }
.form-control:focus, .custom-select:focus, #registration .field:focus, #registration .form-control:focus {
    border-color: var(--hlx-primary); box-shadow: 0 0 0 3px rgb(76 87 214 / 18%); outline: 2px solid var(--hlx-focus); outline-offset: 1px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.btn:focus-visible, header.header .btn:focus-visible { outline: 3px solid var(--hlx-focus); outline-offset: 3px; box-shadow: 0 0 0 5px #fff; }
header.header :focus-visible, #footer.footer :focus-visible { --hlx-focus: #c2c9ff; box-shadow: 0 0 0 5px var(--hlx-navy); }

/* 4. Tables and status labels. Each status retains its text as well as colour. */
.table { color: var(--hlx-ink); }
.table thead th, table.dataTable thead th { background: #f1f3fa; border-bottom: 1px solid #d9deeb; color: #454c65; padding: 14px 16px; font-weight: 600; }
/* Keep sorted/unsorted headers identical; preserve DataTables sorting hooks. */
.dataTables_wrapper table.table-list thead th,
.dataTables_wrapper table.table-list thead th.sorting_asc,
.dataTables_wrapper table.table-list thead th.sorting_desc {
    background: #f1f3fa; border-bottom: 1px solid #d9deeb; font-weight: 500;
}
.dataTables_wrapper table.table-list thead th.sorting_asc,
.dataTables_wrapper table.table-list thead th.sorting_desc { font-weight: 600; }
table.dataTable thead > tr > th[class*="sorting"] { padding-right: 28px; }
table.dataTable thead > tr > th[class*="sorting"]::before,
table.dataTable thead > tr > th[class*="sorting"]::after { color: var(--hlx-muted); opacity: .25; }
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::after { color: var(--hlx-primary-hover); opacity: .75; }
.table td { padding: 14px 16px; border-top-color: #e7eaf2; vertical-align: middle; }
.table-striped tbody tr:nth-of-type(odd) { background: #fafbff; }
.table-hover tbody tr:hover, table.dataTable tbody tr:hover { background: #eef0ff; }
.dataTables_wrapper { max-width: 100%; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { margin-bottom: 16px; }
.dataTables_wrapper .dataTables_filter input { max-width: 100%; }
.pagination .page-link { color: var(--hlx-primary); border-color: var(--hlx-line); }
.pagination .page-item.active .page-link { background: var(--hlx-primary); border-color: var(--hlx-primary); color: #fff; }
.label, .badge { border-radius: 999px; font-weight: 600; line-height: 1.35; }
.label { display: inline-block; padding: .3em .7em; white-space: normal; }
.label-success, .badge-success, .status-active, .status-open, .status-completed, .status-paid, .status-accepted { background: #e4f5ec; color: #14643d; }
.label-warning, .badge-warning, .status-pending, .status-pending-transfer, .status-pending-registration,
.status-suspended, .status-customer-reply, .status-redemption, .status-grace, .status-refunded { background: #fff1d6; color: #805000; }
.label-danger, .badge-danger, .status-unpaid, .status-overdue, .status-inprogress, .status-collections { background: #ffeaed; color: #a01f34; }
.label-info, .badge-info, .status-payment-pending, .status-onhold, .status-delivered, .status-answered { background: #edf0ff; color: #3944a9; }
.label-default, .badge-secondary, .status-closed, .status-terminated, .status-cancelled, .status-expired, .status-transferred-away { background: #edf0f5; color: #4b5264; }
.alert { border-radius: 10px; }
.alert-success { background: #e4f5ec; color: #14643d; border-color: #b9dfca; }
.alert-warning { background: #fff1d6; color: #805000; border-color: #edcf98; }
.alert-danger { background: #ffeaed; color: #a01f34; border-color: #efbdc5; }
.alert-info { background: #edf0ff; color: #3944a9; border-color: #cbd1f3; }

/* 5. Dashboard: stock statistics and hook panels, in their original order. */
.hlx-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.hlx-welcome h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.hlx-welcome h1 span { font-weight: 700; }
.hlx-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hlx-stats > .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.hlx-stats > .row > div { max-width: none; width: auto; }
.hlx-stats.tiles .row > div > .tile {
    height: 100%; padding: 20px; border: 1px solid var(--hlx-line); border-radius: 12px;
    background: #fff; color: var(--hlx-navy); box-shadow: var(--hlx-shadow); transition: border-color .15s ease, box-shadow .15s ease;
}
.hlx-stats.tiles .tile:hover { border-color: #929cf0; box-shadow: 0 6px 24px rgb(18 8 81 / 9%); }
.hlx-stats.tiles .tile i, .hlx-stats.tiles .tile:hover i {
    position: static; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; font-size: 18px; border-radius: 10px; background: #eef0ff; color: var(--hlx-primary);
}
.hlx-stats.tiles .tile .stat { margin-top: 16px; margin-bottom: 6px; font-size: 2.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hlx-stats.tiles .tile .title { color: var(--hlx-muted); font-size: .8rem; text-transform: none; overflow-wrap: anywhere; }
.hlx-stats.tiles .tile .highlight { background: var(--hlx-primary) !important; height: 3px; margin-top: 18px; opacity: .2; }
.hlx-stats.tiles .row > div > .tile.hlx-attention { border-color: #efbdc5; background: #fff8f9; }
.hlx-stats.tiles .tile.hlx-attention .stat, .hlx-stats.tiles .tile.hlx-attention i { color: #a01f34; }
.hlx-stats.tiles .tile.hlx-attention i { background: #ffeaed; }
.hlx-stats.tiles .tile.hlx-attention .highlight { background: #a01f34 !important; opacity: .6; }
.hlx-panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.hlx-panel-wide { grid-column: 1 / -1; }
.hlx-panel-grid .card { margin-bottom: 0; }
.client-home-cards .card-header { padding: 18px 20px; }
.client-home-cards .card-header .btn { background: #eef0ff !important; color: #3944a9; border: 1px solid #dce0ff; white-space: normal; }
.client-home-cards .card-header .btn:hover { background: #dce0ff !important; color: #30388f; }
.client-home-cards .card-title { font-size: 1rem; line-height: 1.6; }
.client-home-cards .card-title .badge, .sidebar .badge { color: #3944a9; background: #edf0ff; }
.client-home-cards .list-group { max-height: 320px; border-color: var(--hlx-line) !important; }
.client-home-cards .list-group .list-group-item { padding: 12px 18px; border-color: var(--hlx-line); }
.client-home-cards .card-body { max-width: 100%; }
.client-home-cards .card-body p { padding: 12px 20px; overflow-wrap: anywhere; }
.client-home-cards .card .card-footer { padding: 8px 16px; background: #fff; border-top: 1px solid #edf0f5; }
.client-home-cards .card-footer .btn-view-more { padding: .3rem .5rem; background: transparent; border-color: transparent; color: var(--hlx-primary); }
.client-home-cards .card-footer .btn-view-more:hover { background: #f5f6ff; color: var(--hlx-primary-hover); }
.client-home-cards .card-footer:empty { display: none; }

/* 6. Authentication: CSS only, leaving every field and handler inherited. */
.hlx-page-login .login-form > .card, .hlx-page-password-reset-container .card.mw-540 { position: relative; border-top: 4px solid var(--hlx-primary); }
.hlx-page-login .login-form > .card::before, .hlx-page-password-reset-container .card.mw-540::before {
    content: ""; position: absolute; top: -4px; left: 12px; right: 12px; height: 4px; background: var(--hlx-gradient);
}
.hlx-page-password-reset-container .card.mw-540 { width: calc(100% - 30px); }
#registration { max-width: 850px; margin: 12px auto 0; }
#registration .card:first-child { border-top: 4px solid var(--hlx-primary); }
.hlx-page-login .login-form, .hlx-page-password-reset-container .primary-content { padding-top: 12px; }

/* 7. Compact footer; upstream copyright, licensing and footeroutput untouched. */
#footer.footer { background: var(--hlx-navy); color: #d7d9ee; padding: 26px 0; }
#footer.footer .nav-link, #footer.footer .btn { color: #f1f2ff; }
#footer.footer .copyright, #footer.footer .notices { margin: 16px 0 0; }
#footer.footer .mb-7 { margin-bottom: 14px !important; }
#footer.footer a:hover { color: #fff; text-decoration: underline; }

/* WHMCS can append its licensing credit as a body-level paragraph outside #footer.
   Keep that output visible and extend the navy footer surface behind it. */
body > p:has(a[href*="whmcs.com"]) {
    background: var(--hlx-navy); color: #d7d9ee; margin: 0; padding: 0 15px 18px; font-size: .85rem;
}
#footer.footer a, body > p:has(a[href*="whmcs.com"]) a { color: #f1f2ff; }
body > p:has(a[href*="whmcs.com"]) a:hover { color: #fff; text-decoration: underline; }
body > p:has(a[href*="whmcs.com"]) a:focus-visible { outline: 3px solid #c2c9ff; outline-offset: 3px; }

/* 8. Small screens and reduced motion */
@media (max-width: 1199.98px) {
    .hlx-stats > .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    header.header .main-navbar-wrapper .navbar-collapse { padding: 12px 0; }
    header.header .navbar-nav > li > a { padding: 12px; }
    header.header .dropdown-menu { margin: 4px 0 10px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hlx-panel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    #main-body { padding-top: 20px; }
    .hlx-panel-grid { grid-template-columns: minmax(0, 1fr); }
    .hlx-stats > .row { gap: 12px; }
    .hlx-stats.tiles .row > div > .tile { padding: 16px; }
    .hlx-quick-actions { width: 100%; }
    .hlx-quick-actions .btn { flex: 1 1 auto; font-size: .8rem; }
    header.header .navbar-light { padding: 16px 1rem; }
    header.header .logo-img { width: 150px; max-height: 40px; }
    header.header .toolbar .nav-link { padding: .65rem; }
    header.header .topbar .active-client .btn.btn-active-client span { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .table-responsive, .dataTables_wrapper > .row > .col-sm-12 { overflow-x: auto; }
    /* Fallback before DataTables starts; after init, scroll only its table region.
       Search/info stay within that region; length/pagination stay outside it. */
    .table-container { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container .dataTables_wrapper { width: 100%; min-width: 0; }
    .table-container .listtable { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container .listtable .dataTables_filter,
    .table-container .listtable .dataTables_info { position: sticky; left: 0; max-width: 100%; }
    .table-container .listtable .dataTables_filter { right: 0; }
    .table-container .dataTables_length, .table-container .dataTables_paginate { max-width: 100%; }
    .dataTables_wrapper .dataTables_filter input { width: 150px; }
    .dataTables_wrapper .pagination { flex-wrap: wrap; }
    .card-header { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .hlx-stats.tiles .tile, .hlx-stats.tiles .tile i, .btn, .form-control { transition: none; }
}
