@tailwind base;
@tailwind components;
@tailwind utilities;

/*
|--------------------------------------------------------------------------
| HogeyTech ERP Clean App CSS
|--------------------------------------------------------------------------
| Old dark dashboard CSS was removed from this file.
| Theme colors are now controlled by variables + html.dark.
|--------------------------------------------------------------------------
*/

:root {
    color-scheme: light;

    --ht-bg: #f5f9fc;
    --ht-bg-soft: #eef7fb;

    --ht-sidebar: #ffffff;
    --ht-topbar: #ffffff;
    --ht-surface: #ffffff;
    --ht-surface-soft: #f8fafc;
    --ht-surface-muted: #eef4f8;

    --ht-text: #172033;
    --ht-heading: #07111f;
    --ht-muted: #516173;
    --ht-faint: #8fa0b5;

    --ht-border: #dce6ef;
    --ht-border-soft: #edf2f7;

    --ht-primary: var(--ht-primary);
    --ht-primary-hover: color-mix(in srgb, var(--ht-primary) 82%, #000000);
    --ht-primary-soft: color-mix(in srgb, var(--ht-primary) 14%, transparent);

    --ht-success: #16a34a;
    --ht-warning: #d97706;
    --ht-danger: #dc2626;

    --ht-radius: 20px;
    --ht-shadow: 0 14px 40px rgba(15, 23, 42, .07);
}

html.dark {
    color-scheme: dark;

    --ht-bg: #07111f;
    --ht-bg-soft: #0b1626;

    --ht-sidebar: #0b1626;
    --ht-topbar: #08111f;
    --ht-surface: #101b2d;
    --ht-surface-soft: #142137;
    --ht-surface-muted: #19263b;

    --ht-text: #e7eef8;
    --ht-heading: #ffffff;
    --ht-muted: #c5d0df;
    --ht-faint: #8fa0b5;

    --ht-border: #27384f;
    --ht-border-soft: #1d2b40;

    --ht-primary: var(--ht-primary);
    --ht-primary-hover: color-mix(in srgb, var(--ht-primary) 82%, #000000);
    --ht-primary-soft: color-mix(in srgb, var(--ht-primary) 17%, transparent);

    --ht-success: #4ade80;
    --ht-warning: #fbbf24;
    --ht-danger: #f87171;

    --ht-shadow: 0 18px 55px rgba(0, 0, 0, .32);
}

/* Base */
html,
body {
    min-height: 100%;
    background: var(--ht-bg) !important;
    color: var(--ht-text) !important;
}

body {
    margin: 0;
}

body.ht-body,
#app,
main,
.ht-main,
.ht-content,
.min-h-screen {
    background: var(--ht-bg) !important;
    color: var(--ht-text) !important;
}

/* Layout */
.ht-body {
    min-height: 100vh;
}

.ht-main {
    min-height: 100vh;
    margin-left: 17rem;
}

.ht-content {
    padding: 1.5rem;
}

.ht-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 17rem;
    overflow-y: auto;
    background: var(--ht-sidebar) !important;
    color: var(--ht-text) !important;
    border-right: 1px solid var(--ht-border) !important;
    box-shadow: 8px 0 30px rgba(15, 23, 42, .06);
}

.ht-sidebar-real-logo {
    max-width: 13rem;
    height: auto;
}

.ht-sidebar nav,
.ht-sidebar-menu {
    background: transparent !important;
}

.ht-nav-link,
.ht-sidebar a {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--ht-muted) !important;
    text-decoration: none;
    border-radius: 1rem;
    transition: .16s ease;
}

.ht-nav-link:hover,
.ht-sidebar a:hover {
    background: var(--ht-primary-soft) !important;
    color: var(--ht-heading) !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active {
    background: var(--ht-brand-gradient) !important;
    color: #ffffff !important;
}

.ht-sidebar-card {
    margin: 1rem;
    padding: 1rem;
    border: 1px solid var(--ht-border);
    border-radius: 1.25rem;
    background: var(--ht-surface-soft);
    color: var(--ht-text);
}

.ht-sidebar-card-title {
    font-weight: 900;
    color: var(--ht-heading);
}

.ht-sidebar-card-text {
    color: var(--ht-muted);
    font-size: .85rem;
}

.ht-topbar {
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.5rem;
    background: var(--ht-topbar) !important;
    color: var(--ht-text) !important;
    border-bottom: 1px solid var(--ht-border) !important;
}

.ht-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.ht-topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0 .9rem;
    border-radius: .9rem;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface);
    color: var(--ht-heading);
    font-weight: 900;
    font-size: .85rem;
    text-decoration: none;
}

.ht-topbar-btn:hover {
    border-color: var(--ht-primary);
    color: var(--ht-primary);
}

/* Page shell */
.ht-page-v2,
.ht-admin-dashboard-v2 {
    display: grid;
    gap: 1.5rem;
    color: var(--ht-text);
}

/* Heroes */
.ht-page-hero-v2,
.ht-admin-hero-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--ht-border);
    background:
        radial-gradient(circle at top right, var(--ht-primary-soft), transparent 28rem),
        var(--ht-surface) !important;
    color: var(--ht-text) !important;
    box-shadow: var(--ht-shadow);
}

.ht-page-hero-v2 h1,
.ht-admin-hero-v2 h1 {
    margin: .35rem 0 .6rem;
    color: var(--ht-heading) !important;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.04em;
}

.ht-page-hero-v2 p,
.ht-admin-hero-v2 p {
    color: var(--ht-muted) !important;
    margin: 0;
    font-size: 1rem;
}

.ht-kicker {
    color: var(--ht-primary) !important;
    font-size: .76rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    font-weight: 950;
}

.ht-page-hero-actions,
.ht-admin-actions-v2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

/* Buttons */
.ht-action-primary,
.ht-action-secondary,
.ht-table-action a,
.ht-mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    padding: 0 1rem;
    border-radius: .9rem;
    font-weight: 900;
    font-size: .88rem;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ht-action-primary {
    background: var(--ht-primary) !important;
    color: #ffffff !important;
}

.ht-action-primary:hover {
    background: var(--ht-primary-hover) !important;
    color: #ffffff !important;
}

.ht-action-secondary,
.ht-table-action a,
.ht-mini-link {
    background: var(--ht-surface-soft) !important;
    color: var(--ht-heading) !important;
    border-color: var(--ht-border) !important;
}

.ht-action-secondary:hover,
.ht-table-action a:hover,
.ht-mini-link:hover {
    border-color: var(--ht-primary) !important;
    color: var(--ht-primary) !important;
}

/* Metrics */
.ht-metrics-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.ht-metrics-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ht-metrics-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ht-metric-card-v2,
.ht-activity-badge,
.ht-admin-health-card {
    padding: 1.5rem;
    border-radius: 1.35rem;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface) !important;
    color: var(--ht-text) !important;
    box-shadow: var(--ht-shadow);
    text-decoration: none;
}

.ht-metric-card-v2 span,
.ht-activity-badge span {
    display: block;
    color: var(--ht-faint) !important;
    font-size: .76rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .18em;
}

.ht-metric-card-v2 strong,
.ht-activity-badge strong,
.ht-admin-health-card strong {
    display: block;
    margin-top: .75rem;
    color: var(--ht-heading) !important;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 950;
}

.ht-metric-card-v2 p,
.ht-activity-badge p,
.ht-admin-health-card p {
    margin: .75rem 0 0;
    color: var(--ht-muted) !important;
}

/* Panels */
.ht-panel-v2 {
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface) !important;
    color: var(--ht-text) !important;
    box-shadow: var(--ht-shadow);
}

.ht-panel-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ht-panel-head h2 {
    margin: 0;
    color: var(--ht-heading) !important;
    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 950;
}

.ht-panel-head p {
    margin: .4rem 0 0;
    color: var(--ht-muted) !important;
}

/* Filters/forms */
.ht-filter-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(12rem, .25fr) auto auto;
    gap: .8rem;
    align-items: center;
}

input,
select,
textarea,
.ht-filter-bar input,
.ht-filter-bar select {
    width: 100%;
    min-height: 2.75rem;
    border-radius: .9rem;
    border: 1px solid var(--ht-border);
    background: var(--ht-field, var(--ht-surface)) !important;
    color: var(--ht-text) !important;
    padding: 0 .9rem;
}

textarea {
    padding-top: .8rem;
}

input::placeholder,
textarea::placeholder {
    color: var(--ht-faint) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 4px var(--ht-primary-soft) !important;
    outline: none !important;
}

/* Tables */
.ht-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ht-border);
    border-radius: 1.1rem;
    background: var(--ht-surface) !important;
}

.ht-clean-table,
.ht-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ht-surface) !important;
    color: var(--ht-text) !important;
}

.ht-clean-table th,
.ht-table th {
    padding: .9rem 1rem;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-muted) !important;
    text-align: left;
    font-size: .75rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .15em;
}

.ht-clean-table td,
.ht-table td {
    padding: 1rem;
    border-top: 1px solid var(--ht-border-soft);
    color: var(--ht-text) !important;
}

.ht-clean-table td strong,
.ht-table td strong,
.ht-table-title strong {
    color: var(--ht-heading) !important;
}

.ht-table-title span,
.ht-mini-code {
    color: var(--ht-muted) !important;
}

.ht-right {
    text-align: right !important;
}

.ht-table-action {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* Chips */
.ht-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0 .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface-soft);
    color: var(--ht-heading);
}

.ht-chip.good {
    background: rgba(22, 163, 74, .12);
    color: var(--ht-success);
    border-color: rgba(22, 163, 74, .25);
}

.ht-chip.warn {
    background: rgba(217, 119, 6, .12);
    color: var(--ht-warning);
    border-color: rgba(217, 119, 6, .25);
}

.ht-chip.danger {
    background: rgba(220, 38, 38, .12);
    color: var(--ht-danger);
    border-color: rgba(220, 38, 38, .25);
}

/* Dashboard lists */
.ht-admin-main-grid,
.ht-admin-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    gap: 1.5rem;
}

.ht-mini-list,
.ht-billing-list {
    display: grid;
    gap: .75rem;
}

.ht-mini-row,
.ht-billing-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem;
    border: 1px solid var(--ht-border);
    border-radius: 1rem;
    background: var(--ht-surface-soft);
}

.ht-empty-v2 {
    padding: 2rem;
    text-align: center;
    color: var(--ht-muted);
}

.ht-empty-v2 strong {
    color: var(--ht-heading);
}

/* Theme toggle */
.ht-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    height: 2.25rem;
    padding: 0 .75rem;
    border-radius: 999px;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    font-size: .78rem;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.ht-theme-toggle-led {
    width: .68rem;
    height: .68rem;
    border-radius: 999px;
    background: var(--ht-primary);
    box-shadow: 0 0 0 4px var(--ht-primary-soft);
}

/* Generic old classes safety */
.bg-white,
.bg-gray-50,
.bg-gray-100,
.bg-slate-50,
.bg-slate-100,
.bg-slate-900,
.bg-slate-950,
.bg-gray-900,
.bg-gray-950,
.bg-black,
section,
article,
form,
table {
    background-color: var(--ht-surface) !important;
    color: var(--ht-text) !important;
}

.text-white,
.text-white\/90,
.text-white\/80,
.text-white\/70,
.text-slate-50,
.text-slate-100,
.text-slate-200,
.text-slate-300 {
    color: var(--ht-text) !important;
}

.border,
.border-t,
.border-b,
.border-l,
.border-r {
    border-color: var(--ht-border) !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .ht-main {
        margin-left: 0;
    }

    .ht-sidebar {
        transform: translateX(-100%);
    }

    .ht-metrics-grid-v2,
    .ht-metrics-3,
    .ht-metrics-4,
    .ht-admin-main-grid,
    .ht-admin-lower-grid {
        grid-template-columns: 1fr;
    }

    .ht-page-hero-v2,
    .ht-admin-hero-v2,
    .ht-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ht-filter-bar {
        grid-template-columns: 1fr;
    }
}

@media print {
    html,
    body,
    main,
    section,
    article,
    table,
    form,
    .ht-panel-v2,
    .ht-metric-card-v2 {
        background: #ffffff !important;
        color: #111827 !important;
        box-shadow: none !important;
    }

    .no-print,
    .ht-theme-toggle,
    aside,
    header,
    nav {
        display: none !important;
    }
}

/* =========================================================
   Repair pass: restore layout structure after clean theme
========================================================= */

/* Sidebar sizing */
.ht-sidebar {
    width: 17rem !important;
    padding: 1rem !important;
}

.ht-sidebar img,
.ht-sidebar-real-logo {
    max-width: 13.5rem !important;
    max-height: 4rem !important;
    object-fit: contain !important;
}

.ht-sidebar svg,
.ht-nav-link svg,
.ht-sidebar a svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem !important;
    min-height: 1.15rem !important;
    flex: 0 0 1.15rem !important;
    stroke-width: 2 !important;
}

.ht-sidebar nav {
    display: grid !important;
    gap: .35rem !important;
    margin-top: 1.25rem !important;
}

.ht-nav-link,
.ht-sidebar a {
    min-height: 2.9rem !important;
    padding: .75rem .9rem !important;
    font-size: .92rem !important;
    font-weight: 800 !important;
}

.ht-sidebar-card {
    position: absolute !important;
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1.25rem !important;
}

/* Main layout */
.ht-main {
    margin-left: 17rem !important;
    min-height: 100vh !important;
}

.ht-content {
    padding: 1.5rem !important;
    max-width: none !important;
}

/* Topbar repair */
.ht-topbar {
    min-height: 4.75rem !important;
    padding: .75rem 1.5rem !important;
}

.ht-topbar-title,
.ht-topbar > div:first-child {
    display: grid !important;
    gap: .2rem !important;
}

.ht-topbar-actions {
    margin-left: auto !important;
}

.ht-user-pill,
.ht-topbar-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: .65rem !important;
    padding: .45rem .8rem !important;
    border-radius: 999px !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-heading) !important;
}

/* Admin dashboard activity cards */
.ht-activity-badges {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}

.ht-activity-badge {
    display: block !important;
    min-height: 7.25rem !important;
    padding: 1.35rem !important;
    border-radius: 1.25rem !important;
    overflow: hidden !important;
}

.ht-activity-badge span {
    display: block !important;
    margin-bottom: .85rem !important;
}

.ht-activity-badge strong {
    display: block !important;
    font-size: 2rem !important;
}

/* Metrics grid repair */
.ht-metrics-grid-v2 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}

.ht-metrics-grid-v2.ht-metrics-3,
.ht-metrics-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.ht-metrics-grid-v2.ht-metrics-4,
.ht-metrics-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.ht-metric-card-v2 {
    min-height: 9rem !important;
}

/* Page/panel spacing */
.ht-admin-dashboard-v2,
.ht-page-v2 {
    display: grid !important;
    gap: 1.5rem !important;
}

.ht-page-hero-v2,
.ht-admin-hero-v2 {
    min-height: 12rem !important;
}

.ht-panel-v2 {
    min-height: auto !important;
}

/* Form/filter layout */
.ht-filter-bar {
    display: grid !important;
    grid-template-columns: minmax(18rem, 1fr) minmax(12rem, 14rem) auto auto !important;
    gap: .8rem !important;
    align-items: center !important;
}

.ht-filter-bar input,
.ht-filter-bar select {
    min-width: 0 !important;
}

/* Tables */
.ht-table-wrap {
    width: 100% !important;
}

.ht-clean-table,
.ht-table {
    min-width: 760px !important;
}

/* Prevent giant SVG anywhere inside content */
.ht-content svg {
    width: 1.1rem;
    height: 1.1rem;
}

/* But allow explicitly large empty-state icons only if needed */
.ht-empty-v2 svg {
    width: 2rem !important;
    height: 2rem !important;
}

/* Mobile */
@media (max-width: 1024px) {
    .ht-main {
        margin-left: 0 !important;
    }

    .ht-sidebar {
        transform: translateX(-100%);
    }

    .ht-activity-badges,
    .ht-metrics-grid-v2,
    .ht-metrics-grid-v2.ht-metrics-3,
    .ht-metrics-grid-v2.ht-metrics-4,
    .ht-metrics-3,
    .ht-metrics-4 {
        grid-template-columns: 1fr !important;
    }

    .ht-filter-bar {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   Topbar + client sidebar polish
========================================================= */

.ht-topbar {
    min-height: 4.5rem !important;
    padding: .75rem 1.35rem !important;
}

.ht-page-kicker {
    color: var(--ht-primary) !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}

.ht-page-title {
    margin: .2rem 0 0 !important;
    color: var(--ht-heading) !important;
    font-size: 1.05rem !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
}

.ht-topbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .65rem !important;
    margin-left: auto !important;
}

.ht-user-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: .65rem !important;
    min-height: 2.5rem !important;
    padding: .35rem .8rem .35rem .45rem !important;
    border-radius: 999px !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-heading) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06) !important;
}

.ht-user-avatar {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--ht-brand-gradient) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    font-size: .9rem !important;
}

.ht-user-meta {
    display: grid !important;
    gap: .05rem !important;
    line-height: 1.05 !important;
}

.ht-user-meta strong,
.ht-user-meta div {
    color: var(--ht-heading) !important;
    font-weight: 900 !important;
    font-size: .85rem !important;
}

.ht-user-meta span {
    color: var(--ht-muted) !important;
    font-size: .75rem !important;
    font-weight: 700 !important;
}

.ht-logout-form {
    margin: 0 !important;
    display: inline-flex !important;
}

.ht-logout-btn {
    min-height: 2.35rem !important;
    padding: 0 .9rem !important;
    border-radius: .85rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    font-size: .85rem !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

.ht-logout-btn:hover {
    border-color: var(--ht-danger) !important;
    color: var(--ht-danger) !important;
}

.ht-client-sidebar .ht-brand-real-logo {
    display: grid !important;
    gap: .4rem !important;
    padding: .75rem .5rem 1rem !important;
    border-bottom: 1px solid var(--ht-border) !important;
    margin-bottom: 1rem !important;
}

.ht-client-sidebar .ht-sidebar-real-logo {
    max-width: 13.5rem !important;
    max-height: 3.8rem !important;
    object-fit: contain !important;
}

.ht-client-portal-label {
    color: var(--ht-muted) !important;
    font-size: .78rem !important;
    font-weight: 900 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}

.ht-client-switcher {
    margin: 0 0 1rem !important;
    padding: .85rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-client-switcher label {
    display: block !important;
    margin-bottom: .45rem !important;
    color: var(--ht-muted) !important;
    font-size: .75rem !important;
    font-weight: 950 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}

.ht-client-switcher select {
    min-height: 2.5rem !important;
    border-radius: .85rem !important;
}

/* Avoid topbar crowding on smaller screens */
@media (max-width: 1100px) {
    .ht-user-meta {
        display: none !important;
    }

    .ht-topbar-actions {
        gap: .45rem !important;
    }
}

@media (max-width: 820px) {
    .ht-topbar {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}


/* =========================================================
   Client dashboard overflow + visual polish
========================================================= */

/* Prevent page from pushing wider than screen */
.ht-main,
.ht-content,
.ht-page-v2,
.ht-admin-dashboard-v2 {
    min-width: 0 !important;
    overflow-x: hidden !important;
}

/* Topbar: keep logout visible */
.ht-topbar {
    overflow: hidden !important;
}

.ht-topbar-actions {
    max-width: 68vw !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
}

.ht-topbar-btn,
.ht-theme-toggle,
.ht-logout-btn {
    flex-shrink: 0 !important;
}

.ht-user-chip {
    min-width: 0 !important;
    max-width: 16rem !important;
}

.ht-user-meta {
    min-width: 0 !important;
}

.ht-user-meta strong,
.ht-user-meta span {
    display: block !important;
    max-width: 11rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Client page hero should look like a real panel */
.ht-client-dashboard,
.ht-client-dashboard-v2 {
    display: grid !important;
    gap: 1.5rem !important;
}

.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child,
.ht-content > .ht-page-v2 > section:first-child {
    padding: 1.75rem !important;
    border-radius: 1.5rem !important;
    border: 1px solid var(--ht-border) !important;
    background:
        radial-gradient(circle at top right, var(--ht-primary-soft), transparent 28rem),
        var(--ht-surface) !important;
    box-shadow: var(--ht-shadow) !important;
}

/* Give plain client dashboard sections same card language */
.ht-content section {
    border-radius: 1.35rem;
}

/* Metric cards: avoid horizontal overflow */
.ht-content .ht-metrics-grid-v2,
.ht-content .ht-metrics-4,
.ht-content .ht-metrics-3 {
    width: 100% !important;
    min-width: 0 !important;
}

.ht-content .ht-metrics-grid-v2 {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)) !important;
}

.ht-content .ht-metric-card-v2 {
    min-width: 0 !important;
}

/* Client billing rows */
.ht-billing-list > div {
    min-width: 0 !important;
}

.ht-billing-list strong {
    white-space: nowrap !important;
}

/* Tighten topbar on medium screens */
@media (max-width: 1300px) {
    .ht-user-meta span {
        display: none !important;
    }

    .ht-user-chip {
        max-width: 12rem !important;
    }

    .ht-topbar-actions {
        max-width: 72vw !important;
    }
}

@media (max-width: 1150px) {
    .ht-user-meta {
        display: none !important;
    }

    .ht-user-chip {
        padding-right: .45rem !important;
    }

    .ht-topbar-actions {
        max-width: none !important;
        flex-wrap: wrap !important;
    }
}


/* =========================================================
   Recent Activity list polish
========================================================= */

.ht-activity-list {
    display: grid !important;
    gap: .75rem !important;
}

.ht-activity-item {
    display: grid !important;
    grid-template-columns: .85rem minmax(0, 1fr) !important;
    gap: .85rem !important;
    align-items: start !important;
    padding: .9rem 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-text) !important;
}

.ht-activity-item:hover {
    border-color: var(--ht-primary) !important;
    background: var(--ht-surface) !important;
}

.ht-activity-item > div:last-child {
    min-width: 0 !important;
    display: grid !important;
    gap: .2rem !important;
}

.ht-activity-item strong {
    color: var(--ht-heading) !important;
    font-weight: 950 !important;
    line-height: 1.25 !important;
}

.ht-activity-item span {
    display: block !important;
    color: var(--ht-muted) !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

.ht-activity-item small {
    color: var(--ht-faint) !important;
    font-size: .78rem !important;
    font-weight: 800 !important;
}

.ht-activity-dot {
    width: .7rem !important;
    height: .7rem !important;
    margin-top: .35rem !important;
    border-radius: 999px !important;
    background: var(--ht-primary) !important;
    box-shadow: 0 0 0 4px var(--ht-primary-soft) !important;
}

.ht-activity-dot.invoice_viewed,
.ht-activity-dot.receipt_viewed {
    background: #2563eb !important;
}

.ht-activity-dot.ticket_created,
.ht-activity-dot.ticket_reply,
.ht-activity-dot.ticket_updated {
    background: #d97706 !important;
}

.ht-activity-dot.email_logged,
.ht-activity-dot.service_renewal_email_logged {
    background: #16a34a !important;
}

.ht-activity-dot.user_email_verified {
    background: #8b5cf6 !important;
}

/* Full activity log page rows, same visual language */
.ht-activity-log-page {
    display: grid !important;
    gap: .85rem !important;
}

.ht-activity-log-row {
    display: grid !important;
    grid-template-columns: .85rem minmax(0, 1fr) !important;
    gap: .85rem !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-activity-log-title {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: .5rem !important;
}

.ht-activity-log-title strong {
    color: var(--ht-heading) !important;
    font-weight: 950 !important;
}

.ht-activity-log-main p {
    margin: .35rem 0 !important;
    color: var(--ht-muted) !important;
}

.ht-activity-log-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .5rem .9rem !important;
    color: var(--ht-faint) !important;
    font-size: .8rem !important;
    font-weight: 800 !important;
}


/* =========================================================
   Client dashboard final polish
========================================================= */

.ht-client-dashboard {
    display: grid !important;
    gap: 1.5rem !important;
    min-width: 0 !important;
}

.ht-client-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem) !important;
    align-items: center !important;
    gap: 1.5rem !important;
    padding: 1.75rem !important;
    border-radius: 1.5rem !important;
    border: 1px solid var(--ht-border) !important;
    background:
        radial-gradient(circle at top right, var(--ht-primary-soft), transparent 30rem),
        var(--ht-surface) !important;
    color: var(--ht-text) !important;
    box-shadow: var(--ht-shadow) !important;
}

.ht-client-hero-v2 h1 {
    margin: .35rem 0 .35rem !important;
    color: var(--ht-heading) !important;
    font-size: clamp(1.8rem, 2.4vw, 2.6rem) !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    letter-spacing: -.04em !important;
}

.ht-client-hero-v2 p {
    margin: 0 !important;
    color: var(--ht-muted) !important;
    font-size: 1rem !important;
}

.ht-client-actions-v2 {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: .65rem !important;
    margin-top: 1rem !important;
}

.ht-health-card {
    padding: 1.35rem !important;
    border-radius: 1.25rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-text) !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .06) !important;
}

.ht-health-card span {
    display: block !important;
    margin-bottom: .55rem !important;
    color: var(--ht-faint) !important;
    font-size: .75rem !important;
    font-weight: 950 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}

.ht-health-card strong {
    display: block !important;
    color: var(--ht-heading) !important;
    font-size: 1.65rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

.ht-health-card p {
    margin-top: .65rem !important;
    color: var(--ht-muted) !important;
    line-height: 1.4 !important;
}

.ht-client-main-grid {
    display: grid !important;
    grid-template-columns: minmax(18rem, .85fr) minmax(0, 1.5fr) !important;
    gap: 1.5rem !important;
    min-width: 0 !important;
}

.ht-client-main-grid.lower {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.ht-client-main-grid > * {
    min-width: 0 !important;
}

.ht-panel-v2.wide {
    min-width: 0 !important;
}

/* Make client dashboard metric row cleaner */
.ht-client-dashboard .ht-metrics-grid-v2 {
    grid-template-columns: repeat(4, minmax(12rem, 1fr)) !important;
    gap: 1rem !important;
}

.ht-client-dashboard .ht-metric-card-v2 {
    min-height: 8.5rem !important;
    padding: 1.35rem !important;
}

.ht-client-dashboard .ht-metric-card-v2 strong {
    font-size: 2rem !important;
}

/* Account health text should not sit loose under buttons */
.ht-client-hero-v2 + .ht-renewal-alert,
.ht-renewal-alert {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: 1rem 1.25rem !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(217, 119, 6, .25) !important;
    background: rgba(217, 119, 6, .08) !important;
}

.ht-renewal-alert strong {
    color: var(--ht-heading) !important;
}

.ht-renewal-alert span {
    color: var(--ht-muted) !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .ht-client-hero-v2 {
        grid-template-columns: 1fr !important;
    }

    .ht-client-main-grid,
    .ht-client-main-grid.lower {
        grid-template-columns: 1fr !important;
    }

    .ht-client-dashboard .ht-metrics-grid-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    .ht-client-dashboard .ht-metrics-grid-v2 {
        grid-template-columns: 1fr !important;
    }

    .ht-client-actions-v2 {
        align-items: stretch !important;
    }

    .ht-client-actions-v2 a {
        width: 100% !important;
    }
}


/* =========================================================
   Client ticket cards / support center polish
========================================================= */

.ht-ticket-list-v2 {
    display: grid !important;
    gap: .85rem !important;
}

.ht-ticket-card-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 1rem !important;
    align-items: center !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1.15rem !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-text) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045) !important;
}

.ht-ticket-card-v2:hover {
    border-color: var(--ht-primary) !important;
    background: var(--ht-surface) !important;
}

.ht-ticket-main {
    display: grid !important;
    grid-template-columns: 3.1rem minmax(0, 1fr) !important;
    gap: .9rem !important;
    align-items: start !important;
    min-width: 0 !important;
}

.ht-ticket-icon {
    width: 3.1rem !important;
    height: 3.1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 1rem !important;
    background: var(--ht-primary-soft) !important;
    color: var(--ht-primary) !important;
    font-weight: 950 !important;
    font-size: .9rem !important;
    border: 1px solid color-mix(in srgb, var(--ht-primary) 28%, transparent) !important;
}

.ht-ticket-main h3 {
    margin: 0 !important;
    color: var(--ht-heading) !important;
    font-size: 1rem !important;
    font-weight: 950 !important;
    line-height: 1.25 !important;
}

.ht-ticket-main p {
    margin: .3rem 0 0 !important;
    color: var(--ht-muted) !important;
    line-height: 1.4 !important;
    max-width: 70ch !important;
    overflow-wrap: anywhere !important;
}

.ht-ticket-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .45rem .8rem !important;
    margin-top: .55rem !important;
    color: var(--ht-faint) !important;
    font-size: .8rem !important;
    font-weight: 800 !important;
}

.ht-ticket-meta span {
    color: var(--ht-faint) !important;
}

.ht-ticket-side {
    display: grid !important;
    justify-items: end !important;
    gap: .7rem !important;
    min-width: 11rem !important;
}

.ht-ticket-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: .4rem !important;
}

.ht-ticket-open-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.35rem !important;
    padding: 0 .9rem !important;
    border-radius: .85rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    font-weight: 900 !important;
    font-size: .85rem !important;
    text-decoration: none !important;
}

.ht-ticket-open-btn:hover {
    border-color: var(--ht-primary) !important;
    color: var(--ht-primary) !important;
}

/* Ticket detail page support */
.ht-ticket-status-card {
    min-width: 16rem !important;
    padding: 1.25rem !important;
    border-radius: 1.25rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
}

.ht-ticket-status-card span {
    display: block !important;
    color: var(--ht-faint) !important;
    font-size: .75rem !important;
    font-weight: 950 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    margin-bottom: .45rem !important;
}

.ht-ticket-detail-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.6fr) minmax(18rem, .7fr) !important;
    gap: 1.5rem !important;
    align-items: start !important;
}

.ht-conversation-v2 {
    display: grid !important;
    gap: .9rem !important;
}

.ht-message-v2 {
    display: grid !important;
    grid-template-columns: 2.4rem minmax(0, 1fr) !important;
    gap: .8rem !important;
    padding: 1rem !important;
    border-radius: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
}

.ht-message-v2.staff {
    background: var(--ht-primary-soft) !important;
}

.ht-message-avatar {
    width: 2.4rem !important;
    height: 2.4rem !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--ht-primary) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
}

.ht-message-body {
    min-width: 0 !important;
}

.ht-message-head {
    display: flex !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-bottom: .45rem !important;
}

.ht-message-head strong {
    color: var(--ht-heading) !important;
    font-weight: 950 !important;
}

.ht-message-head span {
    color: var(--ht-faint) !important;
    font-size: .8rem !important;
    font-weight: 800 !important;
}

.ht-reply-box-v2 {
    margin-top: 1.25rem !important;
    padding: 1rem !important;
    border-radius: 1.15rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
}

.ht-info-list,
.ht-side-actions {
    display: grid !important;
    gap: .75rem !important;
}

.ht-info-list > div {
    display: flex !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: .85rem !important;
    border-radius: .9rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
}

.ht-info-list span {
    color: var(--ht-muted) !important;
}

.ht-info-list strong {
    color: var(--ht-heading) !important;
}

@media (max-width: 900px) {
    .ht-ticket-card-v2 {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }

    .ht-ticket-side {
        justify-items: start !important;
        min-width: 0 !important;
    }

    .ht-ticket-badges {
        justify-content: flex-start !important;
    }

    .ht-ticket-detail-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .ht-ticket-main {
        grid-template-columns: 1fr !important;
    }

    .ht-ticket-icon {
        width: auto !important;
        height: 2rem !important;
        justify-content: flex-start !important;
        padding: 0 .75rem !important;
    }
}


/* =========================================================
   Client profile information grid polish
========================================================= */

.ht-profile-info-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .85rem !important;
}

.ht-profile-info-grid > div {
    min-width: 0 !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-text) !important;
}

.ht-profile-info-grid > div.full {
    grid-column: 1 / -1 !important;
}

.ht-profile-info-grid span {
    display: block !important;
    margin-bottom: .4rem !important;
    color: var(--ht-faint) !important;
    font-size: .74rem !important;
    font-weight: 950 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase !important;
}

.ht-profile-info-grid strong {
    display: block !important;
    color: var(--ht-heading) !important;
    font-size: .98rem !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

.ht-profile-info-grid a {
    color: var(--ht-primary) !important;
    font-weight: 900 !important;
}

/* Make the profile billing actions breathe better */
.ht-side-actions {
    margin-top: 1rem !important;
    display: grid !important;
    gap: .7rem !important;
}

.ht-side-actions .ht-action-primary,
.ht-side-actions .ht-action-secondary {
    width: 100% !important;
}

/* Profile page layout */
.ht-page-v2 .ht-client-main-grid {
    align-items: stretch !important;
}

.ht-page-v2 .ht-client-main-grid > .ht-panel-v2,
.ht-page-v2 .ht-client-main-grid > aside.ht-panel-v2 {
    min-height: 100% !important;
}

@media (max-width: 760px) {
    .ht-profile-info-grid {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   Admin Services filter reset layout fix
========================================================= */

.ht-services-filter-bar {
    display: grid !important;
    grid-template-columns:
        minmax(20rem, 1fr)
        minmax(11rem, 14rem)
        minmax(10rem, 13rem)
        auto
        auto !important;
    gap: .8rem !important;
    align-items: center !important;
}

.ht-services-filter-bar input,
.ht-services-filter-bar select {
    min-width: 0 !important;
}

.ht-services-filter-bar .ht-action-primary,
.ht-services-filter-bar .ht-action-secondary {
    width: auto !important;
    min-width: 5.75rem !important;
    min-height: 2.75rem !important;
    padding-inline: 1rem !important;
    white-space: nowrap !important;
}

.ht-services-filter-bar .ht-action-secondary {
    justify-self: start !important;
}

@media (max-width: 1150px) {
    .ht-services-filter-bar {
        grid-template-columns: 1fr 1fr !important;
    }

    .ht-services-filter-bar input {
        grid-column: 1 / -1 !important;
    }

    .ht-services-filter-bar .ht-action-primary,
    .ht-services-filter-bar .ht-action-secondary {
        width: 100% !important;
        justify-self: stretch !important;
    }
}

@media (max-width: 720px) {
    .ht-services-filter-bar {
        grid-template-columns: 1fr !important;
    }

    .ht-services-filter-bar input {
        grid-column: auto !important;
    }
}


/* =========================================================
   Admin service create/edit form polish
========================================================= */

.ht-form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}

.ht-form-grid > div {
    min-width: 0 !important;
    display: grid !important;
    gap: .45rem !important;
}

.ht-form-grid > div.full,
.ht-form-field.full {
    grid-column: 1 / -1 !important;
}

.ht-form-grid label,
.ht-form-field label {
    color: var(--ht-muted) !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}

.ht-form-grid input,
.ht-form-grid select,
.ht-form-grid textarea,
.ht-form-field input,
.ht-form-field select,
.ht-form-field textarea {
    width: 100% !important;
    min-height: 2.9rem !important;
    border-radius: .95rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-text) !important;
    padding: .75rem .95rem !important;
    font-size: .95rem !important;
    line-height: 1.35 !important;
}

.ht-form-grid textarea,
.ht-form-field textarea {
    min-height: 7.5rem !important;
    resize: vertical !important;
}

.ht-form-grid input:focus,
.ht-form-grid select:focus,
.ht-form-grid textarea:focus,
.ht-form-field input:focus,
.ht-form-field select:focus,
.ht-form-field textarea:focus {
    background: var(--ht-surface) !important;
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 4px var(--ht-primary-soft) !important;
    outline: none !important;
}

.ht-form-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .75rem !important;
    margin-top: 1.25rem !important;
    padding-top: 1.25rem !important;
    border-top: 1px solid var(--ht-border) !important;
}

.ht-form-actions .ht-action-primary,
.ht-form-actions .ht-action-secondary,
.ht-form-actions button,
.ht-form-actions a {
    width: auto !important;
    min-width: 8rem !important;
}

/* Service form page: make the panel feel intentional */
.ht-page-hero-v2.services + .ht-panel-v2 form {
    display: block !important;
}

.ht-page-hero-v2.services + .ht-panel-v2 {
    padding: 1.5rem !important;
}

/* Service hero inline email renewal form */
.ht-page-hero-actions form {
    margin: 0 !important;
    display: inline-flex !important;
}

.ht-page-hero-actions form button.ht-action-primary {
    min-height: 2.55rem !important;
    padding: 0 1rem !important;
    border-radius: .9rem !important;
}

/* Error helper */
.ht-form-error {
    color: var(--ht-danger) !important;
    font-size: .82rem !important;
    font-weight: 800 !important;
}

/* Date/number inputs visual consistency */
.ht-form-grid input[type="date"],
.ht-form-grid input[type="number"] {
    font-variant-numeric: tabular-nums !important;
}

/* Mobile service forms */
@media (max-width: 820px) {
    .ht-form-grid {
        grid-template-columns: 1fr !important;
    }

    .ht-form-grid > div.full,
    .ht-form-field.full {
        grid-column: auto !important;
    }

    .ht-form-actions {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .ht-form-actions .ht-action-primary,
    .ht-form-actions .ht-action-secondary,
    .ht-form-actions button,
    .ht-form-actions a {
        width: 100% !important;
    }
}


/* =========================================================
   Admin invoice create/edit line item builder polish
========================================================= */

.ht-line-items-builder {
    display: grid !important;
    gap: 1rem !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1.2rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-line-items-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
}

.ht-line-items-head h3 {
    margin: 0 !important;
    color: var(--ht-heading) !important;
    font-size: 1.05rem !important;
    font-weight: 950 !important;
}

.ht-line-items-head p {
    margin: .25rem 0 0 !important;
    color: var(--ht-muted) !important;
}

.ht-line-items-head #addLineItemBtn {
    min-height: 2.35rem !important;
    padding: 0 .95rem !important;
    white-space: nowrap !important;
}

.ht-line-items-table {
    display: grid !important;
    gap: .55rem !important;
    overflow-x: auto !important;
    padding-bottom: .25rem !important;
}

.ht-line-items-grid {
    display: grid !important;
    grid-template-columns:
        minmax(15rem, 1.5fr)
        minmax(12rem, 1fr)
        minmax(5rem, .35fr)
        minmax(7rem, .45fr)
        minmax(7rem, .45fr)
        2.4rem !important;
    gap: .55rem !important;
    align-items: center !important;
    min-width: 780px !important;
}

.ht-line-items-labels {
    padding: .75rem .85rem !important;
    border-radius: .9rem !important;
    background: var(--ht-surface) !important;
    border: 1px solid var(--ht-border) !important;
}

.ht-line-items-labels span {
    color: var(--ht-faint) !important;
    font-size: .72rem !important;
    font-weight: 950 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase !important;
}

.ht-line-item-row {
    padding: .65rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: .95rem !important;
    background: var(--ht-surface) !important;
}

.ht-line-item-row input {
    min-height: 2.45rem !important;
    border-radius: .75rem !important;
    background: var(--ht-surface-soft) !important;
    border-color: var(--ht-border) !important;
    padding: .55rem .7rem !important;
}

.ht-line-item-row input:focus {
    background: var(--ht-surface) !important;
}

.ht-line-total {
    min-height: 2.45rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 .7rem !important;
    border-radius: .75rem !important;
    background: var(--ht-surface-soft) !important;
    color: var(--ht-heading) !important;
    font-weight: 950 !important;
    font-variant-numeric: tabular-nums !important;
}

.ht-line-remove {
    width: 2.35rem !important;
    height: 2.35rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: .75rem !important;
    border: 1px solid rgba(220, 38, 38, .25) !important;
    background: rgba(220, 38, 38, .08) !important;
    color: var(--ht-danger) !important;
    font-size: 1.15rem !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

.ht-line-remove:hover {
    background: rgba(220, 38, 38, .14) !important;
}

/* Invoice totals */
.ht-invoice-total-box {
    display: grid !important;
    gap: .7rem !important;
    margin-top: .5rem !important;
    margin-left: auto !important;
    max-width: 28rem !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1.1rem !important;
    background: var(--ht-surface) !important;
}

.ht-invoice-total-box > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, auto) !important;
    gap: .8rem !important;
    align-items: center !important;
}

.ht-invoice-total-box span,
.ht-invoice-total-box label {
    color: var(--ht-muted) !important;
    font-weight: 900 !important;
}

.ht-invoice-total-box strong {
    color: var(--ht-heading) !important;
    text-align: right !important;
    font-weight: 950 !important;
    font-variant-numeric: tabular-nums !important;
}

.ht-invoice-total-box input {
    min-height: 2.35rem !important;
    border-radius: .75rem !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
}

.ht-invoice-total-box .grand {
    margin-top: .35rem !important;
    padding-top: .75rem !important;
    border-top: 1px solid var(--ht-border) !important;
}

.ht-invoice-total-box .grand span,
.ht-invoice-total-box .grand strong {
    color: var(--ht-heading) !important;
    font-size: 1.05rem !important;
}

/* Notes field on invoice forms */
.ht-page-hero-v2.admin-invoices + .ht-panel-v2 textarea#notes {
    min-height: 8rem !important;
}

/* Make invoice form breathe */
.ht-page-hero-v2.admin-invoices + .ht-panel-v2 {
    padding: 1.5rem !important;
}

/* Invoice create/edit responsive behavior */
@media (max-width: 980px) {
    .ht-line-items-grid {
        min-width: 720px !important;
    }

    .ht-line-items-head {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .ht-line-items-head #addLineItemBtn {
        width: 100% !important;
    }

    .ht-invoice-total-box {
        max-width: none !important;
        margin-left: 0 !important;
    }
}


/* =========================================================
   Guest / Auth / Login page restore
========================================================= */

.ht-auth-page {
    min-height: 100vh !important;
    display: grid !important;
    place-items: center !important;
    padding: 2rem !important;
    background:
        radial-gradient(circle at top left, rgba(34, 195, 178, .18), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, .12), transparent 28rem),
        var(--ht-bg, #f5f9fc) !important;
    color: var(--ht-text, #172033) !important;
}

.ht-auth-shell {
    width: min(1120px, 100%) !important;
    min-height: 680px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr) !important;
    overflow: hidden !important;
    border: 1px solid var(--ht-border, #dce6ef) !important;
    border-radius: 2rem !important;
    background: var(--ht-surface, #ffffff) !important;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .14) !important;
}

.ht-auth-left {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 2rem !important;
    padding: 3rem !important;
    background:
        var(--ht-brand-gradient-soft),
        var(--ht-surface-soft, #f8fafc) !important;
    color: var(--ht-text, #172033) !important;
    border-right: 1px solid var(--ht-border, #dce6ef) !important;
}

.ht-auth-logo {
    width: min(360px, 100%) !important;
    height: auto !important;
    object-fit: contain !important;
}

.ht-auth-copy {
    max-width: 34rem !important;
}

.ht-auth-kicker {
    color: var(--ht-primary, var(--ht-primary)) !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    letter-spacing: .18em !important;
    text-transform: uppercase !important;
    margin-bottom: .85rem !important;
}

.ht-auth-copy h1 {
    margin: 0 !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: clamp(2.2rem, 4vw, 4rem) !important;
    line-height: .98 !important;
    letter-spacing: -.055em !important;
    font-weight: 950 !important;
}

.ht-auth-copy p {
    margin: 1rem 0 0 !important;
    color: var(--ht-muted, #516173) !important;
    font-size: 1.05rem !important;
    line-height: 1.55 !important;
}

.ht-auth-features {
    display: grid !important;
    gap: .85rem !important;
    margin-top: 2rem !important;
}

.ht-auth-features > div {
    display: flex !important;
    align-items: flex-start !important;
    gap: .8rem !important;
    padding: .9rem 1rem !important;
    border: 1px solid var(--ht-border, #dce6ef) !important;
    border-radius: 1rem !important;
    background: rgba(255, 255, 255, .58) !important;
    color: var(--ht-text, #172033) !important;
}

html.dark .ht-auth-features > div {
    background: rgba(255, 255, 255, .04) !important;
}

.ht-auth-features strong {
    display: block !important;
    color: var(--ht-heading, #07111f) !important;
    font-weight: 950 !important;
}

.ht-auth-features span,
.ht-auth-features p {
    color: var(--ht-muted, #516173) !important;
}

.ht-auth-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: .5rem !important;
    width: fit-content !important;
    padding: .6rem .85rem !important;
    border-radius: 999px !important;
    border: 1px solid rgba(22, 163, 74, .25) !important;
    background: rgba(22, 163, 74, .1) !important;
    color: var(--ht-success, #16a34a) !important;
    font-weight: 900 !important;
}

.ht-auth-right {
    display: grid !important;
    place-items: center !important;
    padding: 3rem !important;
    background: var(--ht-surface, #ffffff) !important;
}

.ht-auth-card {
    width: min(430px, 100%) !important;
    padding: 2rem !important;
    border: 1px solid var(--ht-border, #dce6ef) !important;
    border-radius: 1.5rem !important;
    background: var(--ht-surface, #ffffff) !important;
    box-shadow: var(--ht-shadow, 0 14px 40px rgba(15, 23, 42, .07)) !important;
}

.ht-auth-card-logo {
    margin-bottom: 1.5rem !important;
}

.ht-auth-card-logo img {
    width: 220px !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

.ht-auth-card-head {
    margin-bottom: 1.4rem !important;
}

.ht-auth-card-head span {
    display: block !important;
    margin-bottom: .35rem !important;
    color: var(--ht-primary, var(--ht-primary)) !important;
    font-size: .76rem !important;
    font-weight: 950 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}

.ht-auth-card-head h2 {
    margin: 0 !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: 2rem !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    letter-spacing: -.035em !important;
}

.ht-auth-card-head p {
    margin: .55rem 0 0 !important;
    color: var(--ht-muted, #516173) !important;
}

.ht-auth-alert {
    margin-bottom: 1rem !important;
    padding: .85rem 1rem !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(220, 38, 38, .22) !important;
    background: rgba(220, 38, 38, .08) !important;
    color: var(--ht-danger, #dc2626) !important;
    font-weight: 800 !important;
}

.ht-auth-form {
    display: grid !important;
    gap: 1rem !important;
}

.ht-auth-field {
    display: grid !important;
    gap: .45rem !important;
}

.ht-auth-field label {
    color: var(--ht-muted, #516173) !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}

.ht-auth-field input {
    width: 100% !important;
    min-height: 3rem !important;
    border: 1px solid var(--ht-border, #dce6ef) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft, #f8fafc) !important;
    color: var(--ht-text, #172033) !important;
    padding: .75rem 1rem !important;
    font-size: .98rem !important;
}

.ht-auth-field input::placeholder {
    color: var(--ht-faint, #8fa0b5) !important;
}

.ht-auth-field input:focus {
    background: var(--ht-surface, #ffffff) !important;
    border-color: var(--ht-primary, var(--ht-primary)) !important;
    box-shadow: 0 0 0 4px var(--ht-primary-soft, rgba(22, 184, 166, .14)) !important;
    outline: none !important;
}

.ht-auth-error {
    color: var(--ht-danger, #dc2626) !important;
    font-size: .8rem !important;
    font-weight: 800 !important;
}

.ht-auth-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-top: .1rem !important;
}

.ht-auth-row label {
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    color: var(--ht-muted, #516173) !important;
    font-weight: 800 !important;
    font-size: .9rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.ht-auth-row input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    accent-color: var(--ht-primary, var(--ht-primary)) !important;
}

.ht-auth-row a {
    color: var(--ht-primary, var(--ht-primary)) !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

.ht-auth-row a:hover {
    text-decoration: underline !important;
}

.ht-auth-submit {
    width: 100% !important;
    min-height: 3rem !important;
    border: 0 !important;
    border-radius: 1rem !important;
    background: var(--ht-primary, var(--ht-primary)) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    cursor: pointer !important;
    box-shadow: 0 12px 28px rgba(22, 184, 166, .24) !important;
}

.ht-auth-submit:hover {
    background: var(--ht-primary-hover, #0f9f90) !important;
}

.ht-auth-note {
    margin-top: 1.25rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid var(--ht-border, #dce6ef) !important;
    color: var(--ht-muted, #516173) !important;
    font-size: .86rem !important;
    line-height: 1.5 !important;
}

/* Breeze fallback auth pages using x-guest-layout */
body > form,
body > div > form {
    max-width: 430px;
    margin: 3rem auto;
}

/* Responsive login */
@media (max-width: 980px) {
    .ht-auth-page {
        padding: 1rem !important;
    }

    .ht-auth-shell {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }

    .ht-auth-left {
        padding: 2rem !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--ht-border, #dce6ef) !important;
    }

    .ht-auth-right {
        padding: 2rem !important;
    }

    .ht-auth-copy h1 {
        font-size: 2.4rem !important;
    }
}

@media (max-width: 560px) {
    .ht-auth-left,
    .ht-auth-right,
    .ht-auth-card {
        padding: 1.25rem !important;
    }

    .ht-auth-row {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .ht-auth-logo,
    .ht-auth-card-logo img {
        width: 220px !important;
    }
}


/* =========================================================
   Mobile portal responsive repair
   Keeps desktop unchanged.
========================================================= */

.ht-mobile-menu-btn,
.ht-mobile-sidebar-overlay {
    display: none;
}

/* Tablet / mobile shell */
@media (max-width: 1024px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.ht-body {
        min-width: 0 !important;
        background: var(--ht-bg) !important;
    }

    .ht-shell {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .ht-main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
    }

    .ht-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 1rem !important;
        overflow-x: hidden !important;
    }

    .ht-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 80 !important;
        width: min(18rem, 86vw) !important;
        max-width: 86vw !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        box-shadow: 20px 0 60px rgba(15, 23, 42, .22) !important;
        padding: 1rem !important;
    }

    body.ht-mobile-sidebar-open .ht-sidebar {
        transform: translateX(0) !important;
    }

    .ht-mobile-sidebar-overlay {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 70 !important;
        background: rgba(15, 23, 42, .42) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity .18s ease !important;
    }

    body.ht-mobile-sidebar-open .ht-mobile-sidebar-overlay {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .ht-mobile-menu-btn {
        display: inline-flex !important;
        position: fixed !important;
        left: .85rem !important;
        bottom: .85rem !important;
        z-index: 90 !important;
        width: 3rem !important;
        height: 3rem !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 999px !important;
        border: 1px solid var(--ht-border) !important;
        background: var(--ht-surface) !important;
        box-shadow: 0 16px 40px rgba(15, 23, 42, .18) !important;
        cursor: pointer !important;
    }

    .ht-mobile-menu-btn__icon {
        width: 1.25rem !important;
        display: grid !important;
        gap: .25rem !important;
    }

    .ht-menu-line {
        display: block !important;
        height: 2px !important;
        border-radius: 999px !important;
        background: var(--ht-heading) !important;
    }

    body.ht-mobile-sidebar-open .ht-menu-line-1 {
        transform: translateY(6px) rotate(45deg) !important;
    }

    body.ht-mobile-sidebar-open .ht-menu-line-2 {
        opacity: 0 !important;
    }

    body.ht-mobile-sidebar-open .ht-menu-line-3 {
        transform: translateY(-6px) rotate(-45deg) !important;
    }

    .ht-topbar {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 1rem !important;
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: .85rem !important;
        overflow: visible !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: .55rem !important;
    }

    .ht-topbar-btn,
    .ht-theme-toggle,
    .ht-logout-btn {
        min-height: 2.35rem !important;
        padding-inline: .8rem !important;
        font-size: .82rem !important;
    }

    .ht-user-chip {
        max-width: none !important;
    }

    .ht-user-meta {
        display: none !important;
    }

    .ht-page-v2,
    .ht-admin-dashboard-v2,
    .ht-client-dashboard {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 1rem !important;
    }

    .ht-page-hero-v2,
    .ht-admin-hero-v2,
    .ht-client-hero-v2 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 1.25rem !important;
        border-radius: 1.25rem !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .ht-page-hero-v2 h1,
    .ht-admin-hero-v2 h1,
    .ht-client-hero-v2 h1 {
        font-size: clamp(2rem, 10vw, 2.75rem) !important;
        line-height: .98 !important;
        overflow-wrap: anywhere !important;
    }

    .ht-page-hero-actions,
    .ht-admin-actions-v2,
    .ht-client-actions-v2 {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
    }

    .ht-page-hero-actions a,
    .ht-page-hero-actions button,
    .ht-page-hero-actions form,
    .ht-admin-actions-v2 a,
    .ht-client-actions-v2 a {
        width: 100% !important;
        justify-content: center !important;
    }

    .ht-metrics-grid-v2,
    .ht-metrics-grid-v2.ht-metrics-3,
    .ht-metrics-grid-v2.ht-metrics-4,
    .ht-metrics-3,
    .ht-metrics-4,
    .ht-activity-badges,
    .ht-client-dashboard .ht-metrics-grid-v2 {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .ht-metric-card-v2,
    .ht-activity-badge,
    .ht-panel-v2,
    .ht-card,
    .ht-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        border-radius: 1.15rem !important;
    }

    .ht-panel-v2 {
        padding: 1rem !important;
    }

    .ht-panel-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .75rem !important;
    }

    .ht-filter-bar,
    .ht-services-filter-bar {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .ht-filter-bar input,
    .ht-filter-bar select,
    .ht-filter-bar button,
    .ht-filter-bar a,
    .ht-services-filter-bar input,
    .ht-services-filter-bar select,
    .ht-services-filter-bar button,
    .ht-services-filter-bar a {
        width: 100% !important;
        justify-self: stretch !important;
    }

    .ht-admin-main-grid,
    .ht-admin-lower-grid,
    .ht-client-main-grid,
    .ht-client-main-grid.lower,
    .ht-ticket-detail-grid,
    .ht-invoice-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .ht-table-wrap,
    .ht-line-items-table {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ht-clean-table,
    .ht-table {
        min-width: 720px !important;
    }

    .ht-form-grid,
    .ht-profile-info-grid {
        grid-template-columns: 1fr !important;
    }

    .ht-form-grid > div.full,
    .ht-form-field.full,
    .ht-profile-info-grid > div.full {
        grid-column: auto !important;
    }

    .ht-form-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .ht-form-actions button,
    .ht-form-actions a {
        width: 100% !important;
    }

    .ht-sidebar-card {
        position: static !important;
        margin: 1rem 0 0 !important;
    }
}

/* Narrow phone */
@media (max-width: 560px) {
    .ht-content {
        padding: .85rem !important;
    }

    .ht-topbar {
        padding: .85rem !important;
    }

    .ht-page-hero-v2,
    .ht-admin-hero-v2,
    .ht-client-hero-v2,
    .ht-panel-v2 {
        border-radius: 1rem !important;
    }

    .ht-page-hero-v2 h1,
    .ht-admin-hero-v2 h1,
    .ht-client-hero-v2 h1 {
        font-size: 2rem !important;
    }

    .ht-metric-card-v2 strong,
    .ht-activity-badge strong {
        font-size: 1.85rem !important;
    }

    .ht-user-chip {
        padding-right: .45rem !important;
    }

    .ht-sidebar-real-logo {
        max-width: 11rem !important;
    }
}

/* Desktop should remain normal */
@media (min-width: 1025px) {
    .ht-main {
        margin-left: 17rem !important;
    }

    .ht-sidebar {
        transform: none !important;
    }
}


/* =========================================================
   Mobile topbar/header polish
========================================================= */

@media (max-width: 1024px) {
    .ht-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: .65rem !important;
        padding: .85rem 1rem !important;
        border-bottom: 1px solid var(--ht-border) !important;
        background: var(--ht-surface) !important;
    }

    .ht-topbar > div:first-child {
        min-width: 0 !important;
        display: grid !important;
        gap: .15rem !important;
    }

    .ht-page-kicker {
        font-size: .72rem !important;
        letter-spacing: .16em !important;
        line-height: 1 !important;
    }

    .ht-page-title {
        font-size: 1rem !important;
        line-height: 1.15 !important;
        margin: 0 !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: .45rem !important;
    }

    .ht-topbar-btn,
    .ht-theme-toggle,
    .ht-logout-btn {
        min-height: 2.15rem !important;
        height: 2.15rem !important;
        padding: 0 .72rem !important;
        border-radius: .8rem !important;
        font-size: .8rem !important;
        line-height: 1 !important;
    }

    .ht-user-chip {
        min-height: 2.15rem !important;
        height: 2.15rem !important;
        padding: .2rem !important;
        border-radius: 999px !important;
    }

    .ht-user-avatar {
        width: 1.85rem !important;
        height: 1.85rem !important;
        min-width: 1.85rem !important;
        font-size: .82rem !important;
    }

    .ht-user-meta {
        display: none !important;
    }

    .ht-theme-toggle {
        gap: .35rem !important;
    }

    .ht-theme-toggle-led {
        width: .58rem !important;
        height: .58rem !important;
    }

    .ht-logout-form {
        display: inline-flex !important;
        margin: 0 !important;
    }

    .ht-content {
        padding-top: 1rem !important;
    }
}

/* Extra compact phone header */
@media (max-width: 560px) {
    .ht-topbar {
        padding: .75rem .85rem !important;
        gap: .55rem !important;
    }

    .ht-topbar-actions {
        gap: .38rem !important;
    }

    .ht-topbar-btn,
    .ht-theme-toggle,
    .ht-logout-btn {
        min-height: 2.05rem !important;
        height: 2.05rem !important;
        padding: 0 .62rem !important;
        font-size: .76rem !important;
    }

    .ht-theme-toggle [data-theme-toggle-label] {
        display: inline !important;
    }

    .ht-page-title {
        font-size: .98rem !important;
    }
}

/* Very narrow screens: keep header from feeling broken */
@media (max-width: 420px) {
    .ht-theme-toggle [data-theme-toggle-label] {
        display: none !important;
    }

    .ht-topbar-btn,
    .ht-logout-btn {
        padding-inline: .58rem !important;
    }
}


/* =========================================================
   Better mobile dashboard UI
========================================================= */

@media (max-width: 640px) {
    body.ht-body {
        background: var(--ht-bg) !important;
    }

    .ht-main {
        background: var(--ht-bg) !important;
    }

    .ht-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        padding: .8rem .9rem !important;
        background: var(--ht-surface) !important;
        border-bottom: 1px solid var(--ht-border) !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .08) !important;
    }

    .ht-page-kicker {
        font-size: .68rem !important;
        letter-spacing: .15em !important;
    }

    .ht-page-title {
        font-size: .98rem !important;
        font-weight: 950 !important;
    }

    .ht-topbar-actions {
        display: grid !important;
        grid-template-columns: 1fr auto auto auto !important;
        align-items: center !important;
        gap: .4rem !important;
    }

    .ht-topbar-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .ht-user-chip {
        width: 2.1rem !important;
        min-width: 2.1rem !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    .ht-user-avatar {
        width: 1.85rem !important;
        height: 1.85rem !important;
        min-width: 1.85rem !important;
    }

    .ht-theme-toggle {
        width: 2.45rem !important;
        min-width: 2.45rem !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    .ht-theme-toggle [data-theme-toggle-label],
    .ht-theme-toggle [data-theme-toggle-icon] {
        display: none !important;
    }

    .ht-logout-btn {
        min-width: 4.4rem !important;
        padding-inline: .65rem !important;
    }

    .ht-content {
        padding: .85rem !important;
    }

    .ht-admin-hero-v2,
    .ht-page-hero-v2,
    .ht-client-hero-v2 {
        padding: 1.1rem !important;
        border-radius: 1.15rem !important;
        gap: .95rem !important;
    }

    .ht-admin-hero-v2 h1,
    .ht-page-hero-v2 h1,
    .ht-client-hero-v2 h1 {
        font-size: 1.85rem !important;
        line-height: 1.02 !important;
        letter-spacing: -.045em !important;
    }

    .ht-admin-hero-v2 p,
    .ht-page-hero-v2 p,
    .ht-client-hero-v2 p {
        font-size: .95rem !important;
        line-height: 1.45 !important;
    }

    .ht-kicker {
        font-size: .68rem !important;
        letter-spacing: .18em !important;
    }

    .ht-page-hero-actions,
    .ht-admin-actions-v2,
    .ht-client-actions-v2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: .55rem !important;
    }

    .ht-page-hero-actions a,
    .ht-page-hero-actions button,
    .ht-page-hero-actions form,
    .ht-admin-actions-v2 a,
    .ht-client-actions-v2 a {
        width: 100% !important;
        min-height: 2.55rem !important;
        padding-inline: .55rem !important;
        font-size: .82rem !important;
        border-radius: .85rem !important;
    }

    .ht-page-hero-actions a:first-child,
    .ht-admin-actions-v2 a:first-child,
    .ht-client-actions-v2 a:first-child {
        grid-column: 1 / -1 !important;
    }

    .ht-admin-health-card,
    .ht-health-card {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    .ht-admin-health-card strong,
    .ht-health-card strong {
        font-size: 1.6rem !important;
    }

    .ht-metric-card-v2,
    .ht-activity-badge {
        padding: 1rem !important;
        min-height: auto !important;
    }

    .ht-metric-card-v2 strong,
    .ht-activity-badge strong {
        font-size: 1.75rem !important;
        margin-top: .55rem !important;
    }

    .ht-panel-v2 {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    .ht-mobile-menu-btn {
        left: .8rem !important;
        bottom: .8rem !important;
        width: 2.8rem !important;
        height: 2.8rem !important;
    }
}

@media (max-width: 390px) {
    .ht-topbar-actions {
        grid-template-columns: 1fr auto auto !important;
    }

    .ht-logout-form {
        grid-column: 1 / -1 !important;
    }

    .ht-logout-btn {
        width: 100% !important;
    }

    .ht-page-hero-actions,
    .ht-admin-actions-v2,
    .ht-client-actions-v2 {
        grid-template-columns: 1fr !important;
    }

    .ht-page-hero-actions a:first-child,
    .ht-admin-actions-v2 a:first-child,
    .ht-client-actions-v2 a:first-child {
        grid-column: auto !important;
    }
}


/* =========================================================
   Correct mobile header action row
   Fixes wide Admin/Client button + full-width Logout.
========================================================= */

@media (max-width: 640px) {
    .ht-topbar {
        padding: .85rem .9rem !important;
        gap: .7rem !important;
    }

    .ht-topbar > div:first-child {
        width: 100% !important;
    }

    .ht-page-kicker {
        font-size: .68rem !important;
        letter-spacing: .16em !important;
    }

    .ht-page-title {
        font-size: 1rem !important;
        line-height: 1.15 !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .42rem !important;
    }

    .ht-topbar-btn {
        width: auto !important;
        min-width: 6.8rem !important;
        max-width: none !important;
        height: 2.15rem !important;
        min-height: 2.15rem !important;
        padding: 0 .72rem !important;
        justify-content: center !important;
        white-space: nowrap !important;
        font-size: .78rem !important;
        border-radius: .8rem !important;
    }

    .ht-user-chip {
        width: 2.15rem !important;
        min-width: 2.15rem !important;
        height: 2.15rem !important;
        min-height: 2.15rem !important;
        padding: 0 !important;
        justify-content: center !important;
        flex: 0 0 2.15rem !important;
    }

    .ht-user-avatar {
        width: 1.85rem !important;
        height: 1.85rem !important;
        min-width: 1.85rem !important;
    }

    .ht-theme-toggle {
        width: 2.3rem !important;
        min-width: 2.3rem !important;
        height: 2.15rem !important;
        min-height: 2.15rem !important;
        padding: 0 !important;
        justify-content: center !important;
        flex: 0 0 2.3rem !important;
    }

    .ht-theme-toggle [data-theme-toggle-label],
    .ht-theme-toggle [data-theme-toggle-icon] {
        display: none !important;
    }

    .ht-logout-form {
        width: auto !important;
        margin: 0 !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
    }

    .ht-logout-btn {
        width: auto !important;
        min-width: 4.75rem !important;
        height: 2.15rem !important;
        min-height: 2.15rem !important;
        padding: 0 .68rem !important;
        white-space: nowrap !important;
        font-size: .78rem !important;
        border-radius: .8rem !important;
    }
}

/* On very narrow screens, let buttons wrap cleanly instead of stretching ugly */
@media (max-width: 380px) {
    .ht-topbar-actions {
        flex-wrap: wrap !important;
    }

    .ht-topbar-btn {
        flex: 1 1 auto !important;
    }

    .ht-logout-form {
        flex: 1 1 auto !important;
    }

    .ht-logout-btn {
        width: 100% !important;
    }
}


/* =========================================================
   Mobile header: show user + color mode cleanly
   Admin/Client switch remains temporary but de-emphasized.
========================================================= */

@media (max-width: 640px) {
    .ht-topbar {
        padding: .85rem .95rem !important;
        gap: .75rem !important;
    }

    .ht-topbar > div:first-child {
        width: 100% !important;
    }

    .ht-page-kicker {
        font-size: .68rem !important;
        letter-spacing: .16em !important;
        line-height: 1 !important;
    }

    .ht-page-title {
        font-size: 1rem !important;
        line-height: 1.15 !important;
        font-weight: 950 !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-template-areas:
            "switch user logout"
            "theme theme theme" !important;
        gap: .5rem !important;
        align-items: center !important;
    }

    /* Temporary Admin/Client view button */
    .ht-topbar-btn {
        grid-area: switch !important;
        width: auto !important;
        min-width: auto !important;
        height: 2.2rem !important;
        min-height: 2.2rem !important;
        padding: 0 .7rem !important;
        border-radius: .8rem !important;
        font-size: .76rem !important;
        white-space: nowrap !important;
    }

    /* User should be visible on mobile */
    .ht-user-chip {
        grid-area: user !important;
        width: 100% !important;
        max-width: none !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        padding: .25rem .65rem .25rem .28rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .5rem !important;
        border-radius: 999px !important;
        min-width: 0 !important;
    }

    .ht-user-avatar {
        width: 1.95rem !important;
        height: 1.95rem !important;
        min-width: 1.95rem !important;
        font-size: .82rem !important;
    }

    .ht-user-meta {
        display: grid !important;
        min-width: 0 !important;
        gap: .05rem !important;
    }

    .ht-user-meta strong,
    .ht-user-meta div {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--ht-heading) !important;
        font-size: .78rem !important;
        font-weight: 950 !important;
        line-height: 1.05 !important;
    }

    .ht-user-meta span {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--ht-muted) !important;
        font-size: .68rem !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
    }

    /* Theme toggle should clearly show Light/Dark */
    .ht-theme-toggle {
        grid-area: theme !important;
        width: 100% !important;
        height: 2.25rem !important;
        min-height: 2.25rem !important;
        padding: 0 .75rem !important;
        justify-content: center !important;
        gap: .45rem !important;
        border-radius: .85rem !important;
    }

    .ht-theme-toggle [data-theme-toggle-label],
    .ht-theme-toggle [data-theme-toggle-icon] {
        display: inline !important;
    }

    .ht-theme-toggle-led {
        width: .62rem !important;
        height: .62rem !important;
    }

    .ht-logout-form {
        grid-area: logout !important;
        width: auto !important;
        margin: 0 !important;
        display: inline-flex !important;
    }

    .ht-logout-btn {
        width: auto !important;
        min-width: 4.7rem !important;
        height: 2.2rem !important;
        min-height: 2.2rem !important;
        padding: 0 .7rem !important;
        border-radius: .8rem !important;
        font-size: .76rem !important;
        white-space: nowrap !important;
    }
}

/* Very narrow phone: keep it readable, not crushed */
@media (max-width: 390px) {
    .ht-topbar-actions {
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "user logout"
            "switch switch"
            "theme theme" !important;
    }

    .ht-topbar-btn,
    .ht-theme-toggle {
        width: 100% !important;
    }
}


/* =========================================================
   Professional mobile topbar wording/layout
========================================================= */

@media (max-width: 640px) {
    .ht-topbar {
        padding: .85rem .95rem !important;
        gap: .65rem !important;
    }

    .ht-page-kicker {
        color: var(--ht-primary) !important;
        font-size: .7rem !important;
        font-weight: 950 !important;
        letter-spacing: .16em !important;
        text-transform: uppercase !important;
    }

    .ht-page-title {
        color: var(--ht-heading) !important;
        font-size: 1.08rem !important;
        font-weight: 950 !important;
        line-height: 1.12 !important;
    }

    /*
      The Admin View / Client View switch is temporary.
      Hide it on mobile so the header feels professional.
    */
    .ht-topbar-actions > .ht-topbar-btn {
        display: none !important;
    }

    .ht-topbar-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "user logout"
            "theme theme" !important;
        gap: .5rem !important;
        align-items: center !important;
    }

    .ht-user-chip {
        grid-area: user !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .ht-logout-form {
        grid-area: logout !important;
        width: auto !important;
    }

    .ht-logout-btn {
        width: auto !important;
        min-width: 4.8rem !important;
    }

    .ht-theme-toggle {
        grid-area: theme !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .ht-theme-toggle [data-theme-toggle-icon],
    .ht-theme-toggle [data-theme-toggle-label] {
        display: inline !important;
    }
}

/* Very small phones */
@media (max-width: 390px) {
    .ht-topbar-actions {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "user"
            "theme"
            "logout" !important;
    }

    .ht-logout-btn {
        width: 100% !important;
    }
}


/* =========================================================
   Universal mobile header icons: theme + logout
========================================================= */

.ht-logout-btn,
.ht-theme-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
}

.ht-logout-icon,
.ht-theme-toggle-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
}

.ht-logout-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    display: block !important;
}

.ht-logout-label,
.ht-theme-toggle-label {
    font-weight: 950 !important;
}

/* Mobile: make theme/logout feel like real action buttons */
@media (max-width: 640px) {
    .ht-topbar-actions {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "user logout"
            "theme theme" !important;
    }

    .ht-theme-toggle {
        grid-area: theme !important;
        width: 100% !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        border-radius: .9rem !important;
        font-size: .84rem !important;
        letter-spacing: 0 !important;
    }

    .ht-theme-toggle-led {
        width: .65rem !important;
        height: .65rem !important;
    }

    .ht-theme-toggle-icon,
    .ht-theme-toggle-label {
        display: inline-flex !important;
    }

    .ht-logout-form {
        grid-area: logout !important;
        width: auto !important;
        margin: 0 !important;
    }

    .ht-logout-btn {
        width: auto !important;
        min-width: 6.2rem !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        padding: 0 .8rem !important;
        border-radius: .9rem !important;
        font-size: .82rem !important;
        white-space: nowrap !important;
    }

    .ht-logout-icon svg {
        width: .95rem !important;
        height: .95rem !important;
    }
}

/* Very narrow phones: icon stays, labels remain readable */
@media (max-width: 390px) {
    .ht-topbar-actions {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "user"
            "theme"
            "logout" !important;
    }

    .ht-logout-btn,
    .ht-theme-toggle {
        width: 100% !important;
    }
}


/* =========================================================
   Final mobile topbar: user name + icon-only actions in one row
========================================================= */

@media (max-width: 640px) {
    .ht-topbar {
        padding: .8rem .9rem !important;
        gap: .65rem !important;
    }

    .ht-topbar-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .45rem !important;
    }

    /* Hide temporary Admin/Client switch on mobile */
    .ht-topbar-actions > .ht-topbar-btn {
        display: none !important;
    }

    /* User chip takes available width */
    .ht-user-chip {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        padding: .25rem .7rem .25rem .3rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .55rem !important;
        border-radius: 999px !important;
    }

    .ht-user-avatar {
        width: 1.95rem !important;
        height: 1.95rem !important;
        min-width: 1.95rem !important;
        font-size: .82rem !important;
    }

    .ht-user-meta {
        display: grid !important;
        min-width: 0 !important;
        gap: .05rem !important;
    }

    .ht-user-meta strong,
    .ht-user-meta div {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: .8rem !important;
        line-height: 1.05 !important;
        font-weight: 950 !important;
    }

    /* Hide email on mobile, keep name clean */
    .ht-user-meta span {
        display: none !important;
    }

    /* Theme becomes icon-only */
    .ht-theme-toggle {
        flex: 0 0 2.45rem !important;
        width: 2.45rem !important;
        min-width: 2.45rem !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        padding: 0 !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .ht-theme-toggle-led {
        display: none !important;
    }

    .ht-theme-toggle-icon {
        display: inline-flex !important;
        font-size: 1rem !important;
        line-height: 1 !important;
    }

    .ht-theme-toggle-label {
        display: none !important;
    }

    /* Logout becomes icon-only */
    .ht-logout-form {
        flex: 0 0 2.45rem !important;
        width: 2.45rem !important;
        min-width: 2.45rem !important;
        margin: 0 !important;
        display: inline-flex !important;
    }

    .ht-logout-btn {
        width: 2.45rem !important;
        min-width: 2.45rem !important;
        height: 2.45rem !important;
        min-height: 2.45rem !important;
        padding: 0 !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .ht-logout-icon {
        display: inline-flex !important;
    }

    .ht-logout-icon svg {
        width: 1.05rem !important;
        height: 1.05rem !important;
    }

    .ht-logout-label {
        display: none !important;
    }
}

/* Very narrow phones: keep everything on one line */
@media (max-width: 390px) {
    .ht-topbar-actions {
        flex-wrap: nowrap !important;
    }

    .ht-user-chip {
        min-width: 0 !important;
    }

    .ht-user-meta strong,
    .ht-user-meta div {
        font-size: .76rem !important;
    }
}


/* =========================================================
   Professional mobile header layout
   Row 1: portal/page title left, theme/logout icons right
   Row 2: user chip full width
========================================================= */

@media (max-width: 640px) {
    .ht-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "title actions"
            "user user" !important;
        align-items: center !important;
        gap: .65rem .75rem !important;
        padding: .85rem .95rem !important;
        background: var(--ht-surface) !important;
        border-bottom: 1px solid var(--ht-border) !important;
    }

    .ht-topbar > div:first-child {
        grid-area: title !important;
        min-width: 0 !important;
        width: auto !important;
        display: grid !important;
        gap: .12rem !important;
    }

    .ht-page-kicker {
        color: var(--ht-primary) !important;
        font-size: .66rem !important;
        font-weight: 950 !important;
        letter-spacing: .15em !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
    }

    .ht-page-title {
        color: var(--ht-heading) !important;
        font-size: 1.02rem !important;
        font-weight: 950 !important;
        line-height: 1.1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .ht-topbar-actions {
        display: contents !important;
    }

    /* Hide temporary Admin/Client switch on mobile */
    .ht-topbar-actions > .ht-topbar-btn {
        display: none !important;
    }

    .ht-user-chip {
        grid-area: user !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 2.55rem !important;
        min-height: 2.55rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .55rem !important;
        padding: .28rem .75rem .28rem .32rem !important;
        border-radius: 999px !important;
        background: var(--ht-surface-soft) !important;
        border: 1px solid var(--ht-border) !important;
    }

    .ht-user-avatar {
        width: 2rem !important;
        height: 2rem !important;
        min-width: 2rem !important;
        font-size: .85rem !important;
    }

    .ht-user-meta {
        display: grid !important;
        min-width: 0 !important;
        gap: .05rem !important;
    }

    .ht-user-meta strong,
    .ht-user-meta div {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--ht-heading) !important;
        font-size: .82rem !important;
        font-weight: 950 !important;
        line-height: 1.05 !important;
    }

    .ht-user-meta span {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--ht-muted) !important;
        font-size: .68rem !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
    }

    .ht-theme-toggle,
    .ht-logout-form {
        grid-area: actions !important;
    }

    .ht-theme-toggle {
        transform: translateX(-2.95rem) !important;
    }

    .ht-logout-form {
        transform: translateX(0) !important;
    }

    .ht-theme-toggle,
    .ht-logout-btn {
        width: 2.35rem !important;
        min-width: 2.35rem !important;
        height: 2.35rem !important;
        min-height: 2.35rem !important;
        padding: 0 !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: var(--ht-surface-soft) !important;
        border: 1px solid var(--ht-border) !important;
    }

    .ht-theme-toggle-led,
    .ht-theme-toggle-label,
    .ht-logout-label {
        display: none !important;
    }

    .ht-theme-toggle-icon {
        display: inline-flex !important;
        font-size: 1rem !important;
        line-height: 1 !important;
    }

    .ht-logout-icon {
        display: inline-flex !important;
    }

    .ht-logout-icon svg {
        width: 1.05rem !important;
        height: 1.05rem !important;
    }

    .ht-logout-form {
        width: 2.35rem !important;
        min-width: 2.35rem !important;
        margin: 0 !important;
        display: inline-flex !important;
    }
}

/* Very small screens: hide email, keep name */
@media (max-width: 390px) {
    .ht-user-meta span {
        display: none !important;
    }

    .ht-page-title {
        font-size: .96rem !important;
    }

    .ht-theme-toggle,
    .ht-logout-btn,
    .ht-logout-form {
        width: 2.25rem !important;
        min-width: 2.25rem !important;
        height: 2.25rem !important;
        min-height: 2.25rem !important;
    }

    .ht-theme-toggle {
        transform: translateX(-2.78rem) !important;
    }
}


/* Final mobile header tweak: theme icon-only */
@media (max-width: 640px) {
    .ht-theme-toggle {
        gap: 0 !important;
        overflow: hidden !important;
    }

    .ht-theme-toggle-label,
    .ht-theme-toggle [data-theme-toggle-label] {
        display: none !important;
    }

    .ht-theme-toggle-icon,
    .ht-theme-toggle [data-theme-toggle-icon] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.05rem !important;
        line-height: 1 !important;
    }
}


/* =========================================================
   Admin System Settings
========================================================= */

.ht-settings-form {
    display: grid !important;
    gap: 1.25rem !important;
}

.ht-settings-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}

.ht-setting-field {
    min-width: 0 !important;
    display: grid !important;
    gap: .45rem !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-setting-field.full {
    grid-column: 1 / -1 !important;
}

.ht-setting-field label:not(.ht-setting-toggle) {
    color: var(--ht-heading) !important;
    font-size: .88rem !important;
    font-weight: 950 !important;
}

.ht-setting-field p {
    margin: 0 !important;
    color: var(--ht-muted) !important;
    font-size: .84rem !important;
    line-height: 1.35 !important;
}

.ht-setting-field input,
.ht-setting-field textarea {
    width: 100% !important;
    border-radius: .85rem !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface) !important;
    color: var(--ht-text) !important;
    padding: .75rem .85rem !important;
}

.ht-setting-field textarea {
    resize: vertical !important;
    min-height: 6rem !important;
}

.ht-setting-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: .55rem !important;
    width: fit-content !important;
    padding: .65rem .85rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 999px !important;
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    font-weight: 900 !important;
}

.ht-setting-toggle input {
    width: 1rem !important;
    height: 1rem !important;
    accent-color: var(--ht-primary) !important;
}

.ht-settings-actions {
    position: sticky !important;
    bottom: 1rem !important;
    z-index: 20 !important;
    padding: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1.1rem !important;
    background: var(--ht-surface) !important;
    box-shadow: var(--ht-shadow) !important;
}

@media (max-width: 820px) {
    .ht-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .ht-setting-field.full {
        grid-column: auto !important;
    }

    .ht-settings-actions {
        position: static !important;
    }
}


/* =========================================================
   User -> Customer Portal Access Management
========================================================= */

.ht-customer-access-picker {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
    max-height: 20rem !important;
    overflow: auto !important;
    padding: .75rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-customer-access-option {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: .65rem !important;
    align-items: center !important;
    padding: .75rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: .9rem !important;
    background: var(--ht-surface) !important;
    cursor: pointer !important;
}

.ht-customer-access-option input {
    width: 1rem !important;
    height: 1rem !important;
    accent-color: var(--ht-primary) !important;
}

.ht-customer-access-option strong {
    display: block !important;
    color: var(--ht-heading) !important;
    font-size: .9rem !important;
    font-weight: 950 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.ht-customer-access-option em {
    display: block !important;
    color: var(--ht-muted) !important;
    font-size: .78rem !important;
    font-style: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (max-width: 820px) {
    .ht-customer-access-picker {
        grid-template-columns: 1fr !important;
        max-height: none !important;
    }
}


/* =========================================================
   Fix role/customer access checkbox UI
   Prevent global input styling from turning checkboxes into text fields.
========================================================= */

.ht-role-picker {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
    padding: .75rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-surface-soft) !important;
}

.ht-role-option,
.ht-customer-access-option {
    position: relative !important;
}

/* Reset checkbox/radio inputs inside custom pickers */
.ht-role-option input[type="checkbox"],
.ht-role-option input[type="radio"],
.ht-customer-access-option input[type="checkbox"],
.ht-customer-access-option input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem !important;
    min-height: 1.15rem !important;
    max-width: 1.15rem !important;
    max-height: 1.15rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: .38rem !important;
    border: 1.5px solid var(--ht-border) !important;
    background: var(--ht-surface) !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 1.15rem !important;
}

.ht-role-option input[type="checkbox"]:checked,
.ht-role-option input[type="radio"]:checked,
.ht-customer-access-option input[type="checkbox"]:checked,
.ht-customer-access-option input[type="radio"]:checked {
    border-color: var(--ht-primary) !important;
    background: var(--ht-primary) !important;
}

.ht-role-option input[type="checkbox"]:checked::after,
.ht-role-option input[type="radio"]:checked::after,
.ht-customer-access-option input[type="checkbox"]:checked::after,
.ht-customer-access-option input[type="radio"]:checked::after {
    content: "✓" !important;
    color: #fff !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

/* Role cards */
.ht-role-option {
    display: inline-flex !important;
    align-items: center !important;
    gap: .65rem !important;
    min-height: 3rem !important;
    padding: .75rem .85rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: .9rem !important;
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    cursor: pointer !important;
}

.ht-role-option span {
    color: var(--ht-heading) !important;
    font-size: .9rem !important;
    font-weight: 950 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Highlight selected role/customer cards */
.ht-role-option:has(input:checked),
.ht-customer-access-option:has(input:checked) {
    border-color: color-mix(in srgb, var(--ht-primary) 55%, transparent) !important;
    background: var(--ht-primary-soft) !important;
}

/* Customer access cards */
.ht-customer-access-picker {
    align-items: stretch !important;
}

.ht-customer-access-option {
    min-height: 4rem !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
}

.ht-customer-access-option span {
    min-width: 0 !important;
}

.ht-customer-access-option strong {
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
}

.ht-customer-access-option em {
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
}

/* Keep checkboxes from being affected by form input rules everywhere */
.ht-form-grid input[type="checkbox"],
.ht-form-grid input[type="radio"] {
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    min-height: 1.15rem !important;
    padding: 0 !important;
}

/* Mobile */
@media (max-width: 820px) {
    .ht-role-picker,
    .ht-customer-access-picker {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   Admin Email Delivery Center
========================================================= */

.ht-email-error {
    display: block !important;
    margin-top: .25rem !important;
    color: var(--ht-danger) !important;
    font-size: .8rem !important;
    font-weight: 800 !important;
}

.ht-page-hero-v2.email-center {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--ht-primary) 16%, transparent), transparent 24rem),
        linear-gradient(135deg, var(--ht-surface), var(--ht-surface-soft)) !important;
}

.ht-pagination-wrap {
    margin-top: 1rem !important;
}


/* =========================================================
   Login screen remember checkbox polish
   Keeps checkbox from inheriting full text-input styling.
========================================================= */

.ht-auth-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-top: .2rem !important;
}

.ht-auth-row label {
    display: inline-flex !important;
    align-items: center !important;
    gap: .65rem !important;
    min-width: 0 !important;
    cursor: pointer !important;
    color: var(--ht-muted) !important;
    font-weight: 850 !important;
    line-height: 1 !important;
}

.ht-auth-row label span {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    color: var(--ht-muted) !important;
    font-size: .95rem !important;
    font-weight: 850 !important;
}

.ht-auth-row input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
    min-width: 1.35rem !important;
    min-height: 1.35rem !important;
    max-width: 1.35rem !important;
    max-height: 1.35rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: .45rem !important;
    border: 1.5px solid var(--ht-border) !important;
    background: var(--ht-surface) !important;
    box-shadow: 0 .45rem 1.25rem rgba(15, 23, 42, .06) !important;
    cursor: pointer !important;
    flex: 0 0 1.35rem !important;
}

.ht-auth-row input[type="checkbox"]:hover {
    border-color: color-mix(in srgb, var(--ht-primary) 65%, transparent) !important;
}

.ht-auth-row input[type="checkbox"]:focus {
    outline: none !important;
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--ht-primary) 16%, transparent) !important;
}

.ht-auth-row input[type="checkbox"]:checked {
    background: var(--ht-primary) !important;
    border-color: var(--ht-primary) !important;
}

.ht-auth-row input[type="checkbox"]:checked::after {
    content: "✓" !important;
    color: #fff !important;
    font-size: .88rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

.ht-auth-row a {
    white-space: nowrap !important;
    font-weight: 950 !important;
}

/* iPad/mobile login polish */
@media (max-width: 760px) {
    .ht-auth-row {
        align-items: center !important;
        gap: .75rem !important;
    }

    .ht-auth-row label span,
    .ht-auth-row a {
        font-size: .9rem !important;
    }

    .ht-auth-row input[type="checkbox"] {
        width: 1.25rem !important;
        height: 1.25rem !important;
        min-width: 1.25rem !important;
        min-height: 1.25rem !important;
        max-width: 1.25rem !important;
        max-height: 1.25rem !important;
        border-radius: .42rem !important;
    }
}

@media (max-width: 430px) {
    .ht-auth-row {
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    .ht-auth-row label {
        gap: .5rem !important;
    }

    .ht-auth-row label span,
    .ht-auth-row a {
        font-size: .84rem !important;
    }
}


/* =========================================================
   Phase A branding settings
========================================================= */

.ht-color-setting {
    display: grid !important;
    grid-template-columns: 4rem minmax(0, 1fr) !important;
    gap: .75rem !important;
    align-items: center !important;
}

.ht-color-setting input[type="color"] {
    width: 4rem !important;
    height: 2.65rem !important;
    min-width: 4rem !important;
    padding: .2rem !important;
    border-radius: .75rem !important;
    cursor: pointer !important;
}

.ht-color-setting code {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 2.65rem !important;
    padding: .55rem .75rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: .75rem !important;
    background: var(--ht-surface) !important;
    color: var(--ht-heading) !important;
    font-weight: 900 !important;
}


/* =========================================================
   Phase A logo upload, live status, and toggle polish
========================================================= */

.ht-logo-uploader {
    display: grid;
    gap: .85rem;
}

.ht-logo-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem;
    border: 1px solid var(--ht-border);
    border-radius: 1rem;
    background: var(--ht-surface);
}

.ht-logo-current span {
    font-size: .72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--ht-muted);
}

.ht-logo-current img {
    max-width: 15rem;
    max-height: 3.4rem;
    object-fit: contain;
}

.ht-logo-upload-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}

.ht-logo-upload-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.65rem !important;
    padding: 0 1rem !important;
    border-radius: .9rem !important;
    background: var(--ht-primary) !important;
    color: white !important;
    font-weight: 950 !important;
    cursor: pointer !important;
    border: 0 !important;
}

.ht-logo-upload-button input {
    display: none !important;
}

.ht-logo-upload-row small,
.ht-logo-cropper p {
    color: var(--ht-muted);
    font-weight: 700;
}

.ht-logo-cropper {
    display: grid;
    gap: .75rem;
    padding: .9rem;
    border: 1px dashed color-mix(in srgb, var(--ht-primary) 45%, var(--ht-border));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--ht-primary) 6%, var(--ht-surface));
}

.ht-logo-canvas-wrap {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--ht-border);
    border-radius: .9rem;
    background: #fff;
}

.ht-logo-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.ht-logo-zoom {
    display: grid !important;
    gap: .35rem !important;
    font-weight: 900 !important;
}

.ht-logo-zoom input[type="range"] {
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* Fix settings toggles so checkbox/radio controls do not become huge text inputs */
.ht-setting-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: .65rem !important;
    width: fit-content !important;
    min-height: 2.65rem !important;
    padding: .45rem .75rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 999px !important;
    background: var(--ht-surface) !important;
    cursor: pointer !important;
}

.ht-setting-toggle input[type="checkbox"],
.ht-setting-toggle input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 1.4rem !important;
    height: 1.4rem !important;
    min-width: 1.4rem !important;
    min-height: 1.4rem !important;
    max-width: 1.4rem !important;
    max-height: 1.4rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    border: 1.5px solid var(--ht-border) !important;
    background: var(--ht-bg) !important;
    box-shadow: none !important;
    cursor: pointer !important;
    flex: 0 0 1.4rem !important;
}

.ht-setting-toggle input[type="checkbox"]:checked,
.ht-setting-toggle input[type="radio"]:checked {
    border-color: var(--ht-primary) !important;
    background: var(--ht-primary) !important;
}

.ht-setting-toggle input[type="checkbox"]:checked::after,
.ht-setting-toggle input[type="radio"]:checked::after {
    content: "" !important;
    width: .55rem !important;
    height: .55rem !important;
    border-radius: 999px !important;
    background: white !important;
}

.ht-setting-toggle span {
    font-weight: 950 !important;
    color: var(--ht-heading) !important;
}

/* Smaller meaningful system status badge */
.ht-sidebar-card .ht-status-pill:not(a),
.ht-system-online-pill {
    width: fit-content !important;
    min-height: 2rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    padding: .35rem .65rem !important;
    border-radius: 999px !important;
    font-size: .78rem !important;
    font-weight: 950 !important;
    color: #065f46 !important;
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
}

.ht-live-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: var(--ht-primary);
    position: relative;
    display: inline-block;
    box-shadow: 0 0 0 .18rem rgba(34, 197, 94, .16);
}

.ht-live-dot::after {
    content: "";
    position: absolute;
    inset: -.45rem;
    border-radius: inherit;
    border: 1px solid rgba(34, 197, 94, .55);
    animation: ht-live-ripple 1.6s ease-out infinite;
}

@keyframes ht-live-ripple {
    0% {
        transform: scale(.45);
        opacity: .9;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

.ht-sidebar-card:has(.ht-system-online-pill) {
    padding: 1rem !important;
}

.ht-sidebar-card:has(.ht-system-online-pill) .ht-sidebar-card-title {
    font-size: .92rem !important;
}

.ht-sidebar-card:has(.ht-system-online-pill) p {
    font-size: .78rem !important;
    line-height: 1.35 !important;
    margin-bottom: .5rem !important;
}


/* =========================================================
   Settings/logo upload polish + sticky save bar
========================================================= */

.ht-settings-form {
    padding-bottom: 6.5rem !important;
}

.ht-settings-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 40 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .75rem !important;
    margin-top: 1.25rem !important;
    padding: .85rem 1rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1.1rem 1.1rem 0 0 !important;
    background: color-mix(in srgb, var(--ht-surface) 94%, transparent) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 -1rem 2.25rem rgba(15, 23, 42, .10) !important;
}

.ht-settings-actions.is-dirty {
    border-color: color-mix(in srgb, var(--ht-primary) 45%, var(--ht-border)) !important;
    box-shadow: 0 -1rem 2.25rem color-mix(in srgb, var(--ht-primary) 16%, transparent) !important;
}

.ht-settings-save-hint {
    margin-right: auto;
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.ht-settings-save-hint strong {
    font-size: .82rem;
    color: var(--ht-heading);
}

.ht-settings-save-hint span {
    font-size: .74rem;
    color: var(--ht-muted);
    font-weight: 750;
}

.ht-logo-uploader {
    gap: .75rem !important;
}

.ht-logo-current {
    min-height: 4rem !important;
}

.ht-logo-current img {
    max-width: 13rem !important;
    max-height: 2.8rem !important;
}

.ht-logo-upload-row {
    align-items: center !important;
}

.ht-logo-upload-button,
.ht-logo-clear-button {
    min-height: 2.45rem !important;
    border-radius: .8rem !important;
    padding: 0 .9rem !important;
    font-size: .88rem !important;
}

.ht-logo-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ht-border);
    background: var(--ht-surface);
    color: var(--ht-heading);
    font-weight: 950;
    cursor: pointer;
}

.ht-logo-clear-button:hover {
    border-color: color-mix(in srgb, var(--ht-primary) 40%, var(--ht-border));
}

.ht-logo-cropper {
    padding: .75rem !important;
    gap: .6rem !important;
}

.ht-logo-canvas-wrap {
    max-height: 11rem !important;
}

.ht-logo-canvas-wrap canvas {
    max-height: 11rem !important;
    object-fit: contain !important;
}

.ht-logo-zoom {
    grid-template-columns: 4rem minmax(0, 1fr) !important;
    align-items: center !important;
    gap: .7rem !important;
}

.ht-logo-cropper p {
    margin: 0 !important;
    font-size: .82rem !important;
    line-height: 1.35 !important;
}

.ht-logo-cropper p strong {
    color: var(--ht-heading);
}

/* Make sidebar system status compact */
.ht-sidebar-card:has(.ht-system-online-pill) {
    max-width: 14rem !important;
    padding: .85rem .95rem !important;
    border-radius: 1rem !important;
}

.ht-sidebar-card:has(.ht-system-online-pill) .ht-sidebar-card-title {
    font-size: .86rem !important;
    margin-bottom: .2rem !important;
}

.ht-sidebar-card:has(.ht-system-online-pill) p {
    font-size: .76rem !important;
    line-height: 1.25 !important;
    max-width: 10rem !important;
}

.ht-system-online-pill {
    min-height: 1.75rem !important;
    padding: .28rem .58rem !important;
    font-size: .74rem !important;
}

/* More reliable toggle cleanup for settings/public docs */
.ht-setting-toggle input[type="checkbox"] {
    aspect-ratio: 1 / 1 !important;
    inline-size: 1.25rem !important;
    block-size: 1.25rem !important;
}

@media (max-width: 760px) {
    .ht-settings-actions {
        left: 0 !important;
        right: 0 !important;
        flex-wrap: wrap !important;
        border-radius: 1rem 1rem 0 0 !important;
    }

    .ht-settings-save-hint {
        flex: 1 1 100% !important;
    }

    .ht-settings-actions button,
    .ht-settings-actions a {
        flex: 1 1 auto !important;
    }

    .ht-logo-current {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .ht-logo-current img {
        max-width: 100% !important;
    }
}


/* =========================================================
   Final Phase A settings polish: logo, colors, status
========================================================= */

/* Let the logo uploader take its own row, so color cards don't stretch tall */
.ht-setting-field.setting-key-brand_logo_path {
    grid-column: 1 / -1 !important;
}

.ht-setting-field.setting-type-color {
    min-height: auto !important;
    align-self: start !important;
}

.ht-setting-field.setting-type-color p {
    min-height: 2.6rem !important;
    margin-bottom: .75rem !important;
}

.ht-color-setting {
    grid-template-columns: 3.25rem minmax(7rem, 1fr) !important;
    align-items: center !important;
    max-width: 18rem !important;
}

.ht-color-setting input[type="color"] {
    width: 3.25rem !important;
    min-width: 3.25rem !important;
    height: 2.55rem !important;
    min-height: 2.55rem !important;
    max-height: 2.55rem !important;
    padding: .18rem !important;
}

.ht-color-setting code {
    min-height: 2.55rem !important;
    height: 2.55rem !important;
    padding: .45rem .75rem !important;
    font-size: .92rem !important;
}

/* Logo uploader: smaller, cleaner, less confusing */
.ht-logo-current {
    max-width: 32rem !important;
    min-height: 3.5rem !important;
    padding: .7rem .9rem !important;
}

.ht-logo-current img {
    max-width: 16rem !important;
    max-height: 2.5rem !important;
}

.ht-logo-uploader > input[type="text"] {
    max-width: 32rem !important;
}

.ht-logo-upload-row {
    max-width: 42rem !important;
}

.ht-logo-upload-row small {
    flex-basis: 100% !important;
    max-width: 32rem !important;
    line-height: 1.35 !important;
}

.ht-logo-cropper {
    max-width: 42rem !important;
    padding: .65rem !important;
}

.ht-logo-canvas-wrap {
    max-height: 8rem !important;
}

.ht-logo-canvas-wrap canvas {
    max-height: 8rem !important;
}

.ht-logo-zoom {
    grid-template-columns: 3.5rem minmax(0, 1fr) !important;
    max-width: 32rem !important;
}

.ht-logo-clear-button[hidden],
.ht-logo-cropper[hidden] {
    display: none !important;
}

/* Make sticky Save bar more visible without covering too much */
.ht-settings-actions {
    max-width: min(100%, 72rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Sidebar system status: smaller card, less visual weight */
.ht-sidebar-help-system {
    max-width: 12.5rem !important;
    padding: .75rem .85rem !important;
    border-radius: .9rem !important;
}

.ht-sidebar-help-system .ht-sidebar-card-title {
    font-size: .82rem !important;
    line-height: 1.1 !important;
    margin-bottom: .15rem !important;
}

.ht-sidebar-help-system p {
    font-size: .72rem !important;
    line-height: 1.2 !important;
    margin: 0 0 .45rem 0 !important;
    max-width: 9rem !important;
}

.ht-sidebar-help-system .ht-status-pill,
.ht-sidebar-help-system .ht-system-online-pill {
    min-height: 1.55rem !important;
    padding: .2rem .5rem !important;
    font-size: .68rem !important;
    gap: .35rem !important;
}

.ht-sidebar-help-system .ht-live-dot {
    width: .44rem !important;
    height: .44rem !important;
}

/* iPad/tablet settings layout */
@media (max-width: 1024px) {
    .ht-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .ht-setting-field.setting-key-brand_logo_path,
    .ht-setting-field.setting-type-color {
        grid-column: 1 / -1 !important;
    }

    .ht-color-setting {
        max-width: 100% !important;
        grid-template-columns: 3.25rem minmax(0, 1fr) !important;
    }

    .ht-logo-current,
    .ht-logo-uploader > input[type="text"],
    .ht-logo-upload-row,
    .ht-logo-cropper {
        max-width: 100% !important;
    }
}

/* Small mobile */
@media (max-width: 520px) {
    .ht-logo-upload-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .ht-logo-upload-button,
    .ht-logo-clear-button {
        width: 100% !important;
    }

    .ht-settings-save-hint span {
        display: none !important;
    }
}


/* =========================================================
   Settings page fixed save bar
   Replaces sticky behavior because portal scroll containers can break sticky.
========================================================= */

.ht-settings-form {
    padding-bottom: 8rem !important;
}

.ht-settings-actions {
    position: fixed !important;
    z-index: 9999 !important;
    bottom: .85rem !important;
    right: 1.25rem !important;
    left: 18.75rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .75rem !important;

    max-width: none !important;
    margin: 0 !important;
    padding: .8rem .95rem !important;

    border: 1px solid color-mix(in srgb, var(--ht-primary) 22%, var(--ht-border)) !important;
    border-radius: 1.15rem !important;
    background: color-mix(in srgb, var(--ht-surface) 94%, transparent) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, .20) !important;
}

.ht-settings-actions.is-dirty {
    border-color: color-mix(in srgb, var(--ht-primary) 55%, var(--ht-border)) !important;
    box-shadow: 0 1rem 3rem color-mix(in srgb, var(--ht-primary) 24%, transparent) !important;
}

.ht-settings-actions .ht-action-primary,
.ht-settings-actions .ht-action-secondary {
    min-height: 2.65rem !important;
    white-space: nowrap !important;
}

.ht-settings-save-hint {
    margin-right: auto !important;
    min-width: 0 !important;
}

.ht-settings-save-hint strong {
    display: block !important;
}

.ht-settings-save-hint span {
    display: block !important;
    max-width: 34rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Tablet with visible sidebar */
@media (max-width: 1180px) {
    .ht-settings-actions {
        left: 17.5rem !important;
        right: 1rem !important;
    }
}

/* Mobile/sidebar collapsed */
@media (max-width: 860px) {
    .ht-settings-actions {
        left: .75rem !important;
        right: .75rem !important;
        bottom: .75rem !important;
        flex-wrap: wrap !important;
        padding: .75rem !important;
    }

    .ht-settings-save-hint {
        flex: 1 1 100% !important;
    }

    .ht-settings-save-hint span {
        white-space: normal !important;
        max-width: none !important;
    }

    .ht-settings-actions .ht-action-primary,
    .ht-settings-actions .ht-action-secondary {
        flex: 1 1 auto !important;
    }
}

/* Very small mobile */
@media (max-width: 520px) {
    .ht-settings-save-hint span {
        display: none !important;
    }

    .ht-settings-actions {
        gap: .5rem !important;
    }
}


/* =========================================================
   Phase A Typography Presets + Dashboard KPI Polish
========================================================= */

:root {
    --ht-font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ht-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ht-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.ht-body,
.ht-auth-page,
.ht-shell,
.ht-content {
    font-family: var(--ht-font-body) !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3,
.ht-page-hero-v2 h1,
.ht-admin-hero-v2 h1,
.ht-panel-head h2,
.ht-auth-copy h1,
.ht-auth-card-head h2 {
    font-family: var(--ht-font-heading) !important;
}

/* Presets use system-safe stacks so deployment does not depend on font files */
.ht-typography-modern-saas {
    --ht-font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ht-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ht-typography-professional {
    --ht-font-body: Avenir, "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --ht-font-heading: Avenir, "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.ht-typography-corporate {
    --ht-font-body: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
    --ht-font-heading: Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
}

.ht-typography-editorial {
    --ht-font-body: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --ht-font-heading: Georgia, "Times New Roman", serif;
}

.ht-typography-tech-clean {
    --ht-font-body: "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --ht-font-heading: "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

/* Settings select */
.ht-setting-select {
    width: 100% !important;
    min-height: 3.25rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: var(--ht-bg) !important;
    color: var(--ht-heading) !important;
    padding: 0 1rem !important;
    font-weight: 800 !important;
    outline: none !important;
}

.ht-setting-select:focus {
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--ht-primary) 16%, transparent) !important;
}

/* Dashboard typography: less harsh, more premium */
.ht-admin-dashboard-v2 {
    --ht-dashboard-label-spacing: .105em;
    --ht-dashboard-label-weight: 820;
    --ht-dashboard-number-weight: 820;
}

.ht-admin-hero-v2 .ht-kicker,
.ht-kicker {
    letter-spacing: .16em !important;
    font-weight: 850 !important;
    font-size: .73rem !important;
}

.ht-admin-hero-v2 h1 {
    font-weight: 820 !important;
    letter-spacing: -.035em !important;
    line-height: .98 !important;
}

.ht-admin-hero-v2 p {
    font-weight: 520 !important;
    line-height: 1.55 !important;
}

/* Top activity badges */
.ht-activity-badge span,
.ht-metric-card-v2 span {
    letter-spacing: var(--ht-dashboard-label-spacing) !important;
    font-weight: var(--ht-dashboard-label-weight) !important;
    font-size: .74rem !important;
    line-height: 1.28 !important;
    color: color-mix(in srgb, var(--ht-muted) 88%, var(--ht-heading)) !important;
}

.ht-activity-badge strong,
.ht-metric-card-v2 strong,
.ht-admin-health-card strong {
    font-family: var(--ht-font-heading) !important;
    font-weight: var(--ht-dashboard-number-weight) !important;
    letter-spacing: -.035em !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums lining-nums;
}

.ht-activity-badge strong {
    font-size: clamp(1.85rem, 2.5vw, 2.55rem) !important;
}

.ht-metric-card-v2 strong {
    font-size: clamp(2rem, 3vw, 2.85rem) !important;
}

.ht-metric-card-v2.accent strong {
    font-size: clamp(1.85rem, 2.5vw, 2.55rem) !important;
}

.ht-metric-card-v2 p,
.ht-admin-health-card p {
    font-weight: 520 !important;
    color: var(--ht-muted) !important;
    line-height: 1.45 !important;
}

.ht-admin-health-card span {
    font-weight: 720 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    font-size: .95rem !important;
    color: var(--ht-heading) !important;
}

.ht-admin-health-card strong {
    font-size: clamp(2.25rem, 3.5vw, 3.25rem) !important;
}

/* Panels/tables should feel less heavy */
.ht-panel-head h2 {
    font-weight: 800 !important;
    letter-spacing: -.02em !important;
}

.ht-panel-head p,
.ht-table-title span,
.ht-mini-row span,
.ht-activity-item span,
.ht-activity-item small {
    font-weight: 520 !important;
}

.ht-clean-table th {
    letter-spacing: .08em !important;
    font-weight: 760 !important;
}

.ht-chip {
    font-weight: 760 !important;
    letter-spacing: .01em !important;
}

/* Preset-specific fine tuning */
.ht-typography-editorial .ht-admin-hero-v2 h1,
.ht-typography-editorial .ht-page-hero-v2 h1 {
    letter-spacing: -.025em !important;
    font-weight: 760 !important;
}

.ht-typography-editorial .ht-kicker,
.ht-typography-editorial .ht-activity-badge span,
.ht-typography-editorial .ht-metric-card-v2 span {
    font-family: var(--ht-font-body) !important;
}

.ht-typography-corporate .ht-admin-hero-v2 h1,
.ht-typography-corporate .ht-page-hero-v2 h1 {
    font-weight: 780 !important;
    letter-spacing: -.025em !important;
}

.ht-typography-professional .ht-admin-hero-v2 h1,
.ht-typography-professional .ht-page-hero-v2 h1 {
    font-weight: 800 !important;
}

.ht-typography-tech-clean .ht-kicker,
.ht-typography-tech-clean .ht-activity-badge span,
.ht-typography-tech-clean .ht-metric-card-v2 span {
    letter-spacing: .13em !important;
}

/* iPad/tablet dashboard stat polish */
@media (max-width: 1024px) {
    .ht-activity-badge span,
    .ht-metric-card-v2 span {
        letter-spacing: .085em !important;
        font-size: .7rem !important;
    }

    .ht-activity-badge strong,
    .ht-metric-card-v2 strong {
        letter-spacing: -.025em !important;
    }
}


/* =========================================================
   Phase A Lightweight Loading UX
========================================================= */

.ht-page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000;
    width: 0%;
    height: 3px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--ht-primary), var(--ht-accent));
    box-shadow: 0 .2rem .9rem color-mix(in srgb, var(--ht-primary) 40%, transparent);
    opacity: 0;
    transition:
        width .35s ease,
        opacity .2s ease;
}

.ht-page-loading-bar.is-loading {
    width: 72%;
    opacity: 1;
}

.ht-page-loading-bar.is-slow {
    width: 88%;
}

.ht-page-loading-bar.is-done {
    width: 100%;
    opacity: 0;
}

.ht-button-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    display: inline-block;
    margin-right: .45rem;
    animation: ht-spin .75s linear infinite;
    vertical-align: -0.12em;
}

button[aria-busy="true"],
.ht-action-primary[aria-busy="true"],
.ht-auth-submit[aria-busy="true"] {
    cursor: wait !important;
    opacity: .88 !important;
}

button[aria-busy="true"] span,
.ht-action-primary[aria-busy="true"] span,
.ht-auth-submit[aria-busy="true"] span {
    display: inline-flex;
    align-items: center;
}

@keyframes ht-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Settings save overlay */
.ht-action-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ht-action-overlay[hidden] {
    display: none !important;
}

.ht-action-overlay-card {
    width: min(24rem, calc(100vw - 2rem));
    padding: 1.35rem;
    border-radius: 1.35rem;
    background: var(--ht-surface);
    border: 1px solid color-mix(in srgb, var(--ht-primary) 25%, var(--ht-border));
    box-shadow: 0 1.25rem 4rem rgba(15, 23, 42, .22);
    display: grid;
    gap: .45rem;
    justify-items: center;
    text-align: center;
}

.ht-action-overlay-card strong {
    color: var(--ht-heading);
    font-size: 1.05rem;
    font-weight: 850;
}

.ht-action-overlay-card p {
    color: var(--ht-muted);
    margin: 0;
    font-weight: 650;
    line-height: 1.4;
}

.ht-loader-ring {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 3px solid color-mix(in srgb, var(--ht-primary) 20%, var(--ht-border));
    border-top-color: var(--ht-primary);
    animation: ht-spin .8s linear infinite;
    display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
    .ht-page-loading-bar,
    .ht-button-spinner,
    .ht-loader-ring {
        animation: none !important;
        transition: none !important;
    }
}


/* Anti flicker / logo stability */
.ht-sidebar-logo img,
.ht-auth-logo,
.ht-auth-card-logo img,
.invoice-logo-wide {
    object-fit: contain !important;
    display: block;
    max-width: 100%;
}

.ht-sidebar-logo img {
    min-height: 34px;
}

.ht-auth-logo {
    min-height: 42px;
}

.ht-auth-card-logo img {
    min-height: 34px;
}

/* Prevent browser from showing broken image icon space harshly */
img {
    overflow: hidden;
}


/* Global brand color enforcement */
.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-settings-actions .ht-action-primary,
.ht-auth-submit,
.ht-mobile-menu-btn,
.ht-page-loading-bar,
.ht-sidebar-help-system .ht-status-pill,
.ht-sidebar-help-system .ht-system-online-pill {
    background: var(--ht-brand-gradient) !important;
}

.ht-action-primary:hover,
.ht-auth-submit:hover {
    background: linear-gradient(90deg, var(--ht-primary-hover), var(--ht-accent)) !important;
}

.ht-kicker,
.ht-panel-head a,
.ht-table-action a,
.ht-mini-link,
.ht-auth-card-head span,
.ht-auth-kicker,
.ht-page-hero-v2 a:not(.ht-action-secondary),
.ht-sidebar-card-title {
    color: var(--ht-primary) !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-action-primary,
.ht-auth-submit,
.ht-settings-actions .ht-action-primary {
    color: color-mix(in srgb, var(--ht-secondary-brand) 82%, #ffffff) !important;
}

.ht-chip.good,
.ht-status-pill,
.ht-system-online-pill {
    background: color-mix(in srgb, var(--ht-primary) 16%, #ffffff) !important;
    color: color-mix(in srgb, var(--ht-primary) 58%, #0f172a) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 35%, transparent) !important;
}

input:focus,
textarea:focus,
select:focus,
.ht-auth-field input:focus,
.ht-form-grid input:focus,
.ht-form-grid select:focus,
.ht-form-grid textarea:focus,
.ht-setting-field input:focus,
.ht-setting-field textarea:focus {
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 .22rem var(--ht-primary-ring) !important;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--ht-primary) !important;
}

/* =========================================================
   Portal overflow repair: services / invoices / payments
   Prevent cards, tables, and hero buttons from cutting off.
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.ht-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.ht-main {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
}

.ht-content {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
}

.ht-page-v2,
.ht-admin-dashboard-v2,
.ht-client-dashboard,
.ht-client-dashboard-v2 {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
}

/* Hero sections: keep action buttons visible */
.ht-page-hero-v2,
.ht-admin-hero-v2 {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
}

.ht-page-hero-v2 > *,
.ht-admin-hero-v2 > * {
    min-width: 0;
}

.ht-page-hero-actions,
.ht-admin-actions-v2 {
    min-width: 0 !important;
    max-width: 100%;
    flex-wrap: wrap !important;
    justify-content: flex-start;
    overflow: visible !important;
}

.ht-page-hero-actions a,
.ht-page-hero-actions button,
.ht-admin-actions-v2 a,
.ht-admin-actions-v2 button {
    white-space: nowrap;
    max-width: 100%;
}

/* Metric rows should not force the whole page wider */
.ht-metrics-grid-v2,
.ht-metrics-3,
.ht-metrics-4,
.ht-activity-badges {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .25rem;
}

.ht-metric-card-v2,
.ht-activity-badge,
.ht-admin-health-card,
.ht-health-card {
    min-width: 0;
}

/* Panels and tables should scroll inside, not push page */
.ht-panel-v2,
.ht-card,
.ht-panel {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
}

.ht-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.ht-clean-table {
    width: 100%;
    min-width: 760px;
}

.ht-clean-table th,
.ht-clean-table td {
    overflow-wrap: anywhere;
}

/* Long invoice numbers/emails should wrap cleanly */
.ht-table-title,
.ht-table-title strong,
.ht-table-title span,
.ht-mini-row,
.ht-mini-row strong,
.ht-mini-row span,
.ht-info-list strong,
.ht-info-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Action columns should not disappear off screen */
.ht-table-action,
.ht-right {
    white-space: nowrap;
}

/* Fix forms/filter bars cutting buttons on right */
.ht-filter-bar,
.ht-services-filter-bar,
.ht-form-actions,
.ht-side-actions {
    min-width: 0 !important;
    max-width: 100%;
    flex-wrap: wrap !important;
    overflow: visible !important;
}

.ht-filter-bar input,
.ht-filter-bar select,
.ht-services-filter-bar input,
.ht-services-filter-bar select {
    min-width: 0 !important;
}

/* iPad/tablet width: keep content comfortable beside sidebar */
@media (max-width: 1180px) {
    .ht-content {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .ht-page-hero-v2,
    .ht-admin-hero-v2 {
        grid-template-columns: 1fr !important;
    }

    .ht-page-hero-actions,
    .ht-admin-actions-v2 {
        justify-content: flex-start !important;
    }

    .ht-metrics-grid-v2,
    .ht-metrics-3,
    .ht-metrics-4,
    .ht-activity-badges {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(220px, 1fr);
        grid-template-columns: unset !important;
    }
}

/* Small tablets/phones: full mobile behavior */
@media (max-width: 900px) {
    .ht-shell {
        display: block !important;
    }

    .ht-main {
        width: 100% !important;
    }

    .ht-content {
        padding: 1rem !important;
    }

    .ht-page-hero-v2,
    .ht-admin-hero-v2,
    .ht-panel-v2 {
        border-radius: 1.25rem !important;
    }

    .ht-clean-table {
        min-width: 680px;
    }
}

/* Dark mode action text contrast */
html.dark .ht-action-primary,
html.dark .ht-auth-submit,
html.dark .ht-settings-actions .ht-action-primary,
html.dark .ht-page-hero-actions a:first-child,
html.dark .ht-page-hero-actions button:first-child {
    color: #07111f !important;
    text-shadow: none !important;
}

html.dark .ht-action-secondary,
html.dark .ht-page-hero-actions a:not(.ht-action-primary),
html.dark .ht-page-hero-actions button:not(.ht-action-primary) {
    color: #e5eef8 !important;
}

/* =========================================================
   Final table crush repair + global button style setting
   ========================================================= */

.ht-action-primary,
.ht-auth-submit,
.ht-settings-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child {
    background: var(--ht-button-bg, var(--ht-primary)) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 55%, transparent) !important;
}

.ht-action-primary:hover,
.ht-auth-submit:hover,
.ht-settings-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover {
    background: var(--ht-button-bg-hover, var(--ht-primary-hover)) !important;
}

.ht-table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.ht-clean-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

.ht-clean-table th,
.ht-clean-table td {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    vertical-align: middle;
}

.ht-clean-table th {
    white-space: nowrap !important;
    min-width: 7.5rem;
}

.ht-clean-table th:nth-child(1),
.ht-clean-table td:nth-child(1) {
    min-width: 9rem;
}

.ht-clean-table th:nth-child(2),
.ht-clean-table td:nth-child(2) {
    min-width: 11rem;
}

.ht-clean-table th:nth-child(3),
.ht-clean-table td:nth-child(3),
.ht-clean-table th:nth-child(4),
.ht-clean-table td:nth-child(4) {
    min-width: 7rem;
}

.ht-clean-table th:nth-child(5),
.ht-clean-table td:nth-child(5) {
    min-width: 7.5rem;
}

.ht-clean-table th:nth-child(6),
.ht-clean-table td:nth-child(6) {
    min-width: 8rem;
}

.ht-clean-table th:last-child,
.ht-clean-table td:last-child {
    min-width: 10rem;
    white-space: nowrap !important;
}

.ht-table-title strong,
.ht-table-title span,
.ht-clean-table td a,
.ht-clean-table td strong {
    word-break: normal !important;
    overflow-wrap: anywhere;
}

.ht-chip,
.ht-chip.good,
.ht-chip.warn,
.ht-chip.danger,
.ht-chip.neutral {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    min-width: max-content;
}

.ht-table-action,
.ht-table-action a,
.ht-clean-table td:last-child a,
.ht-clean-table td:last-child button {
    white-space: nowrap !important;
    min-width: max-content;
}

@media (max-width: 1280px) {
    .ht-clean-table {
        min-width: 920px !important;
    }

    .ht-panel-v2 .ht-table-wrap {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

@media (max-width: 900px) {
    .ht-clean-table {
        min-width: 860px !important;
    }

    .ht-table-wrap {
        border-radius: 1rem;
    }
}

/* =========================================================
   Sidebar status + primary button contrast final polish
   ========================================================= */

.ht-action-primary,
.ht-auth-submit,
.ht-settings-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child {
    color: var(--ht-button-text, #ffffff) !important;
    text-shadow: none !important;
}

.ht-action-primary *,
.ht-auth-submit *,
.ht-settings-actions .ht-action-primary *,
.ht-page-hero-actions a:first-child *,
.ht-page-hero-actions button:first-child *,
.ht-admin-actions-v2 a:first-child *,
.ht-admin-actions-v2 button:first-child * {
    color: inherit !important;
}

/* Keep sidebar status from covering navigation items */
.ht-sidebar {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

.ht-sidebar nav,
.ht-sidebar-menu {
    flex: 0 0 auto !important;
}

.ht-sidebar-help-system,
.ht-sidebar-card:has(.ht-system-online-pill) {
    position: static !important;
    margin-top: 1.25rem !important;
    margin-bottom: 1rem !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 1rem 1.05rem !important;
    border-radius: 1rem !important;
    z-index: 1 !important;
}

.ht-sidebar-help-system .ht-sidebar-card-title,
.ht-sidebar-card:has(.ht-system-online-pill) .ht-sidebar-card-title {
    font-size: .95rem !important;
    line-height: 1.15 !important;
    margin-bottom: .25rem !important;
}

.ht-sidebar-help-system p,
.ht-sidebar-card:has(.ht-system-online-pill) p {
    font-size: .8rem !important;
    line-height: 1.25 !important;
    margin: 0 0 .55rem !important;
}

.ht-sidebar-help-system .ht-status-pill,
.ht-sidebar-help-system .ht-system-online-pill,
.ht-sidebar-card:has(.ht-system-online-pill) .ht-status-pill,
.ht-sidebar-card:has(.ht-system-online-pill) .ht-system-online-pill {
    width: max-content !important;
    min-height: 1.7rem !important;
    padding: .38rem .75rem !important;
    font-size: .76rem !important;
    border-radius: 999px !important;
}

/* On shorter tablet screens, make status even smaller */
@media (max-height: 820px) {
    .ht-sidebar-help-system,
    .ht-sidebar-card:has(.ht-system-online-pill) {
        padding: .8rem .9rem !important;
        margin-top: .85rem !important;
    }

    .ht-sidebar-help-system p,
    .ht-sidebar-card:has(.ht-system-online-pill) p {
        display: none !important;
    }
}

/* Avoid top action text getting washed out */
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a.ht-action-primary,
.ht-page-hero-actions button.ht-action-primary {
    color: var(--ht-button-text, #ffffff) !important;
    font-weight: 850 !important;
}

/* =========================================================
   Final layout safety: client invoice overflow + sidebar cards
   ========================================================= */

/* Stop pages from becoming wider than the visible viewport */
.ht-shell,
.ht-main,
.ht-content,
.ht-page-v2,
.ht-client-dashboard,
.ht-client-dashboard-v2,
.ht-admin-dashboard-v2 {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Main content should scroll inside tables, not push the whole page sideways */
.ht-content {
    overflow-x: clip !important;
}

.ht-panel-v2,
.ht-card,
.ht-page-hero-v2,
.ht-invoice-detail-grid,
.ht-client-main-grid,
.ht-admin-main-grid,
.ht-admin-lower-grid {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Invoice detail page: avoid right column/table cutting off */
.ht-invoice-detail-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
}

.ht-invoice-detail-grid > *,
.ht-invoice-detail-grid .wide {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* On larger screens, allow two columns only when enough room exists */
@media (min-width: 1180px) {
    .ht-invoice-detail-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(20rem, .65fr) !important;
        align-items: start !important;
    }
}

/* Tables should stay readable without crushing columns into vertical letters */
.ht-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.ht-clean-table {
    width: 100% !important;
    min-width: 46rem !important;
    table-layout: auto !important;
}

.ht-clean-table th,
.ht-clean-table td {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
}

/* But keep action buttons and chips from breaking letter-by-letter */
.ht-clean-table .ht-chip,
.ht-clean-table .ht-table-action,
.ht-clean-table .ht-table-action a,
.ht-clean-table .ht-action-primary,
.ht-clean-table .ht-action-secondary,
.ht-clean-table button {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

/* Invoice info rows: prevent right values from being clipped */
.ht-info-list,
.ht-info-list > div {
    min-width: 0 !important;
    max-width: 100% !important;
}

.ht-info-list > div {
    display: grid !important;
    grid-template-columns: minmax(8rem, .7fr) minmax(0, 1fr) !important;
    gap: .75rem !important;
    align-items: center !important;
}

.ht-info-list strong {
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: right !important;
    overflow-wrap: anywhere !important;
}

/* On tablet/narrow screens, stack invoice info values */
@media (max-width: 980px) {
    .ht-info-list > div {
        grid-template-columns: 1fr !important;
        gap: .35rem !important;
    }

    .ht-info-list strong {
        text-align: left !important;
    }
}

/* Sidebar cards: don't cover lower nav items */
.ht-sidebar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 1rem !important;
}

.ht-sidebar-card,
.ht-sidebar-help-system,
.ht-sidebar-card:has(.ht-system-online-pill) {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    max-width: 100% !important;
    z-index: 1 !important;
}

/* Client "Need Help?" card should not sit on top of menu items */
.ht-sidebar-card:has(a[href*="tickets"]),
.ht-client-sidebar .ht-sidebar-card {
    position: static !important;
    margin-top: 1rem !important;
}

/* Make bottom cards compact so short screens don't hide them */
.ht-sidebar-card-title {
    line-height: 1.15 !important;
}

.ht-sidebar-card-text,
.ht-sidebar-card p {
    line-height: 1.25 !important;
}

/* On short iPad/tablet viewport, shrink sidebar utility cards */
@media (max-height: 850px) {
    .ht-sidebar-card,
    .ht-sidebar-help-system,
    .ht-sidebar-card:has(.ht-system-online-pill) {
        padding: .75rem .85rem !important;
        border-radius: .9rem !important;
    }

    .ht-sidebar-card-title {
        font-size: .9rem !important;
    }

    .ht-sidebar-card-text,
    .ht-sidebar-card p {
        font-size: .78rem !important;
        margin-bottom: .45rem !important;
    }

    .ht-status-pill,
    .ht-system-online-pill {
        min-height: 1.55rem !important;
        padding: .3rem .65rem !important;
        font-size: .72rem !important;
    }
}

/* On very short screens, hide helper paragraph but keep card/action visible */
@media (max-height: 740px) {
    .ht-sidebar-card-text,
    .ht-sidebar-card p {
        display: none !important;
    }
}

/* Client invoice action buttons should wrap cleanly */
.ht-side-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .65rem !important;
}

.ht-side-actions a,
.ht-side-actions button {
    min-width: 0 !important;
    white-space: nowrap !important;
}

/* Give page bottom breathing room so final sidebar card is not clipped */
.ht-content {
    padding-bottom: 3rem !important;
}

/* Admin invoice public link card */
.ht-public-link-card {
    margin-top: 1rem;
    border: 1px solid color-mix(in srgb, var(--ht-primary) 24%, var(--ht-border, #dbe7f1));
    border-radius: 1rem;
    padding: 1rem;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--ht-primary) 12%, transparent), transparent 12rem),
        var(--ht-surface, #ffffff);
}

.ht-public-link-card span {
    display: block;
    color: var(--ht-primary);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: .35rem;
}

.ht-public-link-card strong {
    display: block;
    color: var(--ht-text, #0f172a);
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.2;
}

.ht-public-link-card small {
    display: block;
    margin-top: .4rem;
    color: var(--ht-muted, #64748b);
    font-size: .78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ht-public-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .85rem;
}

.ht-public-link-actions form {
    margin: 0;
}

.ht-public-link-actions a,
.ht-public-link-actions button {
    min-height: 2.35rem;
    border-radius: .75rem;
    padding: 0 .85rem;
    font-size: .82rem;
    white-space: nowrap;
}

/* =========================================================
   Brand-controlled kicker + hero/blob colors
   These override old hardcoded teal/cyan hero effects.
   ========================================================= */

.ht-kicker,
.ht-auth-kicker,
.ht-page-hero-v2 .ht-kicker,
.ht-admin-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker,
.ht-page-v2 .ht-kicker,
.ht-topbar-title .ht-kicker,
.ht-topbar-title small,
.ht-topbar .ht-kicker,
[class*="kicker"] {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

.ht-page-hero-v2,
.ht-admin-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child,
.ht-auth-left,
.ht-auth-shell,
.ht-public-doc-shell {
    background:
        radial-gradient(circle at 88% 12%, var(--ht-blob-soft, var(--ht-primary-soft)) 0, transparent 30rem),
        radial-gradient(circle at 14% 100%, var(--ht-blob-accent-soft, rgba(245, 158, 11, .12)) 0, transparent 26rem),
        linear-gradient(135deg, var(--ht-surface, #ffffff), color-mix(in srgb, var(--ht-blob-color, var(--ht-primary)) 4%, var(--ht-surface, #ffffff))) !important;
}

.ht-page-hero-v2::before,
.ht-admin-hero-v2::before,
.ht-auth-left::before,
.ht-auth-shell::before {
    background:
        radial-gradient(circle, var(--ht-blob-soft, var(--ht-primary-soft)) 0, transparent 64%) !important;
}

.ht-page-hero-v2::after,
.ht-admin-hero-v2::after,
.ht-auth-left::after,
.ht-auth-shell::after {
    background:
        radial-gradient(circle, var(--ht-blob-accent-soft, rgba(245, 158, 11, .12)) 0, transparent 66%) !important;
}

/* Topbar company/admin label should follow the new kicker color */
.ht-topbar strong,
.ht-topbar-title strong,
.ht-topbar-title span:first-child {
    color: var(--ht-secondary-brand, var(--ht-text)) !important;
}

.ht-topbar-title small,
.ht-topbar-title .ht-kicker,
.ht-topbar .ht-kicker {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

/* Button text safety for bright/light custom colors */
.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-auth-submit,
.ht-settings-actions .ht-action-primary,
.ht-page-hero-actions .ht-action-primary {
    color: color-mix(in srgb, var(--ht-secondary-brand, #0f172a) 92%, black) !important;
    text-shadow: none !important;
}

html.dark .ht-action-primary,
html.dark button.ht-action-primary,
html.dark a.ht-action-primary,
html.dark .ht-auth-submit,
html.dark .ht-settings-actions .ht-action-primary,
html.dark .ht-page-hero-actions .ht-action-primary {
    color: #ffffff !important;
}

/* =========================================================
   Dynamic brand color consumption patch
   Makes saved Brand settings control kickers, hero blobs, and buttons.
   ========================================================= */

.ht-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-page-hero-v2 .ht-kicker,
.ht-admin-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-admin-dashboard-v2 .ht-kicker,
.ht-panel-head .ht-kicker,
.ht-topbar .ht-kicker {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

.ht-page-hero-v2,
.ht-admin-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child {
    background:
        radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 22%, transparent), transparent 19rem),
        radial-gradient(circle at 8% 95%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 16%, transparent), transparent 18rem),
        linear-gradient(135deg, var(--ht-surface, #ffffff), color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 7%, var(--ht-surface, #ffffff))) !important;
}

.ht-auth-left {
    background:
        radial-gradient(circle at 88% 10%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 20%, transparent), transparent 22rem),
        radial-gradient(circle at 10% 95%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 16%, transparent), transparent 20rem),
        linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, #ffffff)) !important;
}

.ht-action-primary,
.ht-auth-submit,
.ht-page-hero-actions .ht-action-primary,
.ht-form-actions .ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-settings-actions .ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 70%, transparent) !important;
}

.ht-action-primary:hover,
.ht-auth-submit:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover {
    background: color-mix(in srgb, var(--ht-primary) 86%, #000) !important;
    color: #ffffff !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: #ffffff !important;
}

.ht-page-loading-bar {
    background: linear-gradient(90deg, var(--ht-primary), var(--ht-accent)) !important;
}

/* =========================================================
   FINAL BRAND COLOR AUTHORITY
   Keep this at the end. It wins over older hardcoded teal/green/cyan rules.
   ========================================================= */

.ht-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-page-hero-v2 .ht-kicker,
.ht-page-hero-v2 > div .ht-kicker,
.ht-admin-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker,
.ht-admin-dashboard-v2 .ht-kicker,
.ht-topbar-kicker,
.ht-topbar .ht-kicker,
.ht-page-title-kicker,
[class*="kicker"] {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

.ht-page-hero-v2,
.ht-admin-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child,
.ht-auth-left {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob) 22%, transparent), transparent 22rem),
        radial-gradient(circle at 7% 98%, color-mix(in srgb, var(--ht-hero-blob-accent) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 58% 42%, color-mix(in srgb, var(--ht-hero-blob-third) 20%, transparent), transparent 26rem),
        linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--ht-hero-blob) 6%, #ffffff)) !important;
}

.ht-action-primary,
.ht-auth-submit,
.ht-page-hero-actions a.ht-action-primary,
.ht-page-hero-actions button.ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-form-actions .ht-action-primary,
.ht-settings-actions .ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
button[type="submit"].ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 55%, transparent) !important;
    box-shadow: 0 .7rem 1.7rem color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
}

.ht-action-primary:hover,
.ht-auth-submit:hover,
.ht-page-hero-actions a.ht-action-primary:hover,
.ht-page-hero-actions button.ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover {
    background: color-mix(in srgb, var(--ht-primary) 84%, #000) !important;
    color: #ffffff !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    color: #ffffff !important;
}

.ht-nav-link.active svg,
.ht-sidebar a.active svg,
.ht-sidebar .active svg {
    color: #ffffff !important;
    stroke: currentColor !important;
}

.ht-ticket-card-v2 .ht-ticket-id,
.ht-mini-code,
.ht-status-pill,
.ht-system-online-pill {
    border-color: color-mix(in srgb, var(--ht-primary) 30%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-primary) 9%, #ffffff) !important;
    color: color-mix(in srgb, var(--ht-primary) 80%, #111827) !important;
}

.ht-chip.good {
    background: color-mix(in srgb, var(--ht-primary) 12%, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 32%, #dbe5ef) !important;
    color: color-mix(in srgb, var(--ht-primary) 78%, #111827) !important;
}

.ht-chip.warn {
    background: color-mix(in srgb, var(--ht-accent) 16%, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-accent) 42%, #dbe5ef) !important;
    color: color-mix(in srgb, var(--ht-accent) 72%, #111827) !important;
}

.ht-page-loading-bar {
    background: linear-gradient(90deg, var(--ht-primary), var(--ht-accent)) !important;
}

/* Prevent old hero action button text from becoming low contrast */
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child {
    font-weight: 900 !important;
    text-shadow: none !important;
}

/* Dark mode uses the same brand variables, but on dark surfaces */
html.dark .ht-page-hero-v2,
html.dark .ht-admin-hero-v2,
html.dark .ht-client-dashboard > section:first-child,
html.dark .ht-client-dashboard-v2 > section:first-child {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob) 24%, transparent), transparent 22rem),
        radial-gradient(circle at 7% 98%, color-mix(in srgb, var(--ht-hero-blob-accent) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 58% 42%, color-mix(in srgb, var(--ht-hero-blob-third) 16%, transparent), transparent 26rem),
        linear-gradient(135deg, #0b1626, color-mix(in srgb, var(--ht-hero-blob) 8%, #0b1626)) !important;
}

/* =========================================================
   PHASE B FINAL SAFETY OVERRIDES
   Brand variables + dashboard/sidebar/table cutoff fixes.
   Keep this block at the very end.
   ========================================================= */

/* Prevent topbar/browser overlap from cutting the first dashboard section */
.ht-content {
    padding-top: clamp(1.15rem, 1.6vw, 1.9rem) !important;
}

.ht-admin-dashboard-v2,
.ht-page-v2,
.ht-client-dashboard,
.ht-client-dashboard-v2 {
    padding-top: .35rem !important;
}

/* Hero should never hide its own top content */
.ht-admin-hero-v2,
.ht-page-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child {
    position: relative !important;
    overflow: hidden !important;
    min-height: auto !important;
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob) 24%, transparent), transparent 22rem),
        radial-gradient(circle at 7% 98%, color-mix(in srgb, var(--ht-hero-blob-accent) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 58% 42%, color-mix(in srgb, var(--ht-hero-blob-third) 18%, transparent), transparent 26rem),
        linear-gradient(135deg, var(--ht-surface, #ffffff), color-mix(in srgb, var(--ht-hero-blob) 6%, var(--ht-surface, #ffffff))) !important;
}

html.dark .ht-admin-hero-v2,
html.dark .ht-page-hero-v2,
html.dark .ht-client-dashboard > section:first-child,
html.dark .ht-client-dashboard-v2 > section:first-child {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob) 26%, transparent), transparent 22rem),
        radial-gradient(circle at 7% 98%, color-mix(in srgb, var(--ht-hero-blob-accent) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 58% 42%, color-mix(in srgb, var(--ht-hero-blob-third) 14%, transparent), transparent 26rem),
        linear-gradient(135deg, #0b1626, color-mix(in srgb, var(--ht-hero-blob) 8%, #0b1626)) !important;
}

/* Kicker / small header label color */
.ht-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-page-hero-v2 .ht-kicker,
.ht-admin-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker,
.ht-admin-dashboard-v2 .ht-kicker,
.ht-topbar-title small,
.ht-topbar .ht-kicker,
[class*="kicker"] {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

/* Primary buttons and active sidebar items use chosen solid/gradient style */
.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-auth-submit,
.ht-form-actions .ht-action-primary,
.ht-settings-actions .ht-action-primary,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 45%, transparent) !important;
    text-shadow: none !important;
    box-shadow: 0 .75rem 1.7rem color-mix(in srgb, var(--ht-primary) 20%, transparent) !important;
}

.ht-action-primary:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover,
.ht-auth-submit:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    color: #ffffff !important;
}

/* Sidebar: stop status/help card from covering menu items */
.ht-sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: .85rem !important;
}

.ht-sidebar nav,
.ht-sidebar .ht-nav,
.ht-sidebar-menu {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-bottom: .65rem !important;
}

.ht-sidebar-card {
    flex: 0 0 auto !important;
    position: static !important;
    margin-top: .45rem !important;
    padding: .85rem 1rem !important;
    border-radius: 1.1rem !important;
}

.ht-sidebar-card-title {
    font-size: .9rem !important;
    line-height: 1.1 !important;
}

.ht-sidebar-card-text {
    font-size: .78rem !important;
    line-height: 1.25 !important;
}

.ht-sidebar-card .ht-status-pill {
    min-height: 1.65rem !important;
    padding: .35rem .75rem !important;
    font-size: .78rem !important;
}

/* Table/card safety: prevent narrow iPad/tablet crushing */
.ht-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.ht-clean-table {
    width: 100% !important;
    min-width: 760px !important;
    table-layout: auto !important;
}

.ht-clean-table th,
.ht-clean-table td {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    vertical-align: middle !important;
}

.ht-clean-table th {
    letter-spacing: .12em !important;
}

/* Dashboard cards: cleaner spacing and no crop */
.ht-activity-badges,
.ht-metrics-grid-v2,
.ht-admin-main-grid,
.ht-admin-lower-grid {
    width: 100% !important;
    max-width: 100% !important;
}

.ht-metric-card-v2,
.ht-activity-badge,
.ht-admin-health-card,
.ht-panel-v2 {
    overflow: hidden !important;
}

.ht-metric-card-v2 span,
.ht-activity-badge span {
    color: var(--ht-muted, #64748b) !important;
}

html.dark .ht-metric-card-v2 span,
html.dark .ht-activity-badge span {
    color: rgba(226, 232, 240, .74) !important;
}

@media (max-width: 1180px) {
    .ht-admin-hero-v2,
    .ht-page-hero-v2 {
        padding: 1.6rem !important;
    }

    .ht-admin-main-grid,
    .ht-admin-lower-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .ht-content {
        padding-top: 1rem !important;
    }

    .ht-clean-table {
        min-width: 680px !important;
    }
}

/* =========================================================
   ABSOLUTE FINAL BRAND AUTHORITY PATCH
   Fixes: admin hero buttons, hero blobs, topbar user chip/theme/logout contrast.
   Keep this as the last block.
   ========================================================= */

/* 1) Admin dashboard hero buttons were missed by earlier overrides */
.ht-admin-actions-v2 .ht-action-primary,
.ht-admin-actions-v2 a.ht-action-primary,
.ht-admin-actions-v2 button.ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a.ht-action-primary,
.ht-page-hero-actions button.ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-action-primary,
a.ht-action-primary,
button.ht-action-primary,
.ht-auth-submit,
.ht-settings-actions .ht-action-primary,
.ht-form-actions .ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    text-shadow: none !important;
    box-shadow: 0 .75rem 1.55rem color-mix(in srgb, var(--ht-primary) 20%, transparent) !important;
}

.ht-admin-actions-v2 .ht-action-primary:hover,
.ht-admin-actions-v2 a.ht-action-primary:hover,
.ht-admin-actions-v2 button.ht-action-primary:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover,
.ht-page-hero-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-action-primary:hover,
a.ht-action-primary:hover,
button.ht-action-primary:hover,
.ht-auth-submit:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
}

/* Secondary hero buttons should not accidentally become primary */
.ht-admin-actions-v2 .ht-action-secondary,
.ht-admin-actions-v2 a.ht-action-secondary,
.ht-page-hero-actions .ht-action-secondary,
.ht-page-hero-actions a.ht-action-secondary {
    background: var(--ht-surface, #ffffff) !important;
    background-image: none !important;
    color: var(--ht-heading, var(--ht-secondary-brand, #0f172a)) !important;
    border: 1px solid var(--ht-border, #dbe5ef) !important;
    box-shadow: none !important;
}

html.dark .ht-admin-actions-v2 .ht-action-secondary,
html.dark .ht-admin-actions-v2 a.ht-action-secondary,
html.dark .ht-page-hero-actions .ht-action-secondary,
html.dark .ht-page-hero-actions a.ht-action-secondary {
    background: color-mix(in srgb, var(--ht-surface, #0b1626) 88%, #ffffff 4%) !important;
    color: #e5eef8 !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

/* 2) Hero/blob authority, including pseudo-elements that were still leaking old cyan/teal */
.ht-admin-hero-v2,
.ht-page-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child,
.ht-auth-left {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 24%, transparent), transparent 22rem),
        radial-gradient(circle at 8% 98%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 56% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent), transparent 26rem),
        linear-gradient(135deg, var(--ht-surface, #ffffff), color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, var(--ht-surface, #ffffff))) !important;
    background-image:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 24%, transparent), transparent 22rem),
        radial-gradient(circle at 8% 98%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 56% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent), transparent 26rem),
        linear-gradient(135deg, var(--ht-surface, #ffffff), color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, var(--ht-surface, #ffffff))) !important;
}

.ht-admin-hero-v2::before,
.ht-page-hero-v2::before,
.ht-auth-left::before,
.ht-auth-shell::before {
    background:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 22%, transparent), transparent 66%) !important;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 22%, transparent), transparent 66%) !important;
}

.ht-admin-hero-v2::after,
.ht-page-hero-v2::after,
.ht-auth-left::after,
.ht-auth-shell::after {
    background:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 68%) !important;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 68%) !important;
}

html.dark .ht-admin-hero-v2,
html.dark .ht-page-hero-v2,
html.dark .ht-client-dashboard > section:first-child,
html.dark .ht-client-dashboard-v2 > section:first-child,
html.dark .ht-auth-left {
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 26%, transparent), transparent 22rem),
        radial-gradient(circle at 8% 98%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 56% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 14%, transparent), transparent 26rem),
        linear-gradient(135deg, #0b1626, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, #0b1626)) !important;
    background-image:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 26%, transparent), transparent 22rem),
        radial-gradient(circle at 8% 98%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 21rem),
        radial-gradient(circle at 56% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 14%, transparent), transparent 26rem),
        linear-gradient(135deg, #0b1626, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, #0b1626)) !important;
}

/* 3) Kicker/small header label authority */
.ht-page-kicker,
.ht-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-admin-hero-v2 .ht-kicker,
.ht-page-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker,
.ht-admin-dashboard-v2 .ht-kicker,
.ht-topbar .ht-page-kicker,
.ht-topbar .ht-kicker,
[class*="kicker"] {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

/* 4) Topbar user/theme/logout contrast fixes */
.ht-topbar {
    background: var(--ht-topbar, var(--ht-surface, #ffffff)) !important;
    color: var(--ht-heading, var(--ht-secondary-brand, #0f172a)) !important;
}

.ht-user-chip,
.ht-topbar-user,
.ht-topbar-btn,
.ht-theme-toggle,
.ht-logout-btn {
    background: color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-primary) 4%) !important;
    color: var(--ht-heading, var(--ht-secondary-brand, #0f172a)) !important;
    border: 1px solid color-mix(in srgb, var(--ht-primary) 16%, var(--ht-border, #dbe5ef)) !important;
}

.ht-user-avatar {
    background: color-mix(in srgb, var(--ht-primary) 14%, var(--ht-surface, #ffffff)) !important;
    color: var(--ht-primary) !important;
    border: 1px solid color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
}

.ht-user-meta strong,
.ht-user-chip strong,
.ht-topbar strong {
    color: var(--ht-heading, var(--ht-secondary-brand, #0f172a)) !important;
}

.ht-user-meta span,
.ht-user-chip span,
.ht-topbar .ht-page-title {
    color: var(--ht-muted, #64748b) !important;
}

.ht-topbar-btn:hover,
.ht-theme-toggle:hover,
.ht-logout-btn:hover {
    border-color: color-mix(in srgb, var(--ht-primary) 34%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-primary) 8%, var(--ht-surface, #ffffff)) !important;
}

html.dark .ht-topbar {
    background: var(--ht-topbar, #08111f) !important;
    color: #e5eef8 !important;
}

html.dark .ht-user-chip,
html.dark .ht-topbar-user,
html.dark .ht-topbar-btn,
html.dark .ht-theme-toggle,
html.dark .ht-logout-btn {
    background: color-mix(in srgb, #0b1626 86%, var(--ht-primary) 8%) !important;
    color: #e5eef8 !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

html.dark .ht-user-avatar {
    background: color-mix(in srgb, var(--ht-primary) 22%, #0b1626) !important;
    color: #ffffff !important;
    border-color: color-mix(in srgb, var(--ht-primary) 35%, transparent) !important;
}

html.dark .ht-user-meta strong,
html.dark .ht-user-chip strong,
html.dark .ht-topbar strong,
html.dark .ht-topbar-btn,
html.dark .ht-theme-toggle,
html.dark .ht-logout-btn {
    color: #e5eef8 !important;
}

html.dark .ht-user-meta span,
html.dark .ht-user-chip span,
html.dark .ht-topbar .ht-page-title {
    color: rgba(226, 232, 240, .72) !important;
}

/* 5) On bright primary colors, keep button text readable */
.ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-page-hero-actions a:first-child,
.ht-auth-submit {
    font-weight: 900 !important;
}


/* =========================================================
   FINAL LOGIN PAGE POLISH
   Fixes login button shadow/underline and forces left auth blob
   to use saved Brand > Hero Blob colors.
   Keep this block at the very end.
   ========================================================= */

/* Login page left panel: use brand blob colors, not old cyan-only glow */
.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left {
    background:
        radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 22%, transparent), transparent 24rem),
        radial-gradient(circle at 8% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 22rem),
        radial-gradient(circle at 52% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent), transparent 28rem),
        linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 5%, #ffffff)) !important;
    background-image:
        radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 22%, transparent), transparent 24rem),
        radial-gradient(circle at 8% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent), transparent 22rem),
        radial-gradient(circle at 52% 42%, color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent), transparent 28rem),
        linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 5%, #ffffff)) !important;
}

.ht-auth-left::before,
.ht-auth-shell::before {
    background:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 18%, transparent), transparent 68%) !important;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 18%, transparent), transparent 68%) !important;
}

.ht-auth-left::after,
.ht-auth-shell::after {
    background:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 16%, transparent), transparent 70%) !important;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 16%, transparent), transparent 70%) !important;
}

/* Remove old cyan underline/glow below login button */
.ht-auth-submit,
button.ht-auth-submit,
.auth-submit,
button[type="submit"].ht-auth-submit {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 42%, transparent) !important;
    box-shadow:
        0 .55rem 1.25rem color-mix(in srgb, var(--ht-primary) 18%, transparent) !important;
    text-shadow: none !important;
    isolation: isolate !important;
}

/* Kill pseudo underline/shadow from older auth button CSS */
.ht-auth-submit::before,
.ht-auth-submit::after,
button.ht-auth-submit::before,
button.ht-auth-submit::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Remove extra rule/line under submit area if old CSS added it */
.ht-auth-card form::after,
.ht-auth-card .ht-auth-form::after,
.ht-auth-card .ht-form-actions::after,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
}

/* Keep the divider below button subtle and neutral */
.ht-auth-divider,
.ht-auth-card hr,
.ht-auth-card .ht-auth-separator {
    border-color: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    background: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    box-shadow: none !important;
}

/* Button hover should stay clean, no underline glow */
.ht-auth-submit:hover,
button.ht-auth-submit:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .7rem 1.35rem color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
    transform: translateY(-1px);
}


/* =========================================================
   FINAL LOGIN OUTER BACKGROUND FIX
   Fixes the far-left browser/page glow outside the auth panel.
   Keep this as the last block.
   ========================================================= */

html:has(.ht-auth-shell),
body:has(.ht-auth-shell) {
    background:
        radial-gradient(circle at 0% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 9%, transparent), transparent 18rem),
        radial-gradient(circle at 100% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 8%, transparent), transparent 20rem),
        linear-gradient(135deg, #f8fbff, color-mix(in srgb, var(--ht-hero-blob-third, #ecfeff) 8%, #ffffff)) !important;
}

.ht-auth-shell,
body .ht-auth-shell,
html body .ht-auth-shell {
    background:
        radial-gradient(circle at 0% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 7%, transparent), transparent 16rem),
        radial-gradient(circle at 100% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 7%, transparent), transparent 18rem),
        linear-gradient(135deg, #f8fbff, color-mix(in srgb, var(--ht-hero-blob-third, #ecfeff) 7%, #ffffff)) !important;
    background-image:
        radial-gradient(circle at 0% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 7%, transparent), transparent 16rem),
        radial-gradient(circle at 100% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 7%, transparent), transparent 18rem),
        linear-gradient(135deg, #f8fbff, color-mix(in srgb, var(--ht-hero-blob-third, #ecfeff) 7%, #ffffff)) !important;
}

/* Main rounded login container should not leak the old cyan page background */
.ht-auth-shell > *,
.ht-auth-layout,
.ht-auth-page,
.ht-auth-wrap {
    background-color: transparent !important;
}

/* Left login panel: keep blob very soft so it does not look washed */
.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left {
    background:
        radial-gradient(circle at 90% 8%, color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent), transparent 24rem),
        radial-gradient(circle at 8% 92%, color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, transparent), transparent 22rem),
        radial-gradient(circle at 52% 42%, color-mix(in srgb, var(--ht-hero-blob-third, #ecfeff) 10%, transparent), transparent 28rem),
        linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--ht-hero-blob-third, #ecfeff) 5%, #ffffff)) !important;
}

/* If old pseudo blobs are causing the left edge color, neutralize them */
.ht-auth-shell::before,
.ht-auth-shell::after {
    opacity: .35 !important;
    filter: blur(12px) !important;
}


/* =========================================================
   FINAL GLOBAL BUTTON SHADOW AUTHORITY
   Removes old hardcoded blue/cyan glow from all primary buttons.
   Keep this block at the very end.
   ========================================================= */

.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-auth-submit,
button.ht-auth-submit,
.ht-settings-actions .ht-action-primary,
.ht-form-actions .ht-action-primary,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-admin-actions-v2 .ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary,
button[type="submit"].ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 42%, transparent) !important;

    /* This is the important part: kill old hardcoded glow. */
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

.ht-action-primary:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover,
.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-settings-actions .ht-action-primary:hover,
.ht-form-actions .ht-action-primary:hover,
.ht-page-hero-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-admin-actions-v2 .ht-action-primary:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover,
.ht-side-actions .ht-action-primary:hover,
.ht-services-filter-bar .ht-action-primary:hover,
button[type="submit"].ht-action-primary:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    filter: none !important;
    transform: translateY(-1px);
}

/* Kill pseudo-element glow/underline from old button styles */
.ht-action-primary::before,
.ht-action-primary::after,
button.ht-action-primary::before,
button.ht-action-primary::after,
a.ht-action-primary::before,
a.ht-action-primary::after,
.ht-auth-submit::before,
.ht-auth-submit::after,
.ht-page-hero-actions a:first-child::before,
.ht-page-hero-actions a:first-child::after,
.ht-admin-actions-v2 a:first-child::before,
.ht-admin-actions-v2 a:first-child::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Active sidebar item should use brand color without extra glow */
.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    background-image: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Topbar chips/buttons: remove accidental glow but keep border */
.ht-topbar-btn,
.ht-user-chip,
.ht-theme-toggle,
.ht-logout-btn {
    box-shadow: none !important;
    filter: none !important;
}


/* =========================================================
   FINAL DYNAMIC GLOW AUTHORITY
   Keep glow, but make it follow Brand > Primary/Accent colors.
   This intentionally comes AFTER the no-shadow cleanup.
   ========================================================= */

/* Global primary button glow */
.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-admin-actions-v2 .ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child,
.ht-settings-actions .ht-action-primary,
.ht-form-actions .ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary,
button[type="submit"].ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    box-shadow:
        0 .65rem 1.45rem color-mix(in srgb, var(--ht-primary) 22%, transparent),
        0 .15rem .35rem color-mix(in srgb, var(--ht-primary) 20%, transparent) !important;
    filter: none !important;
    text-shadow: none !important;
}

.ht-action-primary:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover,
.ht-page-hero-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-admin-actions-v2 .ht-action-primary:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover,
.ht-settings-actions .ht-action-primary:hover,
.ht-form-actions .ht-action-primary:hover,
.ht-side-actions .ht-action-primary:hover,
.ht-services-filter-bar .ht-action-primary:hover,
button[type="submit"].ht-action-primary:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .8rem 1.75rem color-mix(in srgb, var(--ht-primary) 28%, transparent),
        0 .2rem .5rem color-mix(in srgb, var(--ht-accent) 16%, transparent) !important;
    transform: translateY(-1px);
}

/* Login button has its own CSS, so force it separately */
.ht-auth-submit,
button.ht-auth-submit,
.ht-auth-card button[type="submit"],
.ht-auth-card .ht-auth-submit,
.ht-auth-card form button[type="submit"] {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    box-shadow:
        0 .7rem 1.5rem color-mix(in srgb, var(--ht-primary) 24%, transparent),
        0 .18rem .45rem color-mix(in srgb, var(--ht-accent) 14%, transparent) !important;
    filter: none !important;
    text-shadow: none !important;
    overflow: hidden !important;
}

/* If old login button uses pseudo glow, make that glow dynamic instead of cyan */
.ht-auth-submit::before,
button.ht-auth-submit::before,
.ht-auth-card button[type="submit"]::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: -45% !important;
    pointer-events: none !important;
    opacity: .28 !important;
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--ht-accent) 42%, transparent), transparent 34%),
        radial-gradient(circle at 75% 75%, color-mix(in srgb, var(--ht-primary) 38%, transparent), transparent 38%) !important;
    box-shadow: none !important;
    filter: blur(14px) !important;
    z-index: -1 !important;
}

/* Kill only the unwanted underline/bar pseudo element, not the glow */
.ht-auth-submit::after,
button.ht-auth-submit::after,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Login button hover dynamic glow */
.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover,
.ht-auth-card .ht-auth-submit:hover,
.ht-auth-card form button[type="submit"]:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .85rem 1.85rem color-mix(in srgb, var(--ht-primary) 30%, transparent),
        0 .2rem .55rem color-mix(in srgb, var(--ht-accent) 18%, transparent) !important;
    transform: translateY(-1px);
}

/* The line under login button should be neutral, not cyan/blue */
.ht-auth-card hr,
.ht-auth-divider,
.ht-auth-separator,
.ht-auth-card .ht-auth-divider,
.ht-auth-card .ht-auth-separator {
    border-color: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    background: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    box-shadow: none !important;
}

/* Active sidebar should also keep a very soft dynamic glow */
.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    background-image: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    color: #ffffff !important;
    box-shadow:
        0 .55rem 1.15rem color-mix(in srgb, var(--ht-primary) 20%, transparent) !important;
}


/* =========================================================
   FINAL AUTH PAGE COLOR AUTHORITY
   This must stay at the VERY END.
   Fixes:
   1) hardcoded cyan left/back auth blob
   2) hardcoded login button glow/pseudo underline
   3) keeps glow dynamic using saved Brand colors
   ========================================================= */

/* Whole login page background: no old var(--ht-primary) cyan */
html:has(.ht-auth-page),
body:has(.ht-auth-page),
.ht-auth-page {
    background:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent),
            transparent 20rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 9%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 50% 50%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 7%, transparent),
            transparent 28rem
        ),
        var(--ht-bg, #f5f9fc) !important;
    background-image:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent),
            transparent 20rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 9%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 50% 50%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 7%, transparent),
            transparent 28rem
        ) !important;
}

/* Auth shell/card background: keep subtle, dynamic, no hardcoded cyan */
.ht-auth-shell,
body .ht-auth-shell,
html body .ht-auth-shell {
    background:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, transparent),
            transparent 18rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 6%, transparent),
            transparent 20rem
        ),
        linear-gradient(135deg,
            var(--ht-surface, #ffffff),
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 5%, var(--ht-surface, #ffffff))
        ) !important;
    background-image:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, transparent),
            transparent 18rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 6%, transparent),
            transparent 20rem
        ),
        linear-gradient(135deg,
            var(--ht-surface, #ffffff),
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 5%, var(--ht-surface, #ffffff))
        ) !important;
}

/* Left login panel: dynamic brand blobs only */
.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left,
html body .ht-auth-left {
    background:
        radial-gradient(circle at 92% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 11%, transparent),
            transparent 24rem
        ),
        radial-gradient(circle at 8% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 54% 45%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 10%, transparent),
            transparent 28rem
        ),
        linear-gradient(135deg,
            #ffffff,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 5%, #ffffff)
        ) !important;
    background-image:
        radial-gradient(circle at 92% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 11%, transparent),
            transparent 24rem
        ),
        radial-gradient(circle at 8% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 54% 45%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 10%, transparent),
            transparent 28rem
        ),
        linear-gradient(135deg,
            #ffffff,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 5%, #ffffff)
        ) !important;
}

/* Stop pseudo blobs/underlines from old login button CSS */
.ht-auth-submit::before,
.ht-auth-submit::after,
button.ht-auth-submit::before,
button.ht-auth-submit::after,
.ht-auth-card button[type="submit"]::before,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Login button: keep glow, but use dynamic brand variables */
.ht-auth-submit,
button.ht-auth-submit,
.ht-auth-card .ht-auth-submit,
.ht-auth-card button[type="submit"],
.ht-auth-card form button[type="submit"] {
    position: relative !important;
    isolation: isolate !important;
    overflow: visible !important;
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    text-shadow: none !important;
    filter: none !important;
    box-shadow:
        0 .72rem 1.55rem color-mix(in srgb, var(--ht-primary) 24%, transparent),
        0 .18rem .48rem color-mix(in srgb, var(--ht-accent) 14%, transparent) !important;
}

.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card .ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover,
.ht-auth-card form button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .85rem 1.85rem color-mix(in srgb, var(--ht-primary) 30%, transparent),
        0 .22rem .58rem color-mix(in srgb, var(--ht-accent) 18%, transparent) !important;
}

/* Auth input/focus colors must follow selected brand */
.ht-auth-field input:focus,
.ht-auth-row input[type="checkbox"]:focus {
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 .24rem color-mix(in srgb, var(--ht-primary) 16%, transparent) !important;
}

.ht-auth-row a,
.ht-auth-kicker,
.ht-auth-card-head span {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}


.ht-auth-submit::after,
button.ht-auth-submit::after,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
}

.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .9rem 1.85rem color-mix(in srgb, var(--ht-primary) 30%, transparent),
        0 .22rem .55rem color-mix(in srgb, var(--ht-accent) 18%, transparent) !important;
}

.ht-auth-note,
.ht-auth-card hr,
.ht-auth-divider,
.ht-auth-separator {
    border-color: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    box-shadow: none !important;
}


/* =========================================================
   CLEAN FINAL AUTH BRAND COLORS
   Login/auth colors must follow saved Brand Settings only.
   No hardcoded cyan/teal fallbacks.
   ========================================================= */

.ht-auth-page,
body.ht-auth-page,
html body.ht-auth-page {
    background:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent),
            transparent 20rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 50% 50%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 7%, transparent),
            transparent 28rem
        ),
        var(--ht-bg, #f5f9fc) !important;
    background-image:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent),
            transparent 20rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 50% 50%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 7%, transparent),
            transparent 28rem
        ) !important;
}

.ht-auth-shell,
body .ht-auth-shell,
html body .ht-auth-shell {
    background:
        radial-gradient(circle at 0% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, transparent),
            transparent 18rem
        ),
        radial-gradient(circle at 100% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 6%, transparent),
            transparent 20rem
        ),
        linear-gradient(135deg,
            var(--ht-surface, #ffffff),
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 5%, var(--ht-surface, #ffffff))
        ) !important;
}

.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left,
html body .ht-auth-left {
    background:
        radial-gradient(circle at 88% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 18%, transparent),
            transparent 24rem
        ),
        radial-gradient(circle at 8% 92%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 16%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 52% 42%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent),
            transparent 28rem
        ),
        linear-gradient(135deg,
            #ffffff,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 7%, #ffffff)
        ) !important;
}

.ht-auth-kicker,
.ht-auth-card-head span,
.ht-auth-row a {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

.ht-auth-field input:focus,
.ht-auth-card input:focus,
.ht-auth-form input:focus,
.ht-auth-row input[type="checkbox"]:focus {
    border-color: var(--ht-primary) !important;
    box-shadow:
        0 0 0 .22rem color-mix(in srgb, var(--ht-primary) 18%, transparent),
        0 .45rem 1.15rem color-mix(in srgb, var(--ht-primary) 10%, transparent) !important;
    outline: none !important;
}

.ht-auth-submit,
button.ht-auth-submit,
.ht-auth-card .ht-auth-submit,
.ht-auth-card button[type="submit"],
.ht-auth-card form button[type="submit"] {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    box-shadow:
        0 .75rem 1.55rem color-mix(in srgb, var(--ht-primary) 24%, transparent),
        0 .18rem .45rem color-mix(in srgb, var(--ht-accent) 14%, transparent) !important;
    filter: none !important;
    text-shadow: none !important;
}

.ht-auth-submit::before,
.ht-auth-submit::after,
button.ht-auth-submit::before,
button.ht-auth-submit::after,
.ht-auth-card button[type="submit"]::before,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card .ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover,
.ht-auth-card form button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    color: #ffffff !important;
    box-shadow:
        0 .9rem 1.85rem color-mix(in srgb, var(--ht-primary) 30%, transparent),
        0 .22rem .55rem color-mix(in srgb, var(--ht-accent) 18%, transparent) !important;
}

.ht-auth-note,
.ht-auth-card hr,
.ht-auth-divider,
.ht-auth-separator {
    border-color: color-mix(in srgb, var(--ht-border, #dbe5ef) 82%, transparent) !important;
    box-shadow: none !important;
}

/* =========================================================
   FINAL AUTH BRAND GLOW RESTORE
   Keep the login alive/glowing, but use saved brand colors.
   No hardcoded cyan/teal.
   ========================================================= */

.ht-auth-page,
body.ht-auth-page,
html body.ht-auth-page {
    background:
        radial-gradient(circle at 4% 4%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 28%, transparent),
            transparent 24rem
        ),
        radial-gradient(circle at 100% 94%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 26%, transparent),
            transparent 24rem
        ),
        radial-gradient(circle at 48% 50%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 18%, transparent),
            transparent 34rem
        ),
        linear-gradient(135deg,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, #ffffff),
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 10%, #ffffff)
        ) !important;
}

.ht-auth-shell,
body .ht-auth-shell,
html body .ht-auth-shell {
    background:
        radial-gradient(circle at 8% 10%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 18%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 92% 88%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent),
            transparent 24rem
        ),
        linear-gradient(135deg,
            color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-hero-blob, var(--ht-primary))),
            color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-hero-blob-third, var(--ht-accent)))
        ) !important;
    box-shadow:
        0 2rem 5rem color-mix(in srgb, var(--ht-primary) 16%, transparent),
        0 .8rem 2rem rgba(15, 23, 42, .10) !important;
}

.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left,
html body .ht-auth-left {
    background:
        radial-gradient(circle at 80% 14%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 38%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 12% 88%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 30%, transparent),
            transparent 22rem
        ),
        radial-gradient(circle at 56% 48%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-accent)) 26%, transparent),
            transparent 30rem
        ),
        linear-gradient(135deg,
            #ffffff,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, #ffffff)
        ) !important;
}

.ht-auth-card {
    box-shadow:
        0 1.25rem 3.5rem rgba(15, 23, 42, .12),
        0 0 0 1px color-mix(in srgb, var(--ht-primary) 8%, transparent),
        0 1rem 3rem color-mix(in srgb, var(--ht-primary) 10%, transparent) !important;
}

.ht-auth-field input:focus,
.ht-auth-card input:focus,
.ht-auth-form input:focus {
    border-color: var(--ht-primary) !important;
    box-shadow:
        0 0 0 .22rem color-mix(in srgb, var(--ht-primary) 22%, transparent),
        0 .7rem 1.55rem color-mix(in srgb, var(--ht-primary) 14%, transparent) !important;
    outline: none !important;
}

.ht-auth-submit,
button.ht-auth-submit,
.ht-auth-card .ht-auth-submit,
.ht-auth-card button[type="submit"],
.ht-auth-card form button[type="submit"] {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image:
        radial-gradient(circle at 20% 15%,
            color-mix(in srgb, var(--ht-accent) 36%, transparent),
            transparent 38%
        ),
        linear-gradient(135deg,
            var(--ht-primary),
            color-mix(in srgb, var(--ht-primary) 78%, var(--ht-accent))
        ) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    box-shadow:
        0 .85rem 1.8rem color-mix(in srgb, var(--ht-primary) 34%, transparent),
        0 .2rem .6rem color-mix(in srgb, var(--ht-accent) 18%, transparent) !important;
    text-shadow: none !important;
    filter: none !important;
}

.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card .ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover,
.ht-auth-card form button[type="submit"]:hover {
    background-image:
        radial-gradient(circle at 20% 15%,
            color-mix(in srgb, var(--ht-accent) 42%, transparent),
            transparent 38%
        ),
        linear-gradient(135deg,
            color-mix(in srgb, var(--ht-primary) 88%, #000000),
            color-mix(in srgb, var(--ht-primary) 66%, var(--ht-accent))
        ) !important;
    box-shadow:
        0 1rem 2.1rem color-mix(in srgb, var(--ht-primary) 40%, transparent),
        0 .25rem .7rem color-mix(in srgb, var(--ht-accent) 24%, transparent) !important;
    transform: translateY(-1px) !important;
}

.ht-auth-status {
    background:
        radial-gradient(circle at 18% 20%,
            color-mix(in srgb, var(--ht-primary) 18%, transparent),
            transparent 45%
        ),
        color-mix(in srgb, #16a34a 13%, #ffffff) !important;
    box-shadow:
        0 .65rem 1.5rem color-mix(in srgb, #16a34a 16%, transparent) !important;
}

.ht-auth-features > div {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, #ffffff 92%, var(--ht-hero-blob, var(--ht-primary))),
            color-mix(in srgb, #ffffff 94%, var(--ht-hero-blob-third, var(--ht-accent)))
        ) !important;
    box-shadow:
        0 .6rem 1.6rem rgba(15, 23, 42, .055) !important;
}

/* =========================================================
   FINAL FORCE LOGIN ALIVE GLOW
   Uses actual brand colors:
   blue #0056d6, purple #982abc, gold #ffab01.
   This does NOT use the pale blob color #dbeafe.
   ========================================================= */

.ht-auth-page,
body.ht-auth-page,
html body.ht-auth-page {
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 86, 214, .24), transparent 28rem),
        radial-gradient(circle at 100% 100%, rgba(152, 42, 188, .22), transparent 30rem),
        radial-gradient(circle at 52% 45%, rgba(255, 171, 1, .18), transparent 34rem),
        linear-gradient(135deg, #f7fbff 0%, #ffffff 48%, #fff8e9 100%) !important;
}

.ht-auth-shell {
    position: relative !important;
    overflow: hidden !important;
    background:
        radial-gradient(circle at 4% 8%, rgba(0, 86, 214, .16), transparent 24rem),
        radial-gradient(circle at 98% 92%, rgba(152, 42, 188, .14), transparent 26rem),
        linear-gradient(135deg, #ffffff, #f8fbff) !important;
    box-shadow:
        0 2.2rem 5.5rem rgba(0, 86, 214, .18),
        0 1rem 2.5rem rgba(15, 23, 42, .13) !important;
}

.ht-auth-shell::before {
    content: "" !important;
    position: absolute !important;
    width: 30rem !important;
    height: 30rem !important;
    right: -12rem !important;
    top: -13rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(0, 86, 214, .28), transparent 66%) !important;
    filter: blur(14px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-auth-shell::after {
    content: "" !important;
    position: absolute !important;
    width: 28rem !important;
    height: 28rem !important;
    left: -12rem !important;
    bottom: -13rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(152, 42, 188, .24), transparent 66%) !important;
    filter: blur(16px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left {
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    background:
        radial-gradient(circle at 82% 10%, rgba(0, 86, 214, .34), transparent 21rem),
        radial-gradient(circle at 10% 88%, rgba(152, 42, 188, .28), transparent 23rem),
        radial-gradient(circle at 56% 48%, rgba(255, 171, 1, .24), transparent 28rem),
        linear-gradient(135deg, #ffffff 0%, #f4f8ff 52%, #fff7df 100%) !important;
}

.ht-auth-left::before {
    content: "" !important;
    position: absolute !important;
    width: 24rem !important;
    height: 24rem !important;
    right: -9rem !important;
    top: -8rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(0, 86, 214, .38), transparent 68%) !important;
    filter: blur(12px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-auth-left::after {
    content: "" !important;
    position: absolute !important;
    width: 22rem !important;
    height: 22rem !important;
    left: -9rem !important;
    bottom: -8rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(255, 171, 1, .30), transparent 68%) !important;
    filter: blur(14px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-auth-left > *,
.ht-auth-card,
.ht-auth-right {
    position: relative !important;
    z-index: 2 !important;
}

.ht-auth-card {
    background: rgba(255, 255, 255, .92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-shadow:
        0 1.4rem 3.8rem rgba(15, 23, 42, .14),
        0 0 0 1px rgba(0, 86, 214, .10),
        0 1rem 2.8rem rgba(0, 86, 214, .12) !important;
}

.ht-auth-field input:focus,
.ht-auth-card input:focus,
.ht-auth-form input:focus {
    border-color: #0056d6 !important;
    box-shadow:
        0 0 0 .24rem rgba(0, 86, 214, .20),
        0 .65rem 1.5rem rgba(0, 86, 214, .16) !important;
    outline: none !important;
}

.ht-auth-submit,
button.ht-auth-submit,
.ht-auth-card button[type="submit"],
.ht-auth-card .ht-auth-submit,
.ht-auth-card form button[type="submit"] {
    background: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    background-image: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow:
        0 .85rem 1.8rem rgba(0, 86, 214, .34),
        0 .25rem .75rem rgba(152, 42, 188, .22) !important;
    filter: none !important;
    text-shadow: none !important;
}

.ht-auth-submit::before,
.ht-auth-submit::after,
button.ht-auth-submit::before,
button.ht-auth-submit::after,
.ht-auth-card button[type="submit"]::before,
.ht-auth-card button[type="submit"]::after {
    content: none !important;
    display: none !important;
}

.ht-auth-submit:hover,
button.ht-auth-submit:hover,
.ht-auth-card button[type="submit"]:hover {
    background: linear-gradient(135deg, #004bc0 0%, #0f46d6 48%, #8520a7 100%) !important;
    background-image: linear-gradient(135deg, #004bc0 0%, #0f46d6 48%, #8520a7 100%) !important;
    box-shadow:
        0 1rem 2.1rem rgba(0, 86, 214, .42),
        0 .3rem .85rem rgba(152, 42, 188, .28) !important;
    transform: translateY(-1px) !important;
}

.ht-auth-kicker,
.ht-auth-card-head span,
.ht-auth-row a {
    color: #0056d6 !important;
}

.ht-auth-features > div {
    background:
        linear-gradient(135deg, rgba(255,255,255,.88), rgba(248,251,255,.88)) !important;
    box-shadow:
        0 .7rem 1.8rem rgba(0, 86, 214, .08) !important;
}

/* =========================================================
   FINAL ADMIN ALIVE GLOW
   Restores visible blue / purple / gold glow across admin area.
   Uses actual brand colors instead of pale blob setting.
   ========================================================= */

.ht-body,
body.ht-body {
    background:
        radial-gradient(circle at 4% 2%, rgba(0, 86, 214, .10), transparent 24rem),
        radial-gradient(circle at 98% 10%, rgba(152, 42, 188, .08), transparent 26rem),
        radial-gradient(circle at 70% 98%, rgba(255, 171, 1, .08), transparent 28rem),
        var(--ht-bg, #f5f9fc) !important;
}

.ht-content {
    background:
        radial-gradient(circle at 92% 4%, rgba(0, 86, 214, .08), transparent 22rem),
        radial-gradient(circle at 8% 88%, rgba(152, 42, 188, .06), transparent 24rem) !important;
}

.ht-admin-hero-v2,
.ht-page-hero-v2,
.ht-client-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child {
    position: relative !important;
    overflow: hidden !important;
    background:
        radial-gradient(circle at 92% 8%, rgba(0, 86, 214, .30), transparent 22rem),
        radial-gradient(circle at 8% 98%, rgba(152, 42, 188, .24), transparent 23rem),
        radial-gradient(circle at 56% 42%, rgba(255, 171, 1, .18), transparent 28rem),
        linear-gradient(135deg, #ffffff 0%, #f5f9ff 52%, #fff8e7 100%) !important;
    box-shadow:
        0 1.2rem 3.2rem rgba(0, 86, 214, .12),
        0 .65rem 1.8rem rgba(15, 23, 42, .08) !important;
}

.ht-admin-hero-v2::before,
.ht-page-hero-v2::before,
.ht-client-hero-v2::before {
    content: "" !important;
    position: absolute !important;
    width: 24rem !important;
    height: 24rem !important;
    right: -9rem !important;
    top: -10rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(0, 86, 214, .30), transparent 68%) !important;
    filter: blur(14px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-admin-hero-v2::after,
.ht-page-hero-v2::after,
.ht-client-hero-v2::after {
    content: "" !important;
    position: absolute !important;
    width: 23rem !important;
    height: 23rem !important;
    left: -9rem !important;
    bottom: -10rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(255, 171, 1, .24), transparent 68%) !important;
    filter: blur(16px) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    display: block !important;
}

.ht-admin-hero-v2 > *,
.ht-page-hero-v2 > *,
.ht-client-hero-v2 > * {
    position: relative !important;
    z-index: 2 !important;
}

.ht-metric-card-v2,
.ht-activity-badge,
.ht-admin-health-card,
.ht-health-card,
.ht-panel-v2,
.ht-card,
.ht-panel {
    background:
        radial-gradient(circle at 92% 8%, rgba(0, 86, 214, .055), transparent 14rem),
        radial-gradient(circle at 10% 100%, rgba(152, 42, 188, .045), transparent 15rem),
        var(--ht-surface, #ffffff) !important;
    box-shadow:
        0 .85rem 2.1rem rgba(15, 23, 42, .07),
        0 .35rem 1.2rem rgba(0, 86, 214, .045) !important;
    border-color: color-mix(in srgb, #0056d6 12%, var(--ht-border, #dbe5ef)) !important;
}

.ht-metric-card-v2:hover,
.ht-activity-badge:hover,
.ht-panel-v2:hover {
    box-shadow:
        0 1rem 2.5rem rgba(15, 23, 42, .09),
        0 .45rem 1.4rem rgba(0, 86, 214, .08) !important;
}

.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-admin-actions-v2 .ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-form-actions .ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary,
button[type="submit"].ht-action-primary {
    background: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    background-image: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    color: #ffffff !important;
    border-color: rgba(0, 86, 214, .35) !important;
    box-shadow:
        0 .75rem 1.6rem rgba(0, 86, 214, .26),
        0 .18rem .55rem rgba(152, 42, 188, .18) !important;
    text-shadow: none !important;
    filter: none !important;
}

.ht-action-primary:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover,
.ht-admin-actions-v2 .ht-action-primary:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover,
.ht-page-hero-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-form-actions .ht-action-primary:hover,
.ht-side-actions .ht-action-primary:hover,
.ht-services-filter-bar .ht-action-primary:hover,
button[type="submit"].ht-action-primary:hover {
    background: linear-gradient(135deg, #004bc0 0%, #0f46d6 48%, #8520a7 100%) !important;
    background-image: linear-gradient(135deg, #004bc0 0%, #0f46d6 48%, #8520a7 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 .9rem 1.9rem rgba(0, 86, 214, .34),
        0 .25rem .7rem rgba(152, 42, 188, .24) !important;
    transform: translateY(-1px) !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    background-image: linear-gradient(135deg, #0056d6 0%, #174fe8 52%, #982abc 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 .65rem 1.4rem rgba(0, 86, 214, .26),
        0 .18rem .5rem rgba(152, 42, 188, .18) !important;
}

.ht-sidebar {
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 86, 214, .16), transparent 18rem),
        radial-gradient(circle at 0% 100%, rgba(152, 42, 188, .10), transparent 18rem),
        var(--ht-sidebar-bg, var(--ht-surface, #ffffff)) !important;
}

.ht-topbar {
    background:
        radial-gradient(circle at 8% 0%, rgba(0, 86, 214, .075), transparent 18rem),
        radial-gradient(circle at 100% 20%, rgba(152, 42, 188, .055), transparent 18rem),
        var(--ht-topbar, var(--ht-surface, #ffffff)) !important;
    box-shadow:
        0 .7rem 1.8rem rgba(15, 23, 42, .045) !important;
}

.ht-user-chip,
.ht-topbar-btn,
.ht-theme-toggle,
.ht-logout-btn {
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(248,251,255,.94)) !important;
    border-color: rgba(0, 86, 214, .14) !important;
    box-shadow:
        0 .35rem 1rem rgba(0, 86, 214, .045) !important;
}

.ht-kicker,
.ht-page-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-admin-hero-v2 .ht-kicker,
.ht-page-hero-v2 .ht-kicker,
.ht-client-hero-v2 .ht-kicker,
.ht-panel-head .ht-kicker,
.ht-topbar .ht-kicker,
[class*="kicker"] {
    color: #0056d6 !important;
}

.ht-status-pill,
.ht-system-online-pill,
.ht-chip.good {
    background: rgba(0, 86, 214, .10) !important;
    border-color: rgba(0, 86, 214, .24) !important;
    color: #004bc0 !important;
}

/* Dark mode keeps glow but avoids pale washed-out panels */
html.dark .ht-admin-hero-v2,
html.dark .ht-page-hero-v2,
html.dark .ht-client-hero-v2,
html.dark .ht-client-dashboard > section:first-child,
html.dark .ht-client-dashboard-v2 > section:first-child {
    background:
        radial-gradient(circle at 92% 8%, rgba(0, 86, 214, .36), transparent 22rem),
        radial-gradient(circle at 8% 98%, rgba(152, 42, 188, .28), transparent 23rem),
        radial-gradient(circle at 56% 42%, rgba(255, 171, 1, .14), transparent 28rem),
        linear-gradient(135deg, #07111f 0%, #0b1626 58%, #111827 100%) !important;
}

html.dark .ht-metric-card-v2,
html.dark .ht-activity-badge,
html.dark .ht-admin-health-card,
html.dark .ht-health-card,
html.dark .ht-panel-v2,
html.dark .ht-card,
html.dark .ht-panel {
    background:
        radial-gradient(circle at 92% 8%, rgba(0, 86, 214, .12), transparent 14rem),
        radial-gradient(circle at 10% 100%, rgba(152, 42, 188, .08), transparent 15rem),
        var(--ht-surface, #0b1626) !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

html.dark .ht-sidebar {
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 86, 214, .20), transparent 18rem),
        radial-gradient(circle at 0% 100%, rgba(152, 42, 188, .14), transparent 18rem),
        var(--ht-sidebar-bg, #07111f) !important;
}

html.dark .ht-topbar {
    background:
        radial-gradient(circle at 8% 0%, rgba(0, 86, 214, .13), transparent 18rem),
        radial-gradient(circle at 100% 20%, rgba(152, 42, 188, .10), transparent 18rem),
        var(--ht-topbar, #08111f) !important;
}

html.dark .ht-user-chip,
html.dark .ht-topbar-btn,
html.dark .ht-theme-toggle,
html.dark .ht-logout-btn {
    background:
        linear-gradient(135deg, rgba(11,22,38,.95), rgba(15,23,42,.95)) !important;
    border-color: rgba(148, 163, 184, .25) !important;
}

/* === HT FIX: header corner clipping + invoice print fidelity === */

/*
   Fix pale/yellow glow bleeding outside rounded header corners.
   Keeps the glow, but clips it inside the panel instead of showing square/diagonal artifacts.
*/
.ht-page-hero,
.ht-hero,
.portal-hero,
.page-hero,
.payment-hero,
.invoice-hero,
.dashboard-hero,
.client-page-hero,
.admin-page-hero,
.main-page-hero,
[class*="hero"],
[class*="page-header"],
[class*="section-header"] {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-clip: padding-box;
}

.ht-page-hero::before,
.ht-page-hero::after,
.ht-hero::before,
.ht-hero::after,
.portal-hero::before,
.portal-hero::after,
.page-hero::before,
.page-hero::after,
.payment-hero::before,
.payment-hero::after,
.invoice-hero::before,
.invoice-hero::after,
.dashboard-hero::before,
.dashboard-hero::after,
.client-page-hero::before,
.client-page-hero::after,
.admin-page-hero::before,
.admin-page-hero::after,
.main-page-hero::before,
.main-page-hero::after {
    border-radius: inherit;
    pointer-events: none;
}

/*
   Screen invoice consistency.
*/
.invoice-card,
.invoice-document,
.invoice-sheet,
.invoice-wrapper,
.invoice-preview,
.print-invoice,
.printable-invoice,
[class*="invoice-card"],
[class*="invoice-document"],
[class*="invoice-sheet"] {
    background-clip: padding-box;
    overflow: hidden;
}

/*
   Print should match the real invoice screen layout:
   - header stays two-column
   - bill/info cards stay side-by-side
   - line items remain table/grid style
   - colors and borders print correctly
*/
@media print {
    @page {
        size: letter;
        margin: 10mm;
    }

    html,
    body {
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .no-print,
    .print-hidden,
    nav,
    aside,
    header.app-header,
    .sidebar,
    .topbar,
    .admin-topbar,
    .client-sidebar,
    .client-topbar,
    .portal-sidebar,
    .portal-topbar,
    button,
    .btn,
    [data-no-print] {
        display: none !important;
    }

    main,
    .app-main,
    .content,
    .content-area,
    .page-content,
    .client-content,
    .admin-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    .invoice-card,
    .invoice-document,
    .invoice-sheet,
    .invoice-wrapper,
    .invoice-preview,
    .print-invoice,
    .printable-invoice,
    [class*="invoice-card"],
    [class*="invoice-document"],
    [class*="invoice-sheet"] {
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto !important;
        padding: 28px !important;
        background: #ffffff !important;
        border-radius: 20px !important;
        box-shadow: none !important;
        overflow: hidden !important;
        page-break-inside: avoid;
    }

    .invoice-header,
    .invoice-top,
    .invoice-title-row,
    .invoice-heading,
    [class*="invoice-header"],
    [class*="invoice-top"],
    [class*="invoice-title"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: start !important;
        gap: 24px !important;
        text-align: left !important;
    }

    .invoice-header > :last-child,
    .invoice-top > :last-child,
    .invoice-title-row > :last-child,
    .invoice-heading > :last-child {
        text-align: right !important;
    }

    .invoice-two-col,
    .invoice-meta-grid,
    .invoice-details-grid,
    .invoice-info-grid,
    .bill-info-grid,
    .invoice-summary-grid,
    [class*="invoice-grid"],
    [class*="bill-info"],
    [class*="details-grid"],
    [class*="meta-grid"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 16px !important;
        align-items: stretch !important;
    }

    table,
    .invoice-table,
    .line-items-table,
    [class*="invoice-table"],
    [class*="line-items"] table {
        display: table !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
    }

    tr {
        display: table-row !important;
        page-break-inside: avoid !important;
    }

    th,
    td {
        display: table-cell !important;
    }

    .invoice-mobile-lines,
    .mobile-invoice-lines,
    .mobile-line-items,
    [class*="mobile-line"] {
        display: none !important;
    }

    .invoice-desktop-table,
    .desktop-invoice-table,
    [class*="desktop-table"] {
        display: table !important;
    }

    .invoice-total-box,
    .invoice-totals,
    .totals-box,
    [class*="invoice-total"],
    [class*="totals"] {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .invoice-footer,
    [class*="invoice-footer"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 20px !important;
    }
}
/* === END HT FIX === */

/* === HT FIX FINAL: invoice print real table layout === */
@media print {
    /*
      Stop responsive/mobile invoice row behavior from leaking into print.
      This fixes:
      Qty1
      Unit Price$1,234.00
      Line Total$1,234.00
    */

    .invoice-card,
    .invoice-document,
    .invoice-sheet,
    .invoice-wrapper,
    .print-invoice,
    .printable-invoice {
        max-width: none !important;
        width: 100% !important;
    }

    .invoice-header,
    .invoice-top,
    .invoice-title-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: start !important;
        gap: 28px !important;
    }

    .invoice-header > *:last-child,
    .invoice-top > *:last-child,
    .invoice-title-row > *:last-child {
        text-align: right !important;
    }

    .invoice-meta-grid,
    .invoice-details-grid,
    .invoice-info-grid,
    .bill-info-grid,
    .invoice-two-col {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }

    table,
    table.invoice-table,
    table.line-items-table,
    .invoice-table,
    .line-items-table {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
    }

    tr {
        display: table-row !important;
    }

    th,
    td {
        display: table-cell !important;
        vertical-align: top !important;
        white-space: normal !important;
    }

    th:nth-child(1),
    td:nth-child(1) {
        width: 52% !important;
        text-align: left !important;
    }

    th:nth-child(2),
    td:nth-child(2) {
        width: 12% !important;
        text-align: center !important;
    }

    th:nth-child(3),
    td:nth-child(3),
    th:nth-child(4),
    td:nth-child(4) {
        width: 18% !important;
        text-align: right !important;
    }

    /*
      Hide mobile labels added by spans or data-label CSS.
    */
    td::before,
    td::after,
    .invoice-table td::before,
    .invoice-table td::after,
    .line-items-table td::before,
    .line-items-table td::after {
        content: none !important;
        display: none !important;
    }

    td [class*="label"],
    td .mobile-label,
    td .print-label,
    td .cell-label,
    td .field-label,
    .invoice-table .mobile-label,
    .line-items-table .mobile-label {
        display: none !important;
    }

    /*
      If the blade uses div-grid line items instead of a real table,
      force it back into 4 clean columns.
    */
    .invoice-line-grid,
    .invoice-line-header,
    .invoice-line-row,
    .line-item-grid,
    .line-item-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1.6fr) 90px 150px 150px !important;
        align-items: start !important;
        gap: 0 !important;
    }

    .invoice-line-grid > *,
    .invoice-line-header > *,
    .invoice-line-row > *,
    .line-item-grid > *,
    .line-item-row > * {
        min-width: 0 !important;
    }

    .invoice-line-grid > :nth-child(2),
    .invoice-line-header > :nth-child(2),
    .invoice-line-row > :nth-child(2),
    .line-item-grid > :nth-child(2),
    .line-item-row > :nth-child(2) {
        text-align: center !important;
    }

    .invoice-line-grid > :nth-child(3),
    .invoice-line-grid > :nth-child(4),
    .invoice-line-header > :nth-child(3),
    .invoice-line-header > :nth-child(4),
    .invoice-line-row > :nth-child(3),
    .invoice-line-row > :nth-child(4),
    .line-item-grid > :nth-child(3),
    .line-item-grid > :nth-child(4),
    .line-item-row > :nth-child(3),
    .line-item-row > :nth-child(4) {
        text-align: right !important;
    }

    .invoice-line-row [data-label]::before,
    .line-item-row [data-label]::before,
    .invoice-line-row [data-label]::after,
    .line-item-row [data-label]::after {
        content: none !important;
        display: none !important;
    }
}
/* === END HT FIX FINAL === */

/* === HT FIX: invoice print final desktop match === */
@media print {
    @page {
        size: letter;
        margin: 8mm;
    }

    html,
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .invoice-card,
    .invoice-document,
    .invoice-sheet,
    .invoice-wrapper,
    .invoice-preview,
    .print-invoice,
    .printable-invoice,
    [class*="invoice-card"],
    [class*="invoice-document"],
    [class*="invoice-sheet"] {
        width: 100% !important;
        max-width: 7.75in !important;
        margin: 0 auto !important;
        padding: 22px 28px !important;
        box-shadow: none !important;
        border-radius: 18px !important;
        background: #ffffff !important;
    }

    /*
      Force Bill To + Invoice Info to match the real screen layout.
    */
    .invoice-two-col,
    .invoice-meta-grid,
    .invoice-details-grid,
    .invoice-info-grid,
    .bill-info-grid,
    .invoice-bill-grid,
    .invoice-customer-grid,
    [class*="invoice-meta"],
    [class*="invoice-info-grid"],
    [class*="bill-info-grid"],
    [class*="bill-grid"],
    [class*="details-grid"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 16px !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    /*
      If the view uses generic stacked sections, catch the direct parent
      of the Bill To / Invoice Info cards and force it into two columns.
    */
    .invoice-card:has(.invoice-info-card),
    .invoice-document:has(.invoice-info-card),
    .invoice-sheet:has(.invoice-info-card) {
        container-type: inline-size;
    }

    .invoice-info-card,
    .bill-to-card,
    .invoice-bill-card,
    .invoice-customer-card,
    [class*="bill-to"],
    [class*="invoice-info-card"] {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
      Keep the top header like the screen:
      company block left, invoice title/status right.
    */
    .invoice-header,
    .invoice-top,
    .invoice-title-row,
    .invoice-heading,
    [class*="invoice-header"],
    [class*="invoice-top"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: start !important;
        gap: 28px !important;
        width: 100% !important;
        text-align: left !important;
    }

    .invoice-header > :last-child,
    .invoice-top > :last-child,
    .invoice-title-row > :last-child,
    .invoice-heading > :last-child {
        text-align: right !important;
        justify-self: end !important;
    }

    /*
      Reduce excessive vertical gaps so print fills the page like the screen.
    */
    .invoice-card hr,
    .invoice-document hr,
    .invoice-sheet hr {
        margin-top: 14px !important;
        margin-bottom: 16px !important;
    }

    .invoice-card section,
    .invoice-document section,
    .invoice-sheet section {
        margin-top: 12px !important;
        margin-bottom: 12px !important;
    }

    /*
      Keep table clean.
    */
    table.invoice-table,
    table.line-items-table,
    .invoice-table,
    .line-items-table {
        width: 100% !important;
        table-layout: fixed !important;
    }

    th:nth-child(1),
    td:nth-child(1) {
        width: 52% !important;
    }

    th:nth-child(2),
    td:nth-child(2) {
        width: 12% !important;
        text-align: center !important;
    }

    th:nth-child(3),
    td:nth-child(3),
    th:nth-child(4),
    td:nth-child(4) {
        width: 18% !important;
        text-align: right !important;
    }

    /*
      Footer matches the screen.
    */
    .invoice-footer,
    [class*="invoice-footer"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 18px !important;
    }
}
/* === END HT FIX === */

/* === HT FORCE FIX: invoice print Tailwind desktop grid === */
@media print {
    /*
      Tailwind md:grid-cols-2 can collapse in print preview depending on
      printable viewport width. Force invoice desktop sections manually.
    */

    .invoice-card .grid.grid-cols-1.md\:grid-cols-2,
    .invoice-document .grid.grid-cols-1.md\:grid-cols-2,
    .invoice-sheet .grid.grid-cols-1.md\:grid-cols-2,
    .print-invoice .grid.grid-cols-1.md\:grid-cols-2,
    .printable-invoice .grid.grid-cols-1.md\:grid-cols-2,
    [class*="invoice"] .grid.grid-cols-1.md\:grid-cols-2 {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
        align-items: stretch !important;
    }

    /*
      Catch the exact common Tailwind structure even if class order differs.
    */
    .invoice-card .grid[class*="grid-cols-1"][class*="md:grid-cols-2"],
    .invoice-document .grid[class*="grid-cols-1"][class*="md:grid-cols-2"],
    .invoice-sheet .grid[class*="grid-cols-1"][class*="md:grid-cols-2"],
    .print-invoice .grid[class*="grid-cols-1"][class*="md:grid-cols-2"],
    .printable-invoice .grid[class*="grid-cols-1"][class*="md:grid-cols-2"],
    [class*="invoice"] .grid[class*="grid-cols-1"][class*="md:grid-cols-2"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
        align-items: stretch !important;
    }

    /*
      If the Bill To / Invoice Info cards are inside a generic grid with
      two bordered rounded cards, force that parent grid into two columns.
    */
    .invoice-card .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)),
    .invoice-document .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)),
    .invoice-sheet .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)),
    .print-invoice .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)),
    .printable-invoice .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)),
    [class*="invoice"] .grid:has(> [class*="rounded"][class*="border"]):has(> [class*="rounded"][class*="border"]:nth-child(2)) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
        align-items: stretch !important;
    }

    /*
      Prevent those two cards from becoming narrow centered blocks.
    */
    .invoice-card .grid.grid-cols-1.md\:grid-cols-2 > *,
    .invoice-document .grid.grid-cols-1.md\:grid-cols-2 > *,
    .invoice-sheet .grid.grid-cols-1.md\:grid-cols-2 > *,
    .print-invoice .grid.grid-cols-1.md\:grid-cols-2 > *,
    .printable-invoice .grid.grid-cols-1.md\:grid-cols-2 > *,
    [class*="invoice"] .grid.grid-cols-1.md\:grid-cols-2 > * {
        width: auto !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        justify-self: stretch !important;
    }

    /*
      Keep invoice print close to screen width.
    */
    .invoice-card,
    .invoice-document,
    .invoice-sheet,
    .print-invoice,
    .printable-invoice,
    [class*="invoice-card"],
    [class*="invoice-document"],
    [class*="invoice-sheet"] {
        max-width: 8in !important;
        width: 100% !important;
    }
}
/* === END HT FORCE FIX === */


/* === HT MOBILE FIX: global portal overflow containment === */
@media (max-width: 640px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box !important;
    }

    body,
    main,
    section,
    article,
    header,
    footer,
    form,
    .app-main,
    .main-content,
    .page-content,
    .content,
    .content-area,
    .client-content,
    .admin-content,
    .portal-content,
    .dashboard-content,
    .auth-card,
    .login-card,
    .portal-card,
    .client-card,
    .admin-card,
    .ht-card,
    .card {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    img,
    svg,
    video,
    canvas,
    iframe {
        max-width: 100% !important;
        height: auto;
    }

    table {
        max-width: 100% !important;
    }

    /*
      Main page shells: remove desktop left/right spacing that squeezes mobile.
    */
    .min-h-screen,
    .client-shell,
    .admin-shell,
    .portal-shell,
    .app-shell,
    [class*="min-h-screen"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    /*
      Tailwind containers/cards often keep desktop widths.
    */
    .container,
    .mx-auto,
    [class*="max-w-"],
    [class*="w-["],
    [class*="min-w-"] {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /*
      Prevent long titles/customer IDs/emails from pushing the viewport.
    */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    a,
    span,
    div,
    strong,
    small,
    label,
    td,
    th {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .whitespace-nowrap,
    .text-nowrap,
    [class*="whitespace-nowrap"],
    [class*="text-nowrap"] {
        white-space: normal !important;
    }

    /*
      Force dashboard/admin grids to stack cleanly on phones.
      This fixes cards being half cut off horizontally.
    */
    .grid,
    [class*="grid-cols-"],
    [class*="md:grid-cols-"],
    [class*="lg:grid-cols-"],
    [class*="xl:grid-cols-"] {
        min-width: 0 !important;
    }

    .grid[class*="grid-cols-"],
    [class*="md:grid-cols-"],
    [class*="lg:grid-cols-"],
    [class*="xl:grid-cols-"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    /*
      Some KPI rows are better as horizontal scroll than broken clipping.
    */
    .stats-grid,
    .kpi-grid,
    .metric-grid,
    .dashboard-grid,
    .summary-grid,
    [class*="stats"],
    [class*="kpi"],
    [class*="metric"] {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /*
      Forms/buttons must fit the phone width.
    */
    input,
    select,
    textarea,
    button,
    .btn,
    [type="submit"],
    [class*="button"] {
        max-width: 100% !important;
    }

    input,
    select,
    textarea {
        width: 100% !important;
        min-width: 0 !important;
    }

    .btn,
    button,
    [type="submit"] {
        white-space: normal !important;
    }

    /*
      Header/action button rows should wrap instead of forcing overflow.
    */
    .flex,
    [class*="flex"] {
        min-width: 0 !important;
    }

    .mobile-wrap,
    .action-row,
    .button-row,
    .page-actions,
    .header-actions,
    .top-actions,
    [class*="actions"] {
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }

    /*
      Login / welcome screens.
    */
    .login-shell,
    .auth-shell,
    .portal-login,
    .client-login,
    .admin-login,
    [class*="login"],
    [class*="auth"] {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .login-card,
    .auth-card,
    [class*="login-card"],
    [class*="auth-card"] {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /*
      Large hero headings were being clipped on iPhone 4/SE.
    */
    .hero,
    .page-hero,
    .portal-hero,
    .client-hero,
    .admin-hero,
    [class*="hero"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .hero h1,
    .page-hero h1,
    .portal-hero h1,
    .client-hero h1,
    .admin-hero h1,
    [class*="hero"] h1 {
        font-size: clamp(1.8rem, 10vw, 2.45rem) !important;
        line-height: 0.98 !important;
        letter-spacing: -0.06em !important;
        max-width: 100% !important;
    }

    /*
      Mobile sidebar/menu button should not sit on top of content.
    */
    .mobile-menu-button,
    .hamburger,
    [class*="hamburger"],
    [class*="mobile-menu"] {
        z-index: 60 !important;
    }

    /*
      Tables/receipt/invoice listings should scroll inside, not break the page.
    */
    .table-wrap,
    .overflow-x-auto,
    [class*="table"],
    [class*="invoice-table"],
    [class*="receipt-table"] {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 380px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: clamp(1.75rem, 10vw, 2.2rem) !important;
    }

    .login-card,
    .auth-card,
    [class*="login-card"],
    [class*="auth-card"] {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .px-8,
    .px-10,
    .px-12,
    .p-8,
    .p-10,
    .p-12 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
/* === END HT MOBILE FIX === */


/* === HT MOBILE FIX 2: cards + readable tables === */
@media (max-width: 640px) {
    /*
      Stop cards from becoming horizontal sliders/cut-off panels.
    */
    .stats-grid,
    .kpi-grid,
    .metric-grid,
    .summary-grid,
    .dashboard-grid,
    .admin-stats,
    .client-stats,
    .service-stats,
    .customer-stats,
    [class*="stats-grid"],
    [class*="kpi-grid"],
    [class*="metric-grid"],
    [class*="summary-grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .stats-grid > *,
    .kpi-grid > *,
    .metric-grid > *,
    .summary-grid > *,
    .dashboard-grid > *,
    .admin-stats > *,
    .client-stats > *,
    .service-stats > *,
    .customer-stats > *,
    [class*="stats-grid"] > *,
    [class*="kpi-grid"] > *,
    [class*="metric-grid"] > *,
    [class*="summary-grid"] > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }

    /*
      Any card in admin/client content should fit viewport.
    */
    .admin-content .rounded-3xl,
    .client-content .rounded-3xl,
    .admin-content .rounded-2xl,
    .client-content .rounded-2xl,
    .admin-content .card,
    .client-content .card,
    .portal-content .card,
    .admin-content [class*="card"],
    .client-content [class*="card"] {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /*
      Fix giant hero/customer names on iPhone.
    */
    .admin-content h1,
    .client-content h1,
    .portal-content h1,
    .customer-profile h1,
    .customer-hero h1,
    .service-hero h1,
    [class*="customer"] h1,
    [class*="service"] h1 {
        font-size: clamp(1.85rem, 9vw, 2.6rem) !important;
        line-height: 1.02 !important;
        letter-spacing: -0.055em !important;
        overflow-wrap: anywhere !important;
    }

    /*
      Main fix for service records:
      Never squeeze tables into tiny mobile columns.
      Convert rows into readable cards.
    */
    .admin-content table,
    .client-content table,
    .portal-content table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .admin-content thead,
    .client-content thead,
    .portal-content thead {
        display: none !important;
    }

    .admin-content tbody,
    .client-content tbody,
    .portal-content tbody {
        display: block !important;
        width: 100% !important;
    }

    .admin-content tr,
    .client-content tr,
    .portal-content tr {
        display: block !important;
        width: 100% !important;
        margin: 0 0 14px 0 !important;
        padding: 14px !important;
        border: 1px solid rgba(148, 163, 184, 0.35) !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.82) !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
    }

    .admin-content td,
    .client-content td,
    .portal-content td {
        display: grid !important;
        grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1.25fr) !important;
        gap: 10px !important;
        align-items: start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 8px 0 !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    .admin-content td::before,
    .client-content td::before,
    .portal-content td::before {
        content: attr(data-label);
        font-size: 0.68rem !important;
        line-height: 1.1 !important;
        font-weight: 900 !important;
        letter-spacing: 0.11em !important;
        text-transform: uppercase !important;
        color: #64748b !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    /*
      If a td has no data-label, avoid blank label space.
    */
    .admin-content td:not([data-label]),
    .client-content td:not([data-label]),
    .portal-content td:not([data-label]) {
        display: block !important;
    }

    /*
      Buttons inside mobile table rows.
    */
    .admin-content td a,
    .admin-content td button,
    .client-content td a,
    .client-content td button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
    }

    /*
      Prevent any individual stat/table value from becoming vertical letters.
    */
    .admin-content td *,
    .client-content td *,
    .portal-content td *,
    .admin-content th *,
    .client-content th *,
    .portal-content th * {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        writing-mode: horizontal-tb !important;
    }

    /*
      Left floating hamburger was overlapping content too much.
    */
    .mobile-menu-button,
    .hamburger,
    [class*="hamburger"] {
        position: fixed !important;
        left: 12px !important;
        bottom: 18px !important;
        top: auto !important;
        z-index: 80 !important;
    }

    /*
      Page padding should not push content off screen.
    */
    .admin-content,
    .client-content,
    .portal-content,
    main {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}
/* === END HT MOBILE FIX 2 === */

/* === HT EXACT MOBILE FIX: admin services stat cards === */
@media (max-width: 640px) {
    /*
      Services page stat cards were staying in a desktop row and squeezing
      the first card into vertical letters. Stack them on mobile.
    */
    .ht-services-mobile-stats {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .ht-services-mobile-stats > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        transform: none !important;
        overflow: hidden !important;
    }

    .ht-services-mobile-stats * {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    .ht-services-mobile-stats h1,
    .ht-services-mobile-stats h2,
    .ht-services-mobile-stats h3,
    .ht-services-mobile-stats p,
    .ht-services-mobile-stats span,
    .ht-services-mobile-stats div {
        max-width: 100% !important;
    }

    /*
      Keep the mobile floating menu away from stat cards.
    */
    .mobile-menu-button,
    .hamburger,
    [class*="hamburger"] {
        left: 14px !important;
        bottom: 18px !important;
        top: auto !important;
        z-index: 80 !important;
    }
}
/* === END HT EXACT MOBILE FIX === */

/* =========================================================
   FINAL MOBILE COMPACT UI OVERRIDES
   - compact stats pills/cards
   - compact portal/system status
   - cleaner mobile spacing
   ========================================================= */
@media (max-width: 767px) {
    .ht-stat-card,
    .ht-dashboard-stat,
    .ht-kpi-card,
    .ht-metric-card,
    .ht-portal-stat,
    .stat-card,
    .dashboard-stat {
        padding: .75rem .85rem !important;
        border-radius: 1rem !important;
        min-height: auto !important;
        gap: .35rem !important;
    }

    .ht-stat-card *,
    .ht-dashboard-stat *,
    .ht-kpi-card *,
    .ht-metric-card *,
    .ht-portal-stat *,
    .stat-card *,
    .dashboard-stat * {
        line-height: 1.15 !important;
    }

    .ht-stat-card .text-3xl,
    .ht-stat-card .text-4xl,
    .ht-dashboard-stat .text-3xl,
    .ht-dashboard-stat .text-4xl,
    .ht-kpi-card .text-3xl,
    .ht-kpi-card .text-4xl,
    .ht-metric-card .text-3xl,
    .ht-metric-card .text-4xl,
    .text-3xl,
    .text-4xl {
        font-size: 1.35rem !important;
    }

    .ht-status-pill,
    .status-pill,
    .portal-status,
    .ht-portal-status,
    .ht-sidebar-help-system,
    .ht-sidebar-card {
        font-size: .72rem !important;
        line-height: 1.1 !important;
        padding: .38rem .55rem !important;
        border-radius: 999px !important;
        min-height: auto !important;
        width: auto !important;
        max-width: 100% !important;
    }

    .ht-sidebar-help-system {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: .45rem !important;
        margin: .55rem 0 !important;
    }

    .ht-sidebar-help-system .ht-status-pill,
    .ht-sidebar-card .ht-status-pill {
        display: inline-flex !important;
        align-items: center !important;
        gap: .35rem !important;
        white-space: nowrap !important;
    }

    .ht-status-pill i,
    .portal-status i,
    .ht-portal-status i,
    .ht-sidebar-help-system i {
        width: .45rem !important;
        height: .45rem !important;
        min-width: .45rem !important;
        border-radius: 999px !important;
    }

    main,
    .ht-page,
    .ht-main,
    .ht-content,
    .portal-main,
    .portal-content {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

    .grid,
    .ht-grid,
    .ht-dashboard-grid,
    .ht-stats-grid {
        gap: .75rem !important;
    }

    .rounded-3xl {
        border-radius: 1.1rem !important;
    }

    .p-6 {
        padding: 1rem !important;
    }

    .p-5 {
        padding: .9rem !important;
    }
}

/* =========================================================
   SAFE MOBILE RESET - fixes vertical text / overflow
   ========================================================= */
@media (max-width: 767px) {
    html, body {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    *, *::before, *::after {
        box-sizing: border-box !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
    }

    main,
    .ht-main,
    .ht-content,
    .ht-page,
    .ht-client-page,
    .ht-admin-page {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden !important;
    }

    .ht-client-main-grid,
    .ht-client-main-grid.lower,
    .ht-client-stats-grid,
    .ht-dashboard-grid,
    .ht-stats-grid,
    .ht-kpi-grid,
    .ht-summary-grid,
    .ht-metrics-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .ht-panel-v2,
    .ht-stat-v2,
    .ht-card,
    .ht-panel,
    .ht-form-card,
    .ht-admin-card,
    .ht-client-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 14px !important;
        border-radius: 18px !important;
        overflow: hidden !important;
    }

    .ht-stat-v2,
    .ht-stat-card,
    .ht-kpi-card,
    .ht-dashboard-stat,
    .ht-metric-card {
        min-height: auto !important;
    }

    .ht-stat-v2 *,
    .ht-stat-card *,
    .ht-kpi-card *,
    .ht-dashboard-stat *,
    .ht-metric-card *,
    .ht-panel-v2 * {
        max-width: 100% !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: normal !important;
    }

    .ht-stat-v2 strong,
    .ht-stat-card strong,
    .ht-kpi-card strong,
    .ht-dashboard-stat strong,
    .ht-metric-card strong {
        font-size: 24px !important;
        line-height: 1.05 !important;
        white-space: nowrap !important;
    }

    .ht-stat-v2 span,
    .ht-stat-card span,
    .ht-kpi-card span,
    .ht-dashboard-stat span,
    .ht-metric-card span {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .ht-panel-head {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    input,
    select,
    textarea {
        width: 100% !important;
    }

    .ht-status-pill,
    .ht-badge,
    .badge,
    .status-pill {
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        padding: 5px 9px !important;
        font-size: 11px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }
}

/* CLEAN FINAL: invoice stats and invoice totals mobile/tablet */
.invoice-summary,
.ht-invoice-summary,
.ht-invoice-totals,
.invoice-totals {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.invoice-summary *,
.ht-invoice-summary *,
.ht-invoice-totals *,
.invoice-totals * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid > .ht-metric-card-v2.ht-invoice-stat-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    writing-mode: horizontal-tb !important;
}

.ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid > .ht-metric-card-v2.ht-invoice-stat-card span,
.ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid > .ht-metric-card-v2.ht-invoice-stat-card strong,
.ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid > .ht-metric-card-v2.ht-invoice-stat-card p {
    display: block !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

@media (max-width: 1180px) {
    .ht-metrics-grid-v2.ht-metrics-3.ht-invoice-stats-grid {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   SHARED MOBILE LAYOUT LAYER
   Targets HogeyTech Portal v2 shared classes only
   ========================================================= */
@media (max-width: 900px) {
    .ht-page-hero-v2 {
        padding: 1.25rem !important;
        border-radius: 1.25rem !important;
        gap: 1rem !important;
    }

    .ht-page-hero-v2 h1 {
        font-size: clamp(2rem, 9vw, 3rem) !important;
        line-height: .95 !important;
    }

    .ht-page-hero-v2 p {
        font-size: 1rem !important;
        line-height: 1.35 !important;
        max-width: 100% !important;
    }

    .ht-page-hero-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
    }

    .ht-page-hero-actions > a,
    .ht-page-hero-actions > button,
    .ht-action-primary,
    .ht-action-secondary {
        width: 100% !important;
        justify-content: center !important;
        min-height: 3rem !important;
        padding: .85rem 1rem !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .ht-metrics-grid-v2,
    .ht-metrics-grid-v2.ht-metrics-3,
    .ht-metrics-grid-v2.ht-metrics-4 {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .ht-metric-card-v2 {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 1rem !important;
        border-radius: 1.1rem !important;
        overflow: hidden !important;
    }

    .ht-metric-card-v2 span,
    .ht-metric-card-v2 strong,
    .ht-metric-card-v2 p {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    .ht-metric-card-v2 span {
        font-size: .72rem !important;
        line-height: 1.15 !important;
        letter-spacing: .16em !important;
    }

    .ht-metric-card-v2 strong {
        display: block !important;
        font-size: 1.8rem !important;
        line-height: 1.05 !important;
        white-space: nowrap !important;
        margin-top: .45rem !important;
    }

    .ht-metric-card-v2 p {
        font-size: .9rem !important;
        line-height: 1.35 !important;
        margin-top: .5rem !important;
    }

    .ht-panel-v2 {
        padding: 1rem !important;
        border-radius: 1.15rem !important;
        overflow: hidden !important;
    }

    .ht-panel-head {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: .65rem !important;
    }

    .ht-panel-head h2 {
        font-size: 1.35rem !important;
        line-height: 1.1 !important;
    }

    .ht-form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
    }

    .ht-form-grid > *,
    .ht-form-field,
    .ht-panel-v2 input,
    .ht-panel-v2 select,
    .ht-panel-v2 textarea {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .ht-panel-v2 input,
    .ht-panel-v2 select,
    .ht-panel-v2 textarea {
        width: 100% !important;
    }

    .ht-table-wrap {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ht-clean-table {
        min-width: 680px !important;
    }
}

@media (min-width: 901px) {
    .ht-metrics-grid-v2.ht-metrics-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .ht-metrics-grid-v2.ht-metrics-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* =========================================================
   FORCE METRIC STACK OVERRIDES
   ========================================================= */
@media (max-width: 900px) {

    .ht-invoice-stats-grid,
    .ht-services-stats-mobile-stack,
    .ht-metrics-grid-v2.ht-metrics-3,
    .ht-metrics-grid-v2.ht-metrics-4 {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        overflow: visible !important;
    }

    .ht-invoice-stats-grid > *,
    .ht-services-stats-mobile-stack > *,
    .ht-metrics-grid-v2.ht-metrics-3 > *,
    .ht-metrics-grid-v2.ht-metrics-4 > * {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .ht-invoice-stat-card,
    .ht-metric-card-v2 {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        overflow: hidden !important;
    }

    .ht-invoice-stat-card *,
    .ht-metric-card-v2 * {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
}

/* EXACT: invoice create/edit totals box */
@media (max-width: 900px) {
    .ht-invoice-total-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        overflow: hidden !important;
    }

    .ht-invoice-total-box > div {
        display: grid !important;
        grid-template-columns: minmax(6rem, auto) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: .75rem !important;
        width: 100% !important;
    }

    .ht-invoice-total-box span,
    .ht-invoice-total-box label,
    .ht-invoice-total-box strong {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        line-height: 1.2 !important;
    }

    .ht-invoice-total-box input {
        width: 100% !important;
        min-width: 0 !important;
        height: 3rem !important;
        text-align: right !important;
    }

    .ht-invoice-total-box strong {
        text-align: right !important;
        white-space: nowrap !important;
    }
}

/* EXACT: client dashboard metric cards mobile */
@media (max-width: 900px) {
    .ht-client-dashboard-metrics {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .ht-client-dashboard-metrics > .ht-metric-card-v2 {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

/* GLOBAL: compact page hero v2 */
.ht-page-hero-v2 {
    padding: clamp(1.1rem, 2vw, 1.75rem) !important;
    gap: 1rem !important;
    min-height: auto !important;
}

.ht-page-hero-v2 h1 {
    font-size: clamp(2.35rem, 4.4vw, 3.6rem) !important;
    line-height: .92 !important;
    margin: 0 !important;
}

.ht-page-hero-v2 p {
    font-size: clamp(.95rem, 1.4vw, 1.1rem) !important;
    line-height: 1.35 !important;
    margin-top: .55rem !important;
    max-width: 48rem !important;
}

.ht-page-hero-actions {
    margin-top: .9rem !important;
    gap: .65rem !important;
}

.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions .ht-action-secondary,
.ht-page-hero-actions a,
.ht-page-hero-actions button {
    min-height: 2.85rem !important;
    padding: .75rem 1rem !important;
}

@media (max-width: 900px) {
    .ht-page-hero-v2 {
        padding: 1rem !important;
        border-radius: 1.1rem !important;
        gap: .75rem !important;
    }

    .ht-page-hero-v2 h1 {
        font-size: clamp(2rem, 8vw, 2.65rem) !important;
    }

    .ht-page-hero-v2 p {
        font-size: .95rem !important;
        line-height: 1.3 !important;
        margin-top: .45rem !important;
    }

    .ht-page-hero-actions {
        margin-top: .75rem !important;
    }

    .ht-page-hero-actions .ht-action-primary,
    .ht-page-hero-actions .ht-action-secondary,
    .ht-page-hero-actions a,
    .ht-page-hero-actions button {
        min-height: 2.65rem !important;
        padding: .65rem .85rem !important;
    }
}

/* Loading status chip */
.ht-page-loading-status {
    position: fixed;
    top: 1rem;
    left: 50%;
    z-index: 9999;
    transform: translateX(-50%) translateY(-.5rem);
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem 1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ht-surface, #ffffff) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--ht-primary) 22%, var(--ht-border, #dbe5ef));
    box-shadow: 0 .8rem 2rem rgba(15, 23, 42, .14);
    color: var(--ht-text, #0f172a);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    backdrop-filter: blur(12px);
}

.ht-page-loading-status.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ht-page-loading-status strong {
    font-size: .86rem;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .ht-page-loading-status {
        top: .75rem;
        max-width: calc(100vw - 1.5rem);
    }

    .ht-page-loading-status strong {
        max-width: 72vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* EXACT: admin dashboard stats mobile */
@media (max-width: 900px) {
    .ht-admin-dashboard-metrics {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .ht-admin-dashboard-metrics > .ht-metric-card-v2 {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: auto !important;
        padding: 1rem !important;
        overflow: hidden !important;
    }

    .ht-admin-dashboard-metrics > .ht-metric-card-v2 span,
    .ht-admin-dashboard-metrics > .ht-metric-card-v2 strong,
    .ht-admin-dashboard-metrics > .ht-metric-card-v2 p {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        max-width: 100% !important;
    }

    .ht-admin-dashboard-metrics > .ht-metric-card-v2 strong {
        white-space: nowrap !important;
        font-size: 1.8rem !important;
        line-height: 1.05 !important;
    }
}

/* FINAL: dynamic brand buttons inside invoice/payment detail side panels */
.ht-panel-v2 .ht-action-primary,
.ht-panel-v2 a.ht-action-primary,
.ht-panel-v2 button.ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-invoice-actions .ht-action-primary,
a[href*="/edit"].ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 55%, transparent) !important;
    box-shadow: 0 .7rem 1.55rem color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
}

.ht-panel-v2 .ht-action-primary:hover,
.ht-panel-v2 a.ht-action-primary:hover,
.ht-panel-v2 button.ht-action-primary:hover,
.ht-side-actions .ht-action-primary:hover,
.ht-invoice-actions .ht-action-primary:hover,
a[href*="/edit"].ht-action-primary:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover)) !important;
}

/* FINAL: flash messages as floating toast */
.ht-flash-toast-wrap {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 99999 !important;
    display: grid !important;
    gap: .65rem !important;
    width: min(24rem, calc(100vw - 2rem)) !important;
    pointer-events: none !important;
}

.ht-flash-toast {
    pointer-events: auto !important;
    border-radius: 1rem !important;
    padding: .9rem 1rem !important;
    font-weight: 850 !important;
    font-size: .92rem !important;
    line-height: 1.35 !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .18) !important;
    animation: ht-toast-in .22s ease-out both !important;
}

.ht-flash-toast.success {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.ht-flash-toast.error {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

@keyframes ht-toast-in {
    from {
        opacity: 0;
        transform: translateY(-.35rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 700px) {
    .ht-flash-toast-wrap {
        top: .75rem !important;
        right: .75rem !important;
        left: .75rem !important;
        width: auto !important;
    }
}

/* FINAL FORCE: session flash toast */
.ht-flash-toast-wrap {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 2147483647 !important;
    display: grid !important;
    gap: .65rem !important;
    width: min(24rem, calc(100vw - 2rem)) !important;
    pointer-events: none !important;
}

.ht-flash-toast {
    pointer-events: auto !important;
    border-radius: 1rem !important;
    padding: .9rem 1rem !important;
    font-weight: 900 !important;
    font-size: .92rem !important;
    line-height: 1.35 !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .18) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.ht-flash-toast.success {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.ht-flash-toast.error {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

@media (max-width: 700px) {
    .ht-flash-toast-wrap {
        top: .75rem !important;
        left: .75rem !important;
        right: .75rem !important;
        width: auto !important;
    }
}

/* HOGEYTECH FINAL DYNAMIC HERO BRAND GLOW */
/* This block must stay near the end of app.css. It overrides old hardcoded yellow/orange hero glows. */
:root {
    --ht-dynamic-hero-bg: radial-gradient(
            circle at 92% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 24%, transparent),
            transparent 22rem
        ),
        radial-gradient(
            circle at 8% 98%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent),
            transparent 23rem
        ),
        radial-gradient(
            circle at 56% 42%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-primary)) 13%, transparent),
            transparent 28rem
        ),
        linear-gradient(
            135deg,
            var(--ht-surface, #ffffff) 0%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 6%, var(--ht-surface, #ffffff)) 54%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 9%, var(--ht-surface, #ffffff)) 100%
        );

    --ht-dynamic-page-bg: radial-gradient(
            circle at 4% 2%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 10%, transparent),
            transparent 24rem
        ),
        radial-gradient(
            circle at 98% 10%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 8%, transparent),
            transparent 26rem
        ),
        radial-gradient(
            circle at 70% 98%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-primary)) 7%, transparent),
            transparent 28rem
        ),
        var(--ht-bg, #f5f9fc);
}

.ht-body,
body.ht-body {
    background: var(--ht-dynamic-page-bg) !important;
}

.ht-content {
    background: radial-gradient(
            circle at 92% 4%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, transparent),
            transparent 22rem
        ),
        radial-gradient(
            circle at 8% 88%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 7%, transparent),
            transparent 24rem
        ) !important;
}

.ht-admin-hero-v2,
.ht-page-hero-v2,
.ht-client-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child,
.ht-auth-left,
.ht-auth-shell .ht-auth-left,
body .ht-auth-left {
    background: var(--ht-dynamic-hero-bg) !important;
    background-image: var(--ht-dynamic-hero-bg) !important;
    position: relative !important;
    overflow: hidden !important;
}

.ht-admin-hero-v2::before,
.ht-page-hero-v2::before,
.ht-client-hero-v2::before,
.ht-auth-left::before {
    content: "" !important;
    pointer-events: none !important;
    border-radius: 999px !important;
    width: 24rem !important;
    height: 24rem !important;
    display: block !important;
    position: absolute !important;
    top: -10rem !important;
    right: -9rem !important;
    filter: blur(14px) !important;
    opacity: 1 !important;
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 28%, transparent),
        transparent 68%
    ) !important;
}

.ht-admin-hero-v2::after,
.ht-page-hero-v2::after,
.ht-client-hero-v2::after,
.ht-auth-left::after {
    content: "" !important;
    pointer-events: none !important;
    border-radius: 999px !important;
    width: 23rem !important;
    height: 23rem !important;
    display: block !important;
    position: absolute !important;
    bottom: -10rem !important;
    left: -9rem !important;
    filter: blur(16px) !important;
    opacity: 1 !important;
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 22%, transparent),
        transparent 68%
    ) !important;
}

.ht-admin-hero-v2 > *,
.ht-page-hero-v2 > *,
.ht-client-hero-v2 > *,
.ht-auth-left > * {
    position: relative !important;
    z-index: 2 !important;
}

html.dark .ht-admin-hero-v2,
html.dark .ht-page-hero-v2,
html.dark .ht-client-hero-v2,
html.dark .ht-client-dashboard > section:first-child,
html.dark .ht-client-dashboard-v2 > section:first-child,
html.dark .ht-auth-left {
    background: radial-gradient(
            circle at 92% 8%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 26%, transparent),
            transparent 22rem
        ),
        radial-gradient(
            circle at 8% 98%,
            color-mix(in srgb, var(--ht-hero-blob-accent, var(--ht-accent)) 18%, transparent),
            transparent 23rem
        ),
        radial-gradient(
            circle at 56% 42%,
            color-mix(in srgb, var(--ht-hero-blob-third, var(--ht-primary)) 10%, transparent),
            transparent 28rem
        ),
        linear-gradient(
            135deg,
            #07111f 0%,
            color-mix(in srgb, var(--ht-hero-blob, var(--ht-primary)) 8%, #0b1626) 58%,
            #111827 100%
        ) !important;
}

/* Keep buttons and active nav tied to settings instead of old fixed blue/purple. */
.ht-action-primary,
button.ht-action-primary,
a.ht-action-primary,
.ht-admin-actions-v2 .ht-action-primary,
.ht-admin-actions-v2 a:first-child,
.ht-admin-actions-v2 button:first-child,
.ht-page-hero-actions .ht-action-primary,
.ht-page-hero-actions a:first-child,
.ht-page-hero-actions button:first-child,
.ht-form-actions .ht-action-primary,
.ht-side-actions .ht-action-primary,
.ht-services-filter-bar .ht-action-primary,
button[type="submit"].ht-action-primary {
    background: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary)) !important;
    color: var(--ht-button-primary-text, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ht-primary) 48%, transparent) !important;
    box-shadow: 0 .75rem 1.6rem color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
}

.ht-action-primary:hover,
button.ht-action-primary:hover,
a.ht-action-primary:hover,
.ht-admin-actions-v2 .ht-action-primary:hover,
.ht-admin-actions-v2 a:first-child:hover,
.ht-admin-actions-v2 button:first-child:hover,
.ht-page-hero-actions .ht-action-primary:hover,
.ht-page-hero-actions a:first-child:hover,
.ht-page-hero-actions button:first-child:hover,
.ht-form-actions .ht-action-primary:hover,
.ht-side-actions .ht-action-primary:hover,
.ht-services-filter-bar .ht-action-primary:hover,
button[type="submit"].ht-action-primary:hover {
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover, var(--ht-primary))) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover, var(--ht-primary))) !important;
    color: #ffffff !important;
    box-shadow: 0 .9rem 1.9rem color-mix(in srgb, var(--ht-primary) 28%, transparent) !important;
}

.ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active,
.ht-sidebar-menu a.active {
    background: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    background-image: var(--ht-active-nav-bg, var(--ht-button-primary-bg, var(--ht-primary))) !important;
    color: #ffffff !important;
    box-shadow: 0 .65rem 1.4rem color-mix(in srgb, var(--ht-primary) 22%, transparent) !important;
}

.ht-kicker,
.ht-page-kicker,
.ht-auth-kicker,
.ht-auth-card-head span,
.ht-admin-hero-v2 .ht-kicker,
.ht-page-hero-v2 .ht-kicker,
.ht-client-hero-v2 .ht-kicker,
.ht-panel-head .ht-kicker,
.ht-topbar .ht-kicker,
[class*="kicker"] {
    color: var(--ht-kicker-color, var(--ht-primary)) !important;
}

/* HOGEYTECH FINAL COMPACT SIDEBAR SPACING */
/* Keeps desktop sidebar professional instead of overly spaced out. */
@media (min-width: 901px) {
    .ht-sidebar {
        padding: 1rem .85rem !important;
        display: flex !important;
        flex-direction: column !important;
        gap: .8rem !important;
    }

    .ht-sidebar-logo,
    .ht-sidebar-brand,
    .ht-sidebar-header {
        margin-bottom: .65rem !important;
        padding-bottom: .15rem !important;
    }

    .ht-sidebar-logo img,
    .ht-sidebar-real-logo {
        max-height: 2.2rem !important;
        width: auto !important;
        object-fit: contain !important;
    }

    .ht-sidebar nav,
    .ht-sidebar .ht-nav,
    .ht-sidebar-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: .42rem !important;
        margin-top: .35rem !important;
    }

    .ht-nav-link,
    .ht-sidebar a {
        min-height: 2.75rem !important;
        height: auto !important;
        padding: .7rem .8rem !important;
        border-radius: .9rem !important;
        gap: .7rem !important;
        line-height: 1.1 !important;
    }

    .ht-nav-link svg,
    .ht-sidebar a svg {
        width: 1rem !important;
        height: 1rem !important;
        flex: 0 0 1rem !important;
    }

    .ht-nav-link.active,
    .ht-sidebar a.active,
    .ht-sidebar .active,
    .ht-sidebar-menu a.active {
        min-height: 3rem !important;
        border-radius: 1rem !important;
    }

    .ht-sidebar-card,
    .ht-sidebar-help-system,
    .ht-sidebar-card:has(.ht-system-online-pill) {
        margin-top: auto !important;
        padding: .75rem .8rem !important;
        border-radius: .9rem !important;
        min-height: auto !important;
    }

    .ht-sidebar-card-title,
    .ht-sidebar-help-system .ht-sidebar-card-title,
    .ht-sidebar-card:has(.ht-system-online-pill) .ht-sidebar-card-title {
        font-size: .78rem !important;
        line-height: 1.05 !important;
        margin: 0 0 .15rem !important;
    }

    .ht-sidebar-card-text,
    .ht-sidebar-card p,
    .ht-sidebar-help-system p,
    .ht-sidebar-card:has(.ht-system-online-pill) p {
        font-size: .72rem !important;
        line-height: 1.1 !important;
        margin: 0 0 .45rem !important;
    }

    .ht-sidebar-help-system .ht-status-pill,
    .ht-sidebar-help-system .ht-system-online-pill,
    .ht-sidebar-card .ht-status-pill,
    .ht-sidebar-card .ht-system-online-pill {
        padding: .34rem .72rem !important;
        font-size: .7rem !important;
        line-height: 1 !important;
    }
}

/* Slightly tighter tablet/mobile sidebar too, but keep touch targets usable. */
@media (max-width: 900px) {
    .ht-sidebar nav,
    .ht-sidebar .ht-nav,
    .ht-sidebar-menu {
        gap: .45rem !important;
    }

    .ht-nav-link,
    .ht-sidebar a {
        min-height: 2.9rem !important;
        padding: .75rem .85rem !important;
    }
}

/* HOGEYTECH FINAL TOAST AND TABLE ACTION CLEANUP */
.ht-flash-toast-wrap {
    z-index: 2147483647 !important;
    pointer-events: none !important;
    gap: .65rem !important;
    width: min(27rem, calc(100vw - 2rem)) !important;
    display: grid !important;
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
}

.ht-flash-toast {
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-radius: 1rem !important;
    padding: .95rem 1.05rem !important;
    font-size: .93rem !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    animation: ht-toast-in .22s ease-out both, ht-toast-out .25s ease-in 4.75s forwards !important;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .22) !important;
}

.ht-flash-toast.success {
    color: #ffffff !important;
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    border: 1px solid rgba(134, 239, 172, .7) !important;
}

.ht-flash-toast.error {
    color: #ffffff !important;
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: 1px solid rgba(254, 202, 202, .65) !important;
}

@keyframes ht-toast-in {
    from {
        opacity: 0;
        transform: translateY(-.35rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ht-toast-out {
    to {
        opacity: 0;
        transform: translateY(-.35rem) scale(.98);
        visibility: hidden;
    }
}

.ht-table-action.ht-payment-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .45rem !important;
}

.ht-table-action-form {
    display: inline-flex !important;
    margin: 0 !important;
}

.ht-table-action-link,
.ht-table-action-button {
    appearance: none !important;
    border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 24%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-primary, #00c0f0) 5%) !important;
    color: var(--ht-heading, #0f172a) !important;
    border-radius: 999px !important;
    padding: .42rem .65rem !important;
    font-size: .76rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.ht-table-action-link:hover,
.ht-table-action-button:hover {
    border-color: color-mix(in srgb, var(--ht-primary, #00c0f0) 42%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-primary, #00c0f0) 10%, var(--ht-surface, #ffffff)) !important;
    color: var(--ht-primary, #00c0f0) !important;
}

html.dark .ht-table-action-link,
html.dark .ht-table-action-button {
    background: color-mix(in srgb, #0b1626 86%, var(--ht-primary, #00c0f0) 8%) !important;
    color: #e5eef8 !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

@media (max-width: 700px) {
    .ht-flash-toast-wrap {
        width: auto !important;
        top: .75rem !important;
        left: .75rem !important;
        right: .75rem !important;
    }

    .ht-table-action.ht-payment-actions {
        justify-content: stretch !important;
    }

    .ht-table-action-link,
    .ht-table-action-button,
    .ht-table-action-form {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* HOGEYTECH FINAL GLASS TOAST AUTOHIDE */
.ht-flash-toast-wrap {
    z-index: 2147483647 !important;
    pointer-events: none !important;
    width: min(25rem, calc(100vw - 2rem)) !important;
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    display: grid !important;
    gap: .55rem !important;
}

.ht-flash-toast {
    pointer-events: auto !important;
    border-radius: 999px !important;
    padding: .72rem .95rem !important;
    font-size: .86rem !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    backdrop-filter: blur(14px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
    animation:
        ht-toast-glass-in .18s ease-out both,
        ht-toast-glass-out .28s ease-in 3.2s forwards !important;
    box-shadow:
        0 .8rem 1.8rem rgba(15, 23, 42, .18),
        inset 0 1px 0 rgba(255, 255, 255, .45) !important;
}

.ht-flash-toast.success {
    color: #064e3b !important;
    background: color-mix(in srgb, #dcfce7 72%, transparent) !important;
    border: 1px solid color-mix(in srgb, #22c55e 42%, transparent) !important;
}

.ht-flash-toast.error {
    color: #7f1d1d !important;
    background: color-mix(in srgb, #fee2e2 76%, transparent) !important;
    border: 1px solid color-mix(in srgb, #ef4444 38%, transparent) !important;
}

html.dark .ht-flash-toast.success {
    color: #dcfce7 !important;
    background: color-mix(in srgb, #052e16 68%, transparent) !important;
    border-color: color-mix(in srgb, #22c55e 46%, transparent) !important;
}

html.dark .ht-flash-toast.error {
    color: #fee2e2 !important;
    background: color-mix(in srgb, #450a0a 70%, transparent) !important;
    border-color: color-mix(in srgb, #ef4444 46%, transparent) !important;
}

@keyframes ht-toast-glass-in {
    from {
        opacity: 0;
        transform: translateY(-.35rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ht-toast-glass-out {
    to {
        opacity: 0;
        transform: translateY(-.25rem) scale(.985);
        visibility: hidden;
    }
}

@media (max-width: 700px) {
    .ht-flash-toast-wrap {
        top: .75rem !important;
        left: .75rem !important;
        right: .75rem !important;
        width: auto !important;
    }

    .ht-flash-toast {
        border-radius: 1rem !important;
        text-align: center !important;
    }
}

/* HOGEYTECH FINAL TOAST COMPLETE REMOVE */
.ht-flash-toast-wrap {
    z-index: 99999 !important;
    pointer-events: none !important;
    width: min(23rem, calc(100vw - 2rem)) !important;
    position: fixed !important;
    top: 4.25rem !important;
    right: 1rem !important;
    display: grid !important;
    gap: .5rem !important;
}

.ht-flash-toast {
    pointer-events: none !important;
    max-width: 100% !important;
    border-radius: 999px !important;
    padding: .62rem .9rem !important;
    font-size: .82rem !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    backdrop-filter: blur(16px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(150%) !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    transition: opacity .28s ease, transform .28s ease, visibility .28s ease !important;
    box-shadow:
        0 .7rem 1.7rem rgba(15, 23, 42, .16),
        inset 0 1px 0 rgba(255, 255, 255, .5) !important;
}

.ht-flash-toast.ht-toast-is-leaving {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-.35rem) scale(.98) !important;
}

.ht-flash-toast.success {
    color: #065f46 !important;
    background: rgba(220, 252, 231, .74) !important;
    border: 1px solid rgba(34, 197, 94, .32) !important;
}

.ht-flash-toast.error {
    color: #991b1b !important;
    background: rgba(254, 226, 226, .78) !important;
    border: 1px solid rgba(239, 68, 68, .32) !important;
}

html.dark .ht-flash-toast.success {
    color: #dcfce7 !important;
    background: rgba(5, 46, 22, .72) !important;
    border-color: rgba(34, 197, 94, .38) !important;
}

html.dark .ht-flash-toast.error {
    color: #fee2e2 !important;
    background: rgba(69, 10, 10, .74) !important;
    border-color: rgba(239, 68, 68, .38) !important;
}

@media (max-width: 700px) {
    .ht-flash-toast-wrap {
        top: 4.75rem !important;
        left: .75rem !important;
        right: .75rem !important;
        width: auto !important;
    }

    .ht-flash-toast {
        border-radius: 1rem !important;
        text-align: center !important;
    }
}

/* HOGEYTECH FINAL CONSISTENT ROW ACTIONS */
.ht-table-action,
.ht-row-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .45rem !important;
}

.ht-table-action-form,
.ht-inline-action-form {
    display: inline-flex !important;
    margin: 0 !important;
}

.ht-table-action-link,
.ht-table-action a,
.ht-table-action-button {
    appearance: none !important;
    border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 22%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-primary, #00c0f0) 5%) !important;
    color: var(--ht-heading, #0f172a) !important;
    border-radius: 999px !important;
    padding: .42rem .68rem !important;
    font-size: .76rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ht-table-action-link.is-primary,
.ht-table-action a.pay,
.ht-table-action a.is-primary {
    color: #ffffff !important;
    background: var(--ht-button-primary-bg, var(--ht-primary, #00c0f0)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary, #00c0f0)) !important;
    border-color: color-mix(in srgb, var(--ht-primary, #00c0f0) 48%, transparent) !important;
}

.ht-table-action-link:hover,
.ht-table-action a:hover,
.ht-table-action-button:hover {
    transform: translateY(-1px) !important;
    border-color: color-mix(in srgb, var(--ht-primary, #00c0f0) 42%, var(--ht-border, #dbe5ef)) !important;
    background: color-mix(in srgb, var(--ht-primary, #00c0f0) 10%, var(--ht-surface, #ffffff)) !important;
    color: var(--ht-primary, #00c0f0) !important;
}

.ht-table-action-link.is-primary:hover,
.ht-table-action a.pay:hover,
.ht-table-action a.is-primary:hover {
    color: #ffffff !important;
    background: var(--ht-button-primary-bg-hover, var(--ht-primary-hover, var(--ht-primary, #00c0f0))) !important;
    background-image: var(--ht-button-primary-bg-hover, var(--ht-primary-hover, var(--ht-primary, #00c0f0))) !important;
}

.ht-inline-action-form .ht-action-primary,
.ht-inline-action-form .ht-action-secondary {
    border: 0 !important;
    cursor: pointer !important;
}

html.dark .ht-table-action-link,
html.dark .ht-table-action a,
html.dark .ht-table-action-button {
    background: color-mix(in srgb, #0b1626 86%, var(--ht-primary, #00c0f0) 8%) !important;
    color: #e5eef8 !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

html.dark .ht-table-action-link.is-primary,
html.dark .ht-table-action a.pay,
html.dark .ht-table-action a.is-primary {
    color: #ffffff !important;
    background: var(--ht-button-primary-bg, var(--ht-primary, #00c0f0)) !important;
    background-image: var(--ht-button-primary-bg, var(--ht-primary, #00c0f0)) !important;
}

@media (max-width: 700px) {
    .ht-table-action,
    .ht-row-actions {
        justify-content: stretch !important;
    }

    .ht-table-action-link,
    .ht-table-action a,
    .ht-table-action-button,
    .ht-table-action-form {
        width: 100% !important;
        text-align: center !important;
    }
}

/* HOGEYTECH FINAL MOBILE TABLE CARD POLISH */
@media (max-width: 760px) {
    .ht-table-wrap {
        overflow-x: visible !important;
        max-width: 100% !important;
    }

    .ht-clean-table,
    .ht-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border-spacing: 0 !important;
    }

    .ht-clean-table thead,
    .ht-table thead {
        display: none !important;
    }

    .ht-clean-table tbody,
    .ht-table tbody {
        display: grid !important;
        gap: .85rem !important;
        width: 100% !important;
    }

    .ht-clean-table tr,
    .ht-table tr {
        display: grid !important;
        gap: .52rem !important;
        width: 100% !important;
        padding: .9rem !important;
        border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 12%, var(--ht-border, #dbe5ef)) !important;
        border-radius: 1rem !important;
        background: color-mix(in srgb, var(--ht-surface, #ffffff) 94%, transparent) !important;
        box-shadow: 0 .7rem 1.5rem rgba(15, 23, 42, .08) !important;
    }

    .ht-clean-table td,
    .ht-table td {
        display: grid !important;
        grid-template-columns: minmax(6.5rem, .7fr) minmax(0, 1.3fr) !important;
        align-items: start !important;
        gap: .75rem !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: .25rem 0 !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .ht-clean-table td::before,
    .ht-table td::before {
        content: attr(data-label) !important;
        color: var(--ht-muted, #64748b) !important;
        letter-spacing: .11em !important;
        text-transform: uppercase !important;
        font-size: .67rem !important;
        font-weight: 950 !important;
        line-height: 1.15 !important;
    }

    .ht-clean-table td:not([data-label])::before,
    .ht-table td:not([data-label])::before {
        content: "" !important;
        display: none !important;
    }

    .ht-clean-table td[colspan],
    .ht-table td[colspan] {
        display: block !important;
    }

    .ht-clean-table td[colspan]::before,
    .ht-table td[colspan]::before {
        display: none !important;
    }

    .ht-table-title,
    .ht-user-table-cell,
    .ht-role-stack {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .ht-table-title strong,
    .ht-table-title span,
    .ht-user-table-cell strong,
    .ht-user-table-cell span {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .ht-clean-table td.ht-right,
    .ht-table td.ht-right {
        text-align: left !important;
    }

    .ht-table-action,
    .ht-row-actions,
    .ht-table-action.ht-payment-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        justify-content: stretch !important;
        gap: .5rem !important;
        width: 100% !important;
    }

    .ht-table-action-link,
    .ht-table-action a,
    .ht-table-action-button,
    .ht-table-action-form {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    html.dark .ht-clean-table tr,
    html.dark .ht-table tr {
        background: color-mix(in srgb, var(--ht-surface, #0b1626) 92%, transparent) !important;
        border-color: rgba(148, 163, 184, .24) !important;
    }
}

/* HOGEYTECH FINAL CUSTOMER MOBILE LAYOUT FIX */
@media (max-width: 760px) {
    html,
    body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .ht-main,
    .ht-content,
    .ht-page-v2,
    .ht-page {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    /* Topbar: make mobile header compact */
    .ht-topbar {
        min-height: auto !important;
        padding: .55rem .75rem !important;
        gap: .5rem !important;
        overflow: hidden !important;
    }

    .ht-topbar .ht-page-title,
    .ht-topbar-title,
    .ht-page-title {
        font-size: .95rem !important;
        line-height: 1.1 !important;
        max-width: 9rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .ht-topbar-actions,
    .ht-topbar-right {
        gap: .35rem !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
    }

    .ht-user-chip,
    .ht-topbar-user {
        max-width: 9.5rem !important;
        padding: .35rem .5rem !important;
        gap: .4rem !important;
        overflow: hidden !important;
    }

    .ht-user-meta,
    .ht-user-chip span,
    .ht-user-chip strong {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .ht-theme-toggle,
    .ht-logout-btn,
    .ht-topbar-btn {
        min-width: 2.35rem !important;
        width: 2.35rem !important;
        height: 2.35rem !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    .ht-theme-toggle-label,
    .ht-logout-btn span,
    .ht-topbar-btn span {
        display: none !important;
    }

    /* Customer hero: prevent huge title overflow */
    .ht-page-hero-v2 {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 1.1rem !important;
        padding: 1.15rem !important;
        margin-top: .75rem !important;
        overflow: hidden !important;
    }

    .ht-page-hero-v2 h1 {
        font-size: clamp(1.9rem, 9vw, 2.35rem) !important;
        line-height: 1 !important;
        letter-spacing: -.055em !important;
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .ht-page-hero-v2 p {
        max-width: 100% !important;
        font-size: .92rem !important;
        line-height: 1.35 !important;
        overflow-wrap: anywhere !important;
    }

    .ht-page-hero-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: .55rem !important;
        margin-top: .9rem !important;
    }

    .ht-page-hero-actions a,
    .ht-page-hero-actions button,
    .ht-action-primary,
    .ht-action-secondary {
        width: 100% !important;
        min-height: 2.65rem !important;
        justify-content: center !important;
        text-align: center !important;
        padding: .7rem .85rem !important;
    }

    /* Customer metrics: force one column on phone */
    .ht-metrics-grid-v2,
    .ht-metrics-grid-v2.ht-metrics-2,
    .ht-metrics-grid-v2.ht-metrics-3,
    .ht-metrics-grid-v2.ht-metrics-4,
    .ht-customer-metrics,
    .ht-customer-stats,
    .ht-customer-show-metrics {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .8rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .ht-metric-card-v2,
    .ht-stat-v2,
    .ht-card,
    .ht-panel-v2 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        border-radius: 1rem !important;
    }

    .ht-metric-card-v2 strong {
        font-size: 1.75rem !important;
        line-height: 1.05 !important;
    }

    .ht-metric-card-v2 span,
    .ht-metric-card-v2 p {
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
    }

    /* Panels/forms */
    .ht-panel-v2 {
        padding: 1rem !important;
    }

    .ht-form-grid,
    .ht-info-grid,
    .ht-details-grid,
    .ht-customer-info-grid {
        grid-template-columns: 1fr !important;
        gap: .75rem !important;
        width: 100% !important;
    }

    /* Move hamburger up so Safari bottom bar does not cover it */
    .mobile-menu-button,
    .hamburger,
    [class*="hamburger"],
    [class*="mobile-menu"] {
        bottom: calc(4.25rem + env(safe-area-inset-bottom)) !important;
        left: .85rem !important;
        z-index: 90 !important;
    }
}

@media (max-width: 380px) {
    .ht-topbar .ht-page-title,
    .ht-topbar-title,
    .ht-page-title {
        max-width: 7.5rem !important;
    }

    .ht-user-chip,
    .ht-topbar-user {
        max-width: 8rem !important;
    }

    .ht-page-hero-v2 h1 {
        font-size: clamp(1.7rem, 8.5vw, 2.05rem) !important;
    }
}

/* HOGEYTECH FINAL MOBILE TOPBAR CONTRAST */
@media (max-width: 760px) {
    .ht-topbar {
        min-height: auto !important;
        padding: .7rem .8rem !important;
        gap: .55rem !important;
        background:
            radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--ht-primary, #00c0f0) 9%, transparent), transparent 14rem),
            linear-gradient(
                135deg,
                color-mix(in srgb, var(--ht-surface, #ffffff) 96%, transparent),
                color-mix(in srgb, var(--ht-surface, #ffffff) 90%, var(--ht-primary, #00c0f0) 5%)
            ) !important;
        border-bottom: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 18%, var(--ht-border, #dbe5ef)) !important;
        box-shadow: 0 .7rem 1.7rem rgba(15, 23, 42, .08) !important;
        backdrop-filter: blur(18px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(145%) !important;
        overflow: hidden !important;
    }

    .ht-topbar .ht-kicker,
    .ht-topbar .ht-page-kicker,
    .ht-page-kicker {
        color: var(--ht-primary, #00c0f0) !important;
        opacity: 1 !important;
        font-size: .66rem !important;
        letter-spacing: .18em !important;
        font-weight: 950 !important;
        line-height: 1 !important;
    }

    .ht-topbar .ht-page-title,
    .ht-topbar-title,
    .ht-page-title {
        color: var(--ht-heading, #0f172a) !important;
        opacity: 1 !important;
        font-size: .95rem !important;
        font-weight: 950 !important;
        line-height: 1.1 !important;
        max-width: 9.5rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-shadow: none !important;
    }

    .ht-user-chip,
    .ht-topbar-user {
        background:
            linear-gradient(
                135deg,
                color-mix(in srgb, var(--ht-surface, #ffffff) 96%, var(--ht-primary, #00c0f0) 4%),
                color-mix(in srgb, var(--ht-surface, #ffffff) 92%, var(--ht-primary, #00c0f0) 8%)
            ) !important;
        border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 24%, var(--ht-border, #dbe5ef)) !important;
        color: var(--ht-heading, #0f172a) !important;
        box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .08) !important;
        max-width: 10rem !important;
        opacity: 1 !important;
    }

    .ht-user-avatar {
        background: color-mix(in srgb, var(--ht-primary, #00c0f0) 16%, #ffffff) !important;
        color: var(--ht-primary, #00c0f0) !important;
        border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 28%, transparent) !important;
        box-shadow: none !important;
    }

    .ht-user-meta strong,
    .ht-user-chip strong,
    .ht-topbar-user strong {
        color: var(--ht-heading, #0f172a) !important;
        opacity: 1 !important;
        font-weight: 950 !important;
    }

    .ht-user-meta span,
    .ht-user-chip span,
    .ht-topbar-user span {
        color: color-mix(in srgb, var(--ht-heading, #0f172a) 72%, transparent) !important;
        opacity: 1 !important;
        font-weight: 750 !important;
    }

    .ht-theme-toggle,
    .ht-logout-btn,
    .ht-topbar-btn {
        background:
            linear-gradient(
                135deg,
                color-mix(in srgb, #ffffff 92%, var(--ht-primary, #00c0f0) 6%),
                color-mix(in srgb, #ffffff 82%, var(--ht-primary, #00c0f0) 9%)
            ) !important;
        border: 1px solid color-mix(in srgb, var(--ht-primary, #00c0f0) 22%, var(--ht-border, #dbe5ef)) !important;
        color: var(--ht-heading, #0f172a) !important;
        opacity: 1 !important;
        box-shadow: 0 .35rem .9rem rgba(15, 23, 42, .08) !important;
    }

    .ht-theme-toggle-icon,
    .ht-logout-btn svg,
    .ht-topbar-btn svg {
        opacity: 1 !important;
        color: var(--ht-heading, #0f172a) !important;
    }

    /* Dark mode: strong readable dark glass */
    html.dark .ht-topbar {
        background:
            radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--ht-primary, #00c0f0) 18%, transparent), transparent 14rem),
            linear-gradient(135deg, rgba(7, 17, 31, .96), rgba(11, 22, 38, .94)) !important;
        border-bottom-color: rgba(148, 163, 184, .28) !important;
        box-shadow: 0 .7rem 1.7rem rgba(0, 0, 0, .28) !important;
    }

    html.dark .ht-topbar .ht-page-title,
    html.dark .ht-topbar-title,
    html.dark .ht-page-title {
        color: #e5eef8 !important;
    }

    html.dark .ht-user-chip,
    html.dark .ht-topbar-user,
    html.dark .ht-theme-toggle,
    html.dark .ht-logout-btn,
    html.dark .ht-topbar-btn {
        background: linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(11, 22, 38, .92)) !important;
        border-color: rgba(148, 163, 184, .32) !important;
        color: #e5eef8 !important;
        box-shadow: 0 .45rem 1rem rgba(0, 0, 0, .18) !important;
    }

    html.dark .ht-user-meta strong,
    html.dark .ht-user-chip strong,
    html.dark .ht-topbar-user strong,
    html.dark .ht-theme-toggle-icon,
    html.dark .ht-logout-btn svg,
    html.dark .ht-topbar-btn svg {
        color: #e5eef8 !important;
    }

    html.dark .ht-user-meta span,
    html.dark .ht-user-chip span,
    html.dark .ht-topbar-user span {
        color: rgba(226, 232, 240, .74) !important;
    }
}

@media (max-width: 380px) {
    .ht-topbar {
        padding: .62rem .65rem !important;
    }

    .ht-topbar .ht-page-title,
    .ht-topbar-title,
    .ht-page-title {
        max-width: 8rem !important;
        font-size: .9rem !important;
    }

    .ht-user-chip,
    .ht-topbar-user {
        max-width: 8.25rem !important;
    }
}

/* HOGEYTECH FINAL MOBILE TOPBAR STRONG CARD */
@media (max-width: 760px) {
    .ht-topbar {
        margin: 0 !important;
        padding: .72rem .78rem .82rem !important;
        background:
            radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--ht-primary, #00c0f0) 12%, transparent), transparent 12rem),
            linear-gradient(135deg, rgba(248, 251, 255, .98), rgba(236, 247, 255, .96)) !important;
        border-bottom: 1px solid rgba(15, 23, 42, .10) !important;
        box-shadow:
            0 .8rem 1.75rem rgba(15, 23, 42, .10),
            inset 0 -1px 0 rgba(255, 255, 255, .9) !important;
        backdrop-filter: blur(20px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    }

    .ht-topbar::after {
        content: "" !important;
        display: block !important;
        position: absolute !important;
        left: .75rem !important;
        right: .75rem !important;
        bottom: 0 !important;
        height: 1px !important;
        background: linear-gradient(
            90deg,
            transparent,
            color-mix(in srgb, var(--ht-primary, #00c0f0) 34%, transparent),
            transparent
        ) !important;
        pointer-events: none !important;
    }

    .ht-topbar .ht-kicker,
    .ht-topbar .ht-page-kicker,
    .ht-page-kicker {
        color: #0284c7 !important;
        text-shadow: none !important;
    }

    .ht-topbar .ht-page-title,
    .ht-topbar-title,
    .ht-page-title {
        color: #07111f !important;
        font-weight: 950 !important;
        text-shadow: 0 1px 0 rgba(255, 255, 255, .55) !important;
    }

    .ht-user-chip,
    .ht-topbar-user {
        background: rgba(255, 255, 255, .92) !important;
        border-color: rgba(14, 165, 233, .24) !important;
        box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .10) !important;
    }

    .ht-theme-toggle,
    .ht-logout-btn,
    .ht-topbar-btn {
        background: rgba(255, 255, 255, .92) !important;
        border-color: rgba(14, 165, 233, .24) !important;
        box-shadow: 0 .4rem .9rem rgba(15, 23, 42, .10) !important;
    }

    html.dark .ht-topbar {
        background:
            radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--ht-primary, #00c0f0) 18%, transparent), transparent 12rem),
            linear-gradient(135deg, rgba(7, 17, 31, .98), rgba(11, 22, 38, .96)) !important;
        border-bottom-color: rgba(148, 163, 184, .28) !important;
        box-shadow: 0 .8rem 1.75rem rgba(0, 0, 0, .30) !important;
    }

    html.dark .ht-topbar .ht-page-title,
    html.dark .ht-topbar-title,
    html.dark .ht-page-title {
        color: #f8fafc !important;
        text-shadow: none !important;
    }

    html.dark .ht-topbar .ht-kicker,
    html.dark .ht-topbar .ht-page-kicker,
    html.dark .ht-page-kicker {
        color: #38bdf8 !important;
    }
}

/* Modern compact utility topbar + Facebook-style notification */
.ht-topbar {
    overflow: visible !important;
}

.ht-topbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .5rem !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
}

.ht-notify-btn,
.ht-theme-toggle,
.ht-logout-btn {
    width: 2.65rem !important;
    height: 2.65rem !important;
    min-width: 2.65rem !important;
    border-radius: 999px !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid color-mix(in srgb, var(--ht-border, #d8e7f2) 78%, transparent) !important;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.86), transparent 45%),
        color-mix(in srgb, var(--ht-surface, #ffffff) 82%, transparent) !important;
    color: var(--ht-text, #08111f) !important;
    box-shadow: 0 14px 34px rgba(8,17,31,.12), inset 0 1px 0 rgba(255,255,255,.75) !important;
    backdrop-filter: blur(16px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.25) !important;
}

html.dark .ht-notify-btn,
html.dark .ht-theme-toggle,
html.dark .ht-logout-btn {
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.16), transparent 45%),
        color-mix(in srgb, var(--ht-surface, #0f1b2d) 74%, transparent) !important;
    color: #eaf7ff !important;
    border-color: rgba(160,220,255,.22) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.ht-notify-btn:hover,
.ht-theme-toggle:hover,
.ht-logout-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 18px 42px rgba(0,174,239,.18), inset 0 1px 0 rgba(255,255,255,.8) !important;
}

.ht-notify-svg {
    width: 1.35rem !important;
    height: 1.35rem !important;
    color: #0ea5e9 !important;
    filter: drop-shadow(0 5px 12px rgba(14,165,233,.25)) !important;
}

.ht-notify-badge {
    position: absolute !important;
    top: -.18rem !important;
    right: -.22rem !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    padding: 0 .28rem !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: .62rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff2d55, #ff1744) !important;
    border: 2px solid var(--ht-topbar, #fff) !important;
    box-shadow: 0 8px 18px rgba(255,23,68,.36) !important;
}

.ht-theme-toggle-label,
.ht-logout-label {
    display: none !important;
}

@media (max-width: 720px) {
    .ht-topbar {
        padding-left: .9rem !important;
        padding-right: .9rem !important;
    }

    .ht-topbar-actions {
        gap: .38rem !important;
    }

    .ht-notify-btn,
    .ht-theme-toggle,
    .ht-logout-btn {
        width: 2.45rem !important;
        height: 2.45rem !important;
        min-width: 2.45rem !important;
    }

    .ht-topbar-btn {
        display: none !important;
    }
}

/* Modern compact utility topbar + Facebook-style notification */
.ht-topbar {
    overflow: visible !important;
}

.ht-topbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .5rem !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
}

.ht-notify-btn,
.ht-theme-toggle,
.ht-logout-btn {
    width: 2.65rem !important;
    height: 2.65rem !important;
    min-width: 2.65rem !important;
    border-radius: 999px !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid color-mix(in srgb, var(--ht-border, #d8e7f2) 78%, transparent) !important;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.86), transparent 45%),
        color-mix(in srgb, var(--ht-surface, #ffffff) 82%, transparent) !important;
    color: var(--ht-text, #08111f) !important;
    box-shadow: 0 14px 34px rgba(8,17,31,.12), inset 0 1px 0 rgba(255,255,255,.75) !important;
    backdrop-filter: blur(16px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.25) !important;
}

html.dark .ht-notify-btn,
html.dark .ht-theme-toggle,
html.dark .ht-logout-btn {
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.16), transparent 45%),
        color-mix(in srgb, var(--ht-surface, #0f1b2d) 74%, transparent) !important;
    color: #eaf7ff !important;
    border-color: rgba(160,220,255,.22) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.ht-notify-btn:hover,
.ht-theme-toggle:hover,
.ht-logout-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 18px 42px rgba(0,174,239,.18), inset 0 1px 0 rgba(255,255,255,.8) !important;
}

.ht-notify-svg {
    width: 1.35rem !important;
    height: 1.35rem !important;
    color: #0ea5e9 !important;
    filter: drop-shadow(0 5px 12px rgba(14,165,233,.25)) !important;
}

.ht-notify-badge {
    position: absolute !important;
    top: -.18rem !important;
    right: -.22rem !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    padding: 0 .28rem !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: .62rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff2d55, #ff1744) !important;
    border: 2px solid var(--ht-topbar, #fff) !important;
    box-shadow: 0 8px 18px rgba(255,23,68,.36) !important;
}

.ht-theme-toggle-label,
.ht-logout-label {
    display: none !important;
}

@media (max-width: 720px) {
    .ht-topbar {
        padding-left: .9rem !important;
        padding-right: .9rem !important;
    }

    .ht-topbar-actions {
        gap: .38rem !important;
    }

    .ht-notify-btn,
    .ht-theme-toggle,
    .ht-logout-btn {
        width: 2.45rem !important;
        height: 2.45rem !important;
        min-width: 2.45rem !important;
    }

    .ht-topbar-btn {
        display: none !important;
    }
}

/* Mobile iPhone-style bottom utility dock */
@media (max-width: 720px) {
    body {
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom)) !important;
    }

    .ht-topbar {
        min-height: 4.25rem !important;
        padding: .75rem 1rem !important;
    }

    .ht-topbar > div:first-child {
        min-width: 0 !important;
    }

    .ht-page-kicker {
        font-size: .64rem !important;
        letter-spacing: .22em !important;
        max-width: 12rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .ht-page-title {
        font-size: 1.18rem !important;
        line-height: 1.05 !important;
        max-width: 12rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .ht-topbar-actions {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: calc(.7rem + env(safe-area-inset-bottom)) !important;
        transform: translateX(-50%) !important;
        z-index: 9999 !important;

        width: min(22rem, calc(100vw - 1.5rem)) !important;
        min-height: 4rem !important;
        padding: .55rem .65rem !important;

        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: center !important;
        justify-items: center !important;
        gap: .45rem !important;

        border: 1px solid rgba(120, 170, 210, .24) !important;
        border-radius: 1.55rem !important;
        background:
            radial-gradient(circle at 15% 0%, rgba(0, 174, 239, .18), transparent 45%),
            radial-gradient(circle at 85% 100%, rgba(99, 102, 241, .16), transparent 48%),
            color-mix(in srgb, var(--ht-surface, #ffffff) 82%, transparent) !important;
        box-shadow: 0 22px 60px rgba(8, 17, 31, .26), inset 0 1px 0 rgba(255,255,255,.7) !important;
        backdrop-filter: blur(22px) saturate(1.35) !important;
        -webkit-backdrop-filter: blur(22px) saturate(1.35) !important;
    }

    html.dark .ht-topbar-actions {
        background:
            radial-gradient(circle at 15% 0%, rgba(0, 174, 239, .22), transparent 45%),
            radial-gradient(circle at 85% 100%, rgba(99, 102, 241, .20), transparent 48%),
            color-mix(in srgb, var(--ht-surface, #0b1628) 76%, transparent) !important;
        border-color: rgba(160, 220, 255, .22) !important;
        box-shadow: 0 24px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.10) !important;
    }

    .ht-user-chip {
        order: 4 !important;
        width: 2.65rem !important;
        height: 2.65rem !important;
        min-width: 2.65rem !important;
        padding: 0 !important;
        border-radius: 999px !important;
        justify-content: center !important;
        overflow: visible !important;
    }

    .ht-user-avatar {
        width: 2.35rem !important;
        height: 2.35rem !important;
        min-width: 2.35rem !important;
        font-size: .9rem !important;
    }

    .ht-user-meta,
    .ht-topbar-btn,
    .ht-logout-form {
        display: none !important;
    }

    .ht-theme-toggle {
        order: 2 !important;
    }

    .ht-notify-btn {
        order: 3 !important;
    }

    #htMobileSidebarToggle,
    .ht-mobile-menu-btn {
        position: fixed !important;
        left: calc(50% - min(11rem, calc((100vw - 1.5rem) / 2)) + .65rem) !important;
        bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        z-index: 10000 !important;

        width: 2.65rem !important;
        height: 2.65rem !important;
        min-width: 2.65rem !important;
        border-radius: 999px !important;
        border: 1px solid color-mix(in srgb, var(--ht-border, #d8e7f2) 78%, transparent) !important;
        background:
            radial-gradient(circle at 30% 20%, rgba(255,255,255,.86), transparent 45%),
            color-mix(in srgb, var(--ht-surface, #ffffff) 82%, transparent) !important;
        color: var(--ht-heading, #08111f) !important;
        box-shadow: 0 14px 34px rgba(8,17,31,.14), inset 0 1px 0 rgba(255,255,255,.75) !important;
        backdrop-filter: blur(16px) saturate(1.25) !important;
        -webkit-backdrop-filter: blur(16px) saturate(1.25) !important;
    }

    html.dark #htMobileSidebarToggle,
    html.dark .ht-mobile-menu-btn {
        color: #eaf7ff !important;
        border-color: rgba(160,220,255,.22) !important;
        background:
            radial-gradient(circle at 30% 20%, rgba(255,255,255,.16), transparent 45%),
            color-mix(in srgb, var(--ht-surface, #0f1b2d) 74%, transparent) !important;
        box-shadow: 0 16px 36px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.10) !important;
    }

    .ht-mobile-menu-btn__icon {
        width: 1.35rem !important;
        height: 1.35rem !important;
        display: grid !important;
        place-items: center !important;
    }

    .ht-mobile-menu-btn__icon svg,
    .ht-mobile-menu-btn svg {
        width: 1.3rem !important;
        height: 1.3rem !important;
    }
}

/* FINAL MOBILE UTILITY DOCK OVERRIDE */
@media screen and (max-width: 720px) {
  body {
    padding-bottom: calc(6.4rem + env(safe-area-inset-bottom)) !important;
  }

  header.ht-topbar {
    min-height: 4.1rem !important;
    padding: .7rem 1rem !important;
    overflow: visible !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(.85rem + env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    z-index: 2147483000 !important;

    width: min(21.5rem, calc(100vw - 1.25rem)) !important;
    height: 4.15rem !important;
    padding: .55rem .7rem .55rem 4.05rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: .45rem !important;

    border-radius: 1.65rem !important;
    border: 1px solid rgba(120,170,210,.30) !important;
    background:
      radial-gradient(circle at 15% 10%, rgba(0,174,239,.20), transparent 42%),
      radial-gradient(circle at 90% 90%, rgba(99,102,241,.16), transparent 45%),
      rgba(255,255,255,.78) !important;
    box-shadow: 0 24px 70px rgba(8,17,31,.28), inset 0 1px 0 rgba(255,255,255,.75) !important;
    backdrop-filter: blur(24px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.35) !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background:
      radial-gradient(circle at 15% 10%, rgba(0,174,239,.22), transparent 42%),
      radial-gradient(circle at 90% 90%, rgba(99,102,241,.20), transparent 45%),
      rgba(9,18,33,.78) !important;
    border-color: rgba(160,220,255,.22) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-logout-form {
    display: none !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn {
    display: inline-flex !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: 2.7rem !important;
    height: 2.7rem !important;
    min-width: 2.7rem !important;
    max-width: 2.7rem !important;
    padding: 0 !important;
    border-radius: 999px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 2.35rem !important;
    height: 2.35rem !important;
    min-width: 2.35rem !important;
  }

  header.ht-topbar .ht-theme-toggle-label {
    display: none !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    position: fixed !important;
    left: calc(50% - min(10.75rem, calc((100vw - 1.25rem) / 2)) + .7rem) !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(1.57rem + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    z-index: 2147483001 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 2.7rem !important;
    height: 2.7rem !important;
    min-width: 2.7rem !important;
    border-radius: 999px !important;

    background: rgba(255,255,255,.90) !important;
    color: #071525 !important;
    border: 1px solid rgba(120,170,210,.30) !important;
    box-shadow: 0 14px 34px rgba(8,17,31,.16), inset 0 1px 0 rgba(255,255,255,.75) !important;
    backdrop-filter: blur(18px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.3) !important;
  }

  html.dark #htMobileSidebarToggle.ht-mobile-menu-btn,
  html.dark button#htMobileSidebarToggle {
    background: rgba(12,24,42,.88) !important;
    color: #eaf7ff !important;
    border-color: rgba(160,220,255,.24) !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    display: none !important;
  }

  #htMobileSidebarToggle::before {
    content: "☰" !important;
    display: block !important;
    font-size: 1.55rem !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    color: currentColor !important;
  }

  header.ht-topbar .ht-page-kicker {
    max-width: 14rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    max-width: 14rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   FINAL POLISH: compact sellable mobile utility bar + modern hamburger
   ========================================================= */

@media screen and (max-width: 720px) {
  body {
    padding-bottom: calc(4.8rem + env(safe-area-inset-bottom)) !important;
  }

  header.ht-topbar {
    min-height: 3.7rem !important;
    padding: .6rem .9rem !important;
    overflow: visible !important;
  }

  header.ht-topbar > div:first-child {
    min-width: 0 !important;
    max-width: calc(100vw - 9.25rem) !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .58rem !important;
    letter-spacing: .18em !important;
    line-height: 1 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    left: 50% !important;
    bottom: calc(.72rem + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 2147483000 !important;

    width: min(17.85rem, calc(100vw - 1.3rem)) !important;
    height: 3.35rem !important;
    min-height: 3.35rem !important;
    padding: .42rem .5rem .42rem 3.45rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .35rem !important;

    border-radius: 999px !important;
    border: 1px solid rgba(120,170,210,.28) !important;
    background:
      radial-gradient(circle at 12% 10%, rgba(0,174,239,.20), transparent 38%),
      radial-gradient(circle at 94% 90%, rgba(99,102,241,.16), transparent 42%),
      rgba(255,255,255,.78) !important;
    box-shadow:
      0 20px 55px rgba(8,17,31,.26),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
    backdrop-filter: blur(24px) saturate(1.45) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.45) !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background:
      radial-gradient(circle at 12% 10%, rgba(0,174,239,.22), transparent 38%),
      radial-gradient(circle at 94% 90%, rgba(99,102,241,.20), transparent 42%),
      rgba(9,18,33,.80) !important;
    border-color: rgba(160,220,255,.24) !important;
    box-shadow:
      0 22px 62px rgba(0,0,0,.46),
      inset 0 1px 0 rgba(255,255,255,.12) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-logout-form {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 2.38rem !important;
    height: 2.38rem !important;
    min-width: 2.38rem !important;
    max-width: 2.38rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: visible !important;

    background:
      radial-gradient(circle at 32% 22%, rgba(255,255,255,.95), transparent 44%),
      rgba(255,255,255,.72) !important;
    border: 1px solid rgba(120,170,210,.24) !important;
    color: #071525 !important;
    box-shadow:
      0 10px 24px rgba(8,17,31,.12),
      inset 0 1px 0 rgba(255,255,255,.80) !important;
  }

  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-user-chip {
    background:
      radial-gradient(circle at 32% 22%, rgba(255,255,255,.18), transparent 44%),
      rgba(12,24,42,.74) !important;
    border-color: rgba(160,220,255,.22) !important;
    color: #eaf7ff !important;
  }

  header.ht-topbar .ht-theme-toggle:hover,
  header.ht-topbar .ht-notify-btn:hover,
  header.ht-topbar .ht-user-chip:hover,
  #htMobileSidebarToggle:hover {
    transform: translateY(-1px) scale(1.025) !important;
  }

  header.ht-topbar .ht-theme-toggle-label {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle-led {
    width: .54rem !important;
    height: .54rem !important;
    box-shadow: 0 0 0 3px rgba(0,174,239,.13) !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: 1.05rem !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: 1.2rem !important;
    height: 1.2rem !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.2rem !important;
    right: -.18rem !important;
    min-width: 1.05rem !important;
    height: 1.05rem !important;
    padding: 0 .25rem !important;
    font-size: .58rem !important;
    border-width: 2px !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 2.12rem !important;
    height: 2.12rem !important;
    min-width: 2.12rem !important;
    font-size: .78rem !important;
    box-shadow:
      0 8px 18px rgba(0,174,239,.18),
      inset 0 1px 0 rgba(255,255,255,.72) !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    position: fixed !important;
    left: calc(50% - min(8.925rem, calc((100vw - 1.3rem) / 2)) + .5rem) !important;
    bottom: calc(1.205rem + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: 2147483001 !important;

    width: 2.38rem !important;
    height: 2.38rem !important;
    min-width: 2.38rem !important;
    padding: 0 !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background:
      linear-gradient(135deg, rgba(0,174,239,.96), rgba(99,102,241,.94)) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.34) !important;
    box-shadow:
      0 14px 28px rgba(0,174,239,.32),
      0 8px 18px rgba(99,102,241,.18),
      inset 0 1px 0 rgba(255,255,255,.42) !important;
    backdrop-filter: blur(18px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.35) !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    display: none !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    width: 1.02rem !important;
    height: .14rem !important;
    border-radius: 999px !important;
    background: currentColor !important;
    transform: translateX(-50%) !important;
    box-shadow: 0 .42rem 0 currentColor !important;
  }

  #htMobileSidebarToggle::before {
    top: .74rem !important;
  }

  #htMobileSidebarToggle::after {
    top: 1.16rem !important;
    width: .72rem !important;
    margin-left: .15rem !important;
    box-shadow: none !important;
    opacity: .95 !important;
  }
}

/* =========================================================
   FINAL MOBILE HEADER: compact professional top utility rail
   ========================================================= */

@media screen and (max-width: 720px) {
  body {
    padding-bottom: 0 !important;
  }

  header.ht-topbar {
    min-height: 3.45rem !important;
    height: 3.45rem !important;
    padding: .45rem .72rem .45rem 3.55rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .55rem !important;
    overflow: visible !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9998 !important;
    background:
      linear-gradient(135deg, rgba(245,252,255,.92), rgba(233,247,255,.86)) !important;
    border-bottom: 1px solid rgba(120,170,210,.24) !important;
    box-shadow: 0 10px 30px rgba(8,17,31,.07) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
  }

  html.dark header.ht-topbar {
    background:
      linear-gradient(135deg, rgba(8,17,31,.94), rgba(13,29,50,.88)) !important;
    border-bottom-color: rgba(160,220,255,.18) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.24) !important;
  }

  header.ht-topbar > div:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    max-width: calc(100vw - 13rem) !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .52rem !important;
    letter-spacing: .18em !important;
    line-height: 1 !important;
    margin: 0 0 .14rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: .92rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: auto !important;
    height: 2.45rem !important;
    min-height: 2.45rem !important;
    flex: 0 0 auto !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .26rem !important;

    padding: .22rem !important;
    border-radius: 999px !important;
    border: 1px solid rgba(120,170,210,.25) !important;
    background: rgba(255,255,255,.62) !important;
    box-shadow:
      0 10px 26px rgba(8,17,31,.10),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
    backdrop-filter: blur(18px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.35) !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background: rgba(13,26,45,.66) !important;
    border-color: rgba(160,220,255,.20) !important;
    box-shadow:
      0 12px 30px rgba(0,0,0,.32),
      inset 0 1px 0 rgba(255,255,255,.10) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-logout-form,
  header.ht-topbar .ht-theme-toggle-label {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    max-width: 2rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: visible !important;

    background: transparent !important;
    border: 0 !important;
    color: #071525 !important;
    box-shadow: none !important;
  }

  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-user-chip {
    color: #eaf7ff !important;
  }

  header.ht-topbar .ht-theme-toggle:hover,
  header.ht-topbar .ht-notify-btn:hover,
  header.ht-topbar .ht-user-chip:hover {
    background: rgba(0,174,239,.10) !important;
    transform: none !important;
  }

  header.ht-topbar .ht-theme-toggle-led {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: 1.05rem !important;
    line-height: 1 !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
    color: #0ea5e9 !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.14rem !important;
    right: -.12rem !important;
    min-width: .98rem !important;
    height: .98rem !important;
    padding: 0 .22rem !important;
    font-size: .54rem !important;
    font-weight: 950 !important;
    border: 2px solid rgba(255,255,255,.92) !important;
    box-shadow: 0 7px 15px rgba(255,23,68,.32) !important;
  }

  html.dark header.ht-topbar .ht-notify-badge {
    border-color: rgba(13,26,45,.95) !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.82rem !important;
    height: 1.82rem !important;
    min-width: 1.82rem !important;
    font-size: .7rem !important;
    border-radius: 999px !important;
    box-shadow:
      0 6px 14px rgba(0,174,239,.18),
      inset 0 1px 0 rgba(255,255,255,.70) !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    position: fixed !important;
    left: .72rem !important;
    top: .58rem !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 10000 !important;

    width: 2.28rem !important;
    height: 2.28rem !important;
    min-width: 2.28rem !important;
    padding: 0 !important;
    border-radius: .95rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background:
      linear-gradient(135deg, #02b9ef, #6366f1) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.36) !important;
    box-shadow:
      0 12px 26px rgba(0,174,239,.26),
      0 6px 16px rgba(99,102,241,.18),
      inset 0 1px 0 rgba(255,255,255,.44) !important;
    backdrop-filter: blur(16px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.35) !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    display: none !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    width: 1.02rem !important;
    height: .13rem !important;
    border-radius: 999px !important;
    background: currentColor !important;
    transform: translateX(-50%) !important;
  }

  #htMobileSidebarToggle::before {
    top: .72rem !important;
    box-shadow: 0 .43rem 0 currentColor !important;
  }

  #htMobileSidebarToggle::after {
    top: 1.58rem !important;
    width: .68rem !important;
    margin-left: .17rem !important;
    opacity: .95 !important;
  }
}

/* =========================================================
   MOBILE FINAL: clean top header + bottom utility dock
   Fixes: title overlap, utility overlap, hamburger placement, sidebar overlay
   ========================================================= */

@media screen and (max-width: 720px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body {
    padding-bottom: calc(5.65rem + env(safe-area-inset-bottom)) !important;
  }

  header.ht-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;

    height: 3.55rem !important;
    min-height: 3.55rem !important;
    padding: .5rem .9rem .5rem 3.7rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .6rem !important;

    overflow: visible !important;
    background:
      linear-gradient(135deg, rgba(247,253,255,.94), rgba(234,248,255,.88)) !important;
    border-bottom: 1px solid rgba(120,170,210,.22) !important;
    box-shadow: 0 10px 30px rgba(8,17,31,.07) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
  }

  html.dark header.ht-topbar {
    background:
      linear-gradient(135deg, rgba(8,17,31,.94), rgba(13,29,50,.88)) !important;
    border-bottom-color: rgba(160,220,255,.18) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.24) !important;
  }

  header.ht-topbar > div:first-child {
    min-width: 0 !important;
    max-width: calc(100vw - 4.7rem) !important;
    flex: 1 1 auto !important;
    text-align: left !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .53rem !important;
    letter-spacing: .17em !important;
    line-height: 1 !important;
    margin: 0 0 .15rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: .96rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(.78rem + env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    z-index: 2147483000 !important;

    width: min(13.6rem, calc(100vw - 5.6rem)) !important;
    height: 3.18rem !important;
    min-height: 3.18rem !important;
    padding: .38rem .48rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .34rem !important;

    border-radius: 999px !important;
    border: 1px solid rgba(120,170,210,.26) !important;
    background:
      radial-gradient(circle at 12% 10%, rgba(0,174,239,.18), transparent 38%),
      radial-gradient(circle at 94% 90%, rgba(99,102,241,.14), transparent 42%),
      rgba(255,255,255,.82) !important;
    box-shadow:
      0 22px 58px rgba(8,17,31,.22),
      inset 0 1px 0 rgba(255,255,255,.86) !important;
    backdrop-filter: blur(24px) saturate(1.45) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.45) !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background:
      radial-gradient(circle at 12% 10%, rgba(0,174,239,.22), transparent 38%),
      radial-gradient(circle at 94% 90%, rgba(99,102,241,.18), transparent 42%),
      rgba(9,18,33,.84) !important;
    border-color: rgba(160,220,255,.22) !important;
    box-shadow:
      0 24px 68px rgba(0,0,0,.42),
      inset 0 1px 0 rgba(255,255,255,.12) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-logout-form,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-theme-toggle-led {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 2.34rem !important;
    height: 2.34rem !important;
    min-width: 2.34rem !important;
    max-width: 2.34rem !important;
    padding: 0 !important;
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: visible !important;

    border-radius: 999px !important;
    border: 1px solid rgba(120,170,210,.20) !important;
    background:
      radial-gradient(circle at 35% 22%, rgba(255,255,255,.94), transparent 45%),
      rgba(255,255,255,.62) !important;
    color: #071525 !important;
    box-shadow:
      0 9px 22px rgba(8,17,31,.10),
      inset 0 1px 0 rgba(255,255,255,.78) !important;
  }

  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-user-chip {
    background:
      radial-gradient(circle at 35% 22%, rgba(255,255,255,.16), transparent 45%),
      rgba(12,24,42,.70) !important;
    border-color: rgba(160,220,255,.20) !important;
    color: #eaf7ff !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: 1.05rem !important;
    line-height: 1 !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: 1.14rem !important;
    height: 1.14rem !important;
    color: #0ea5e9 !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.22rem !important;
    right: -.16rem !important;
    min-width: 1rem !important;
    height: 1rem !important;
    padding: 0 .23rem !important;
    font-size: .54rem !important;
    font-weight: 950 !important;
    border: 2px solid rgba(255,255,255,.94) !important;
    box-shadow: 0 7px 15px rgba(255,23,68,.32) !important;
  }

  html.dark header.ht-topbar .ht-notify-badge {
    border-color: rgba(9,18,33,.96) !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 2.05rem !important;
    height: 2.05rem !important;
    min-width: 2.05rem !important;
    font-size: .72rem !important;
    border-radius: 999px !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    position: fixed !important;
    left: calc(50% - min(9.15rem, calc((100vw - 1.2rem) / 2))) !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(.94rem + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    z-index: 2147483001 !important;

    width: 3.02rem !important;
    height: 3.02rem !important;
    min-width: 3.02rem !important;
    padding: 0 !important;
    border-radius: 1.25rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background:
      linear-gradient(135deg, #02b9ef 0%, #2f8df7 45%, #6d5dfc 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.38) !important;
    box-shadow:
      0 16px 34px rgba(0,174,239,.30),
      0 8px 18px rgba(99,102,241,.18),
      inset 0 1px 0 rgba(255,255,255,.46) !important;
    backdrop-filter: blur(18px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    display: none !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    width: 1.18rem !important;
    height: .145rem !important;
    border-radius: 999px !important;
    background: currentColor !important;
    transform: translateX(-50%) !important;
  }

  #htMobileSidebarToggle::before {
    top: .92rem !important;
    box-shadow: 0 .5rem 0 currentColor !important;
  }

  #htMobileSidebarToggle::after {
    top: 1.92rem !important;
    width: .78rem !important;
    margin-left: .2rem !important;
    opacity: .96 !important;
  }

  body.sidebar-open header.ht-topbar .ht-topbar-actions,
  body.ht-sidebar-open header.ht-topbar .ht-topbar-actions,
  body.menu-open header.ht-topbar .ht-topbar-actions,
  .ht-sidebar-open header.ht-topbar .ht-topbar-actions,
  .sidebar-open header.ht-topbar .ht-topbar-actions {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(1rem) scale(.96) !important;
  }

  body.sidebar-open #htMobileSidebarToggle,
  body.ht-sidebar-open #htMobileSidebarToggle,
  body.menu-open #htMobileSidebarToggle,
  .ht-sidebar-open #htMobileSidebarToggle,
  .sidebar-open #htMobileSidebarToggle {
    top: .68rem !important;
    bottom: auto !important;
    left: .72rem !important;
    width: 2.45rem !important;
    height: 2.45rem !important;
    min-width: 2.45rem !important;
    border-radius: 1rem !important;
  }

  body.sidebar-open #htMobileSidebarToggle::before,
  body.ht-sidebar-open #htMobileSidebarToggle::before,
  body.menu-open #htMobileSidebarToggle::before,
  .ht-sidebar-open #htMobileSidebarToggle::before,
  .sidebar-open #htMobileSidebarToggle::before {
    top: 1.14rem !important;
    box-shadow: none !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }

  body.sidebar-open #htMobileSidebarToggle::after,
  body.ht-sidebar-open #htMobileSidebarToggle::after,
  body.menu-open #htMobileSidebarToggle::after,
  .ht-sidebar-open #htMobileSidebarToggle::after,
  .sidebar-open #htMobileSidebarToggle::after {
    top: 1.14rem !important;
    width: 1.18rem !important;
    margin-left: 0 !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }
}

/* =========================================================
   FINAL MOBILE PLACEMENT:
   - Hamburger lives in top-left header
   - Utility pill lives top-right
   - Nothing floats over page cards/buttons
   ========================================================= */

@media screen and (max-width: 720px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body {
    padding-bottom: 0 !important;
  }

  header.ht-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;

    height: 3.7rem !important;
    min-height: 3.7rem !important;
    padding: .52rem 6.45rem .52rem 3.7rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    overflow: visible !important;
    background:
      linear-gradient(135deg, rgba(247,253,255,.94), rgba(234,248,255,.88)) !important;
    border-bottom: 1px solid rgba(120,170,210,.22) !important;
    box-shadow: 0 10px 30px rgba(8,17,31,.07) !important;
    backdrop-filter: blur(18px) saturate(1.28) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.28) !important;
  }

  html.dark header.ht-topbar {
    background:
      linear-gradient(135deg, rgba(8,17,31,.94), rgba(13,29,50,.88)) !important;
    border-bottom-color: rgba(160,220,255,.18) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.24) !important;
  }

  header.ht-topbar > div:first-child {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    text-align: left !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .53rem !important;
    letter-spacing: .17em !important;
    line-height: 1 !important;
    margin: 0 0 .15rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: .96rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    top: .64rem !important;
    right: .68rem !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 10001 !important;

    width: auto !important;
    height: 2.48rem !important;
    min-height: 2.48rem !important;
    padding: .24rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .22rem !important;

    border-radius: 999px !important;
    border: 1px solid rgba(120,170,210,.26) !important;
    background:
      radial-gradient(circle at 10% 20%, rgba(0,174,239,.14), transparent 42%),
      rgba(255,255,255,.78) !important;
    box-shadow:
      0 14px 34px rgba(8,17,31,.15),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
    backdrop-filter: blur(22px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.4) !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background:
      radial-gradient(circle at 10% 20%, rgba(0,174,239,.18), transparent 42%),
      rgba(9,18,33,.82) !important;
    border-color: rgba(160,220,255,.22) !important;
    box-shadow:
      0 16px 40px rgba(0,0,0,.36),
      inset 0 1px 0 rgba(255,255,255,.10) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-logout-form,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-theme-toggle-led {
    display: none !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 1.95rem !important;
    height: 1.95rem !important;
    min-width: 1.95rem !important;
    max-width: 1.95rem !important;
    padding: 0 !important;
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: visible !important;

    border-radius: 999px !important;
    border: 0 !important;
    background: transparent !important;
    color: #071525 !important;
    box-shadow: none !important;
  }

  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-user-chip {
    color: #eaf7ff !important;
  }

  header.ht-topbar .ht-theme-toggle:hover,
  header.ht-topbar .ht-notify-btn:hover,
  header.ht-topbar .ht-user-chip:hover {
    background: rgba(0,174,239,.11) !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: 1.02rem !important;
    line-height: 1 !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: 1.08rem !important;
    height: 1.08rem !important;
    color: #0ea5e9 !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.18rem !important;
    right: -.16rem !important;
    min-width: .94rem !important;
    height: .94rem !important;
    padding: 0 .2rem !important;
    font-size: .52rem !important;
    font-weight: 950 !important;
    border: 2px solid rgba(255,255,255,.94) !important;
    box-shadow: 0 7px 15px rgba(255,23,68,.32) !important;
  }

  html.dark header.ht-topbar .ht-notify-badge {
    border-color: rgba(9,18,33,.96) !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.72rem !important;
    height: 1.72rem !important;
    min-width: 1.72rem !important;
    font-size: .68rem !important;
    border-radius: 999px !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    position: fixed !important;
    left: .78rem !important;
    top: .62rem !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 10002 !important;

    width: 2.48rem !important;
    height: 2.48rem !important;
    min-width: 2.48rem !important;
    padding: 0 !important;
    border-radius: 1.05rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background:
      linear-gradient(135deg, #02b9ef 0%, #2f8df7 45%, #6d5dfc 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.38) !important;
    box-shadow:
      0 14px 30px rgba(0,174,239,.30),
      0 7px 17px rgba(99,102,241,.18),
      inset 0 1px 0 rgba(255,255,255,.46) !important;
    backdrop-filter: blur(18px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    display: none !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    width: 1.08rem !important;
    height: .14rem !important;
    border-radius: 999px !important;
    background: currentColor !important;
    transform: translateX(-50%) !important;
  }

  #htMobileSidebarToggle::before {
    top: .78rem !important;
    box-shadow: 0 .43rem 0 currentColor !important;
  }

  #htMobileSidebarToggle::after {
    top: 1.64rem !important;
    width: .72rem !important;
    margin-left: .18rem !important;
    opacity: .96 !important;
  }

  body.sidebar-open header.ht-topbar .ht-topbar-actions,
  body.ht-sidebar-open header.ht-topbar .ht-topbar-actions,
  body.menu-open header.ht-topbar .ht-topbar-actions,
  .ht-sidebar-open header.ht-topbar .ht-topbar-actions,
  .sidebar-open header.ht-topbar .ht-topbar-actions {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-.35rem) scale(.96) !important;
  }

  body.sidebar-open #htMobileSidebarToggle::before,
  body.ht-sidebar-open #htMobileSidebarToggle::before,
  body.menu-open #htMobileSidebarToggle::before,
  .ht-sidebar-open #htMobileSidebarToggle::before,
  .sidebar-open #htMobileSidebarToggle::before {
    top: 1.18rem !important;
    box-shadow: none !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }

  body.sidebar-open #htMobileSidebarToggle::after,
  body.ht-sidebar-open #htMobileSidebarToggle::after,
  body.menu-open #htMobileSidebarToggle::after,
  .ht-sidebar-open #htMobileSidebarToggle::after,
  .sidebar-open #htMobileSidebarToggle::after {
    top: 1.18rem !important;
    width: 1.08rem !important;
    margin-left: 0 !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }
}

/* =========================================================
   MOBILE POLISH: more compact utility + sidebar above all + small X
   ========================================================= */

@media screen and (max-width: 720px) {
  header.ht-topbar {
    height: 3.28rem !important;
    min-height: 3.28rem !important;
    padding: .42rem 5.8rem .42rem 3.35rem !important;
    z-index: 9000 !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .48rem !important;
    letter-spacing: .15em !important;
    margin-bottom: .11rem !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: .86rem !important;
    line-height: 1 !important;
  }

  header.ht-topbar .ht-topbar-actions {
    top: .52rem !important;
    right: .52rem !important;
    height: 2.2rem !important;
    min-height: 2.2rem !important;
    padding: .18rem !important;
    gap: .12rem !important;
    border-radius: 999px !important;
    z-index: 10001 !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 1.74rem !important;
    height: 1.74rem !important;
    min-width: 1.74rem !important;
    max-width: 1.74rem !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .92rem !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: .98rem !important;
    height: .98rem !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.2rem !important;
    right: -.16rem !important;
    min-width: .88rem !important;
    height: .88rem !important;
    padding: 0 .18rem !important;
    font-size: .48rem !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.52rem !important;
    height: 1.52rem !important;
    min-width: 1.52rem !important;
    font-size: .62rem !important;
  }

  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    top: .49rem !important;
    left: .55rem !important;
    width: 2.18rem !important;
    height: 2.18rem !important;
    min-width: 2.18rem !important;
    border-radius: .86rem !important;
    z-index: 10002 !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    width: .92rem !important;
    height: .13rem !important;
  }

  #htMobileSidebarToggle::before {
    top: .68rem !important;
    box-shadow: 0 .38rem 0 currentColor !important;
  }

  #htMobileSidebarToggle::after {
    top: 1.44rem !important;
    width: .62rem !important;
    margin-left: .15rem !important;
  }

  body.ht-mobile-sidebar-is-open header.ht-topbar {
    z-index: 2147482000 !important;
  }

  body.ht-mobile-sidebar-is-open header.ht-topbar .ht-topbar-actions {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-.25rem) scale(.94) !important;
  }

  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle,
  body.sidebar-open #htMobileSidebarToggle,
  body.ht-sidebar-open #htMobileSidebarToggle,
  body.menu-open #htMobileSidebarToggle {
    position: fixed !important;
    top: .6rem !important;
    right: .72rem !important;
    left: auto !important;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    border-radius: 999px !important;
    z-index: 2147483647 !important;
    background: rgba(8,17,31,.82) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.34) !important;
    box-shadow:
      0 12px 30px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.25) !important;
  }

  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle::before,
  body.sidebar-open #htMobileSidebarToggle::before,
  body.ht-sidebar-open #htMobileSidebarToggle::before,
  body.menu-open #htMobileSidebarToggle::before {
    top: .93rem !important;
    width: .92rem !important;
    box-shadow: none !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }

  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle::after,
  body.sidebar-open #htMobileSidebarToggle::after,
  body.ht-sidebar-open #htMobileSidebarToggle::after,
  body.menu-open #htMobileSidebarToggle::after {
    top: .93rem !important;
    width: .92rem !important;
    margin-left: 0 !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }

  body.ht-mobile-sidebar-is-open aside,
  body.ht-mobile-sidebar-is-open .ht-sidebar,
  body.ht-mobile-sidebar-is-open [data-sidebar],
  body.sidebar-open aside,
  body.sidebar-open .ht-sidebar,
  body.ht-sidebar-open aside,
  body.ht-sidebar-open .ht-sidebar,
  body.menu-open aside,
  body.menu-open .ht-sidebar {
    z-index: 2147483000 !important;
  }

  body.ht-mobile-sidebar-is-open .ht-sidebar-overlay,
  body.ht-mobile-sidebar-is-open .sidebar-overlay,
  body.ht-mobile-sidebar-is-open [data-sidebar-overlay],
  body.sidebar-open .ht-sidebar-overlay,
  body.sidebar-open .sidebar-overlay,
  body.ht-sidebar-open .ht-sidebar-overlay,
  body.ht-sidebar-open .sidebar-overlay,
  body.menu-open .ht-sidebar-overlay,
  body.menu-open .sidebar-overlay {
    z-index: 2147482500 !important;
  }
}

/* =========================================================
   MEDIUM SCREEN POLISH: compact hero buttons/action stack
   ========================================================= */

@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-page-hero-v2,
  .ht-admin-hero-v2 {
    padding: 1.45rem 1.6rem !important;
    gap: 1rem !important;
    border-radius: 1.25rem !important;
  }

  .ht-page-hero-v2 h1,
  .ht-admin-hero-v2 h1,
  .ht-hero-title,
  .ht-dashboard-hero-title {
    font-size: clamp(2rem, 4.2vw, 3.25rem) !important;
    line-height: .95 !important;
    letter-spacing: -.055em !important;
    margin-bottom: .7rem !important;
  }

  .ht-page-hero-v2 p,
  .ht-admin-hero-v2 p,
  .ht-hero-copy,
  .ht-dashboard-hero-copy {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    max-width: 58rem !important;
    margin-bottom: .8rem !important;
  }

  .ht-page-hero-v2 .ht-hero-actions,
  .ht-admin-hero-v2 .ht-hero-actions,
  .ht-dashboard-actions,
  .ht-quick-actions,
  .ht-action-grid,
  .ht-hero-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: .55rem !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-top: .85rem !important;
  }

  .ht-page-hero-v2 .ht-hero-actions > *,
  .ht-admin-hero-v2 .ht-hero-actions > *,
  .ht-dashboard-actions > *,
  .ht-quick-actions > *,
  .ht-action-grid > *,
  .ht-hero-buttons > * {
    width: 100% !important;
    min-height: 2.45rem !important;
    height: 2.45rem !important;
    padding: 0 .75rem !important;
    border-radius: .85rem !important;
    font-size: .88rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 920px) {
  .ht-page-hero-v2 .ht-hero-actions,
  .ht-admin-hero-v2 .ht-hero-actions,
  .ht-dashboard-actions,
  .ht-quick-actions,
  .ht-action-grid,
  .ht-hero-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   EXACT ADMIN DASHBOARD: compact hero action buttons
   ========================================================= */

.ht-admin-actions-v2.ht-admin-actions-compact {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: .58rem !important;
  margin-top: 1rem !important;
  width: 100% !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a {
  min-height: 2.7rem !important;
  height: 2.7rem !important;
  padding: 0 .82rem !important;
  border-radius: .95rem !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;

  font-size: .88rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a span {
  width: 1.22rem !important;
  height: 1.22rem !important;
  min-width: 1.22rem !important;
  border-radius: .45rem !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: .75rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;

  background: rgba(255,255,255,.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35) !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a.ht-action-secondary span {
  background: rgba(0,174,239,.10) !important;
  color: var(--ht-primary, #00aeef) !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a strong {
  font: inherit !important;
  font-weight: 950 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-admin-hero-v2 {
    padding: 1.55rem 1.7rem !important;
    gap: 1rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(2.2rem, 4.1vw, 3.35rem) !important;
    line-height: .94 !important;
    letter-spacing: -.055em !important;
    margin-bottom: .65rem !important;
  }

  .ht-admin-hero-v2 p {
    font-size: 1rem !important;
    line-height: 1.32 !important;
    margin-bottom: .3rem !important;
    max-width: 68rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: .5rem !important;
    margin-top: .85rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0 .65rem !important;
    border-radius: .85rem !important;
    font-size: .82rem !important;
    gap: .34rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a span {
    width: 1.05rem !important;
    height: 1.05rem !important;
    min-width: 1.05rem !important;
    font-size: .68rem !important;
    border-radius: .38rem !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 900px) {
  .ht-admin-actions-v2.ht-admin-actions-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media screen and (max-width: 720px) {
  .ht-admin-actions-v2.ht-admin-actions-compact {
    grid-template-columns: 1fr 1fr !important;
    gap: .55rem !important;
    margin-top: .85rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.55rem !important;
    min-height: 2.55rem !important;
    padding: 0 .68rem !important;
    font-size: .82rem !important;
    border-radius: .88rem !important;
  }
}

/* =========================================================
   FIX SMALL MOBILE DASHBOARD AFTER MEDIUM COMPACT PATCH
   - Prevent horizontal cutoff
   - Stack admin action buttons neatly on narrow phones
   - Hide desktop Client View button on mobile top utility
   ========================================================= */

@media screen and (max-width: 720px) {
  html,
  body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .ht-admin-dashboard-v2,
  .ht-page-v2 {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .ht-admin-hero-v2 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 1.35rem 1.15rem !important;
    border-radius: 1.25rem !important;
    overflow: hidden !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
  }

  .ht-admin-hero-v2 > div {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-admin-hero-v2 .ht-kicker {
    font-size: .68rem !important;
    letter-spacing: .20em !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(2.15rem, 12vw, 3.05rem) !important;
    line-height: .92 !important;
    letter-spacing: -.065em !important;
    margin: .35rem 0 .65rem !important;
    max-width: 100% !important;
    overflow-wrap: normal !important;
  }

  .ht-admin-hero-v2 p {
    font-size: 1rem !important;
    line-height: 1.38 !important;
    max-width: 100% !important;
    margin: 0 0 .95rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .58rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: .95rem !important;
    overflow: visible !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 2.72rem !important;
    min-height: 2.72rem !important;
    padding: 0 .8rem !important;
    border-radius: .92rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;

    font-size: .9rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a span {
    width: 1.14rem !important;
    height: 1.14rem !important;
    min-width: 1.14rem !important;
    font-size: .68rem !important;
    border-radius: .42rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .ht-admin-health-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 1.15rem !important;
    border-radius: 1.15rem !important;
  }

  .ht-admin-health-card strong {
    font-size: clamp(2.1rem, 11vw, 3rem) !important;
    line-height: .95 !important;
  }

  header.ht-topbar .ht-topbar-btn {
    display: none !important;
  }

  header.ht-topbar {
    padding-right: 5.15rem !important;
  }

  header.ht-topbar .ht-topbar-actions {
    right: .42rem !important;
    max-width: 4.95rem !important;
  }

  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-user-chip {
    width: 1.55rem !important;
    height: 1.55rem !important;
    min-width: 1.55rem !important;
    max-width: 1.55rem !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.36rem !important;
    height: 1.36rem !important;
    min-width: 1.36rem !important;
    font-size: .56rem !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .84rem !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: .9rem !important;
    height: .9rem !important;
  }
}

/* Very narrow phone/window */
@media screen and (max-width: 430px) {
  .ht-admin-hero-v2 {
    padding: 1.15rem .95rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(2rem, 11.5vw, 2.65rem) !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.62rem !important;
    min-height: 2.62rem !important;
    font-size: .86rem !important;
  }
}

/* =========================================================
   MEDIUM SCREEN: keep topbar title + utility menu on same line
   ========================================================= */

@media screen and (min-width: 721px) and (max-width: 1180px) {
  header.ht-topbar {
    height: 4.35rem !important;
    min-height: 4.35rem !important;
    padding: .75rem 1.15rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;

    overflow: visible !important;
  }

  header.ht-topbar > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 24rem) !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .68rem !important;
    line-height: 1 !important;
    margin: 0 0 .18rem !important;
    max-width: 100% !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
    max-width: 100% !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: static !important;
    inset: auto !important;
    transform: none !important;

    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: .45rem !important;

    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  header.ht-topbar .ht-topbar-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    height: 2.35rem !important;
    min-height: 2.35rem !important;
    padding: 0 .9rem !important;
    border-radius: .9rem !important;

    font-size: .82rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 2.35rem !important;
    height: 2.35rem !important;
    min-width: 2.35rem !important;
    max-width: 2.35rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;
    inset: auto !important;
    transform: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
  }

  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-logout-label {
    display: none !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 2.05rem !important;
    height: 2.05rem !important;
    min-width: 2.05rem !important;
    font-size: .72rem !important;
  }

  #htMobileSidebarToggle,
  .ht-mobile-menu-btn {
    bottom: 1rem !important;
    top: auto !important;
    left: 1rem !important;
    right: auto !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 920px) {
  header.ht-topbar > div:first-child {
    max-width: calc(100% - 17rem) !important;
  }

  header.ht-topbar .ht-topbar-btn {
    display: none !important;
  }
}

/* =========================================================
   FINAL OVERRIDE: medium/tablet topbar utility placement
   Fixes utility icons dropping below header
   ========================================================= */

@media screen and (min-width: 721px) and (max-width: 1180px) {
  header.ht-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;

    height: 4.1rem !important;
    min-height: 4.1rem !important;
    padding: .65rem 1rem !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 1rem !important;

    overflow: visible !important;
  }

  header.ht-topbar > div:first-child {
    grid-column: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    text-align: left !important;
  }

  header.ht-topbar .ht-page-kicker {
    font-size: .62rem !important;
    line-height: 1 !important;
    letter-spacing: .19em !important;
    margin: 0 0 .18rem !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  header.ht-topbar .ht-page-title {
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  header.ht-topbar .ht-topbar-actions {
    grid-column: 2 !important;

    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 2.55rem !important;
    min-height: 2.55rem !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: .38rem !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  header.ht-topbar .ht-topbar-btn {
    display: inline-flex !important;
    width: auto !important;
    min-width: max-content !important;
    height: 2.28rem !important;
    min-height: 2.28rem !important;
    padding: 0 .82rem !important;
    border-radius: .9rem !important;
    font-size: .8rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    position: relative !important;
    inset: auto !important;
    transform: none !important;

    width: 2.28rem !important;
    height: 2.28rem !important;
    min-width: 2.28rem !important;
    max-width: 2.28rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-logout-label {
    display: none !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    font-size: .72rem !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.2rem !important;
    right: -.18rem !important;
  }

  #htMobileSidebarToggle,
  .ht-mobile-menu-btn {
    position: fixed !important;
    left: 1rem !important;
    bottom: 1rem !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: 10002 !important;
  }
}

/* Slightly tighter tablet widths: hide Client/Admin View text button only */
@media screen and (min-width: 721px) and (max-width: 960px) {
  header.ht-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  header.ht-topbar .ht-topbar-btn {
    display: none !important;
  }

  header.ht-topbar .ht-topbar-actions {
    gap: .3rem !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 2.18rem !important;
    height: 2.18rem !important;
    min-width: 2.18rem !important;
    max-width: 2.18rem !important;
  }
}

/* =========================================================
   FINAL RESPONSIVE DASHBOARD CLEANUP
   phone: single column, no cutoff
   tablet: 2-column actions, no overflow
   desktop: hero + status side-by-side, buttons readable
   ========================================================= */

.ht-admin-hero-v2 {
  overflow: hidden !important;
}

.ht-admin-hero-v2 > div {
  min-width: 0 !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact {
  min-width: 0 !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a {
  min-width: 0 !important;
}

.ht-admin-actions-v2.ht-admin-actions-compact > a strong {
  min-width: 0 !important;
}

/* Desktop / large screens */
@media screen and (min-width: 1181px) {
  .ht-admin-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(20rem, .75fr) !important;
    align-items: center !important;
    gap: 1.25rem !important;
    padding: 2rem 2.15rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(3rem, 4.1vw, 4.85rem) !important;
    line-height: .92 !important;
    letter-spacing: -.065em !important;
    margin-bottom: .85rem !important;
  }

  .ht-admin-hero-v2 p {
    max-width: 45rem !important;
    line-height: 1.35 !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(8.5rem, 1fr)) !important;
    gap: .7rem !important;
    max-width: 50rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.8rem !important;
    min-height: 2.8rem !important;
    padding: 0 .9rem !important;
    font-size: .88rem !important;
  }

  .ht-admin-health-card {
    width: 100% !important;
    max-width: 28rem !important;
    justify-self: end !important;
  }
}

/* Medium landscape/tablet */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-admin-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    padding: 1.55rem 1.7rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(2.15rem, 5vw, 3.25rem) !important;
    line-height: .95 !important;
    letter-spacing: -.06em !important;
    margin: .35rem 0 .65rem !important;
  }

  .ht-admin-hero-v2 p {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    max-width: 52rem !important;
    margin-bottom: .9rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .62rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.65rem !important;
    min-height: 2.65rem !important;
    padding: 0 .75rem !important;
    font-size: .86rem !important;
    border-radius: .9rem !important;
  }

  .ht-admin-health-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem 1.45rem !important;
  }

  .ht-activity-badges,
  .ht-admin-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Small tablets / narrow landscape */
@media screen and (min-width: 721px) and (max-width: 860px) {
  .ht-admin-actions-v2.ht-admin-actions-compact {
    grid-template-columns: 1fr !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    justify-content: center !important;
  }
}

/* Phones */
@media screen and (max-width: 720px) {
  .ht-admin-dashboard-v2 {
    gap: 1rem !important;
  }

  .ht-admin-hero-v2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
    padding: 1.15rem .95rem !important;
    border-radius: 1.15rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(2rem, 10.5vw, 2.85rem) !important;
    line-height: .92 !important;
    letter-spacing: -.065em !important;
    margin: .35rem 0 .65rem !important;
  }

  .ht-admin-hero-v2 p {
    font-size: .98rem !important;
    line-height: 1.36 !important;
    margin-bottom: .75rem !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    width: 100% !important;
    max-width: 100% !important;
    height: 2.62rem !important;
    min-height: 2.62rem !important;
    padding: 0 .8rem !important;
    border-radius: .92rem !important;
    font-size: .86rem !important;
    justify-content: center !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a strong {
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .ht-admin-health-card {
    padding: 1.05rem !important;
    border-radius: 1rem !important;
  }

  .ht-activity-badges,
  .ht-admin-dashboard-metrics,
  .ht-metrics-grid-v2 {
    grid-template-columns: 1fr !important;
    gap: .85rem !important;
  }
}

/* Tiny phone / split view */
@media screen and (max-width: 430px) {
  .ht-admin-hero-v2 {
    padding: 1rem .85rem !important;
  }

  .ht-admin-hero-v2 h1 {
    font-size: clamp(1.85rem, 10vw, 2.45rem) !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    height: 2.52rem !important;
    min-height: 2.52rem !important;
    font-size: .82rem !important;
  }
}

/* =========================================================
   SIDEBAR PREMIUM PHASE
   cleaner sidebar, better active state, smoother mobile overlay
   ========================================================= */

.ht-sidebar {
  overflow: hidden auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0,174,239,.28) transparent !important;
}

.ht-sidebar::-webkit-scrollbar {
  width: 6px !important;
}

.ht-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,174,239,.28) !important;
  border-radius: 999px !important;
}

.ht-sidebar .ht-brand,
.ht-brand.ht-brand-real-logo {
  padding: 1.15rem 1.2rem .9rem !important;
  margin-bottom: .25rem !important;
}

.ht-sidebar-real-logo {
  max-width: 11.5rem !important;
  height: auto !important;
  object-fit: contain !important;
  filter: drop-shadow(0 8px 18px rgba(8,17,31,.08)) !important;
}

.ht-sidebar .ht-nav,
.ht-sidebar nav {
  display: grid !important;
  gap: .42rem !important;
  padding: .35rem .85rem !important;
}

.ht-sidebar .ht-nav-link,
.ht-sidebar a {
  position: relative !important;
  min-height: 2.9rem !important;
  padding: 0 .92rem !important;
  border-radius: 1rem !important;

  display: flex !important;
  align-items: center !important;
  gap: .78rem !important;

  color: var(--ht-muted, #526173) !important;
  font-weight: 900 !important;
  text-decoration: none !important;

  border: 1px solid transparent !important;
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease !important;
}

.ht-sidebar .ht-nav-link:hover,
.ht-sidebar a:hover {
  transform: translateX(2px) !important;
  color: var(--ht-heading, #071525) !important;
  background:
    linear-gradient(135deg, rgba(0,174,239,.08), rgba(99,102,241,.06)) !important;
  border-color: rgba(0,174,239,.16) !important;
}

html.dark .ht-sidebar .ht-nav-link:hover,
html.dark .ht-sidebar a:hover {
  color: #eaf7ff !important;
  background:
    linear-gradient(135deg, rgba(0,174,239,.14), rgba(99,102,241,.10)) !important;
  border-color: rgba(160,220,255,.16) !important;
}

.ht-sidebar .ht-nav-link.active,
.ht-sidebar a.active,
.ht-sidebar .active {
  color: #fff !important;
  background:
    linear-gradient(135deg, #02b9ef 0%, #2f8df7 46%, #6d5dfc 100%) !important;
  border-color: rgba(255,255,255,.28) !important;
  box-shadow:
    0 16px 34px rgba(0,174,239,.24),
    0 8px 18px rgba(99,102,241,.15),
    inset 0 1px 0 rgba(255,255,255,.34) !important;
}

.ht-sidebar .ht-nav-link.active::before,
.ht-sidebar a.active::before {
  content: "" !important;
  position: absolute !important;
  left: -.45rem !important;
  top: 50% !important;
  width: .22rem !important;
  height: 1.55rem !important;
  border-radius: 999px !important;
  transform: translateY(-50%) !important;
  background: #02b9ef !important;
  box-shadow: 0 0 16px rgba(0,174,239,.70) !important;
}

.ht-sidebar .ht-nav-icon,
.ht-sidebar svg {
  width: 1.22rem !important;
  height: 1.22rem !important;
  flex: 0 0 auto !important;
}

.ht-sidebar .ht-nav-link span,
.ht-sidebar a span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ht-sidebar-card {
  margin: .9rem .85rem 1rem !important;
  padding: 1rem !important;
  border-radius: 1.15rem !important;
  border: 1px solid rgba(120,170,210,.20) !important;
  background:
    radial-gradient(circle at 15% 0%, rgba(0,174,239,.12), transparent 48%),
    rgba(255,255,255,.58) !important;
  box-shadow:
    0 16px 34px rgba(8,17,31,.08),
    inset 0 1px 0 rgba(255,255,255,.68) !important;
}

html.dark .ht-sidebar-card {
  background:
    radial-gradient(circle at 15% 0%, rgba(0,174,239,.16), transparent 48%),
    rgba(12,24,42,.58) !important;
  border-color: rgba(160,220,255,.16) !important;
}

.ht-status-pill {
  min-height: 2rem !important;
  border-radius: 999px !important;
  padding: 0 .75rem !important;
  font-weight: 950 !important;
}

/* Mobile drawer */
@media screen and (max-width: 720px) {
  .ht-mobile-sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147482500 !important;
    background: rgba(7,15,28,.46) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .22s ease !important;
  }

  body.ht-mobile-sidebar-open .ht-mobile-sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.ht-mobile-sidebar-open .ht-sidebar {
    z-index: 2147483000 !important;
  }

  .ht-sidebar {
    width: min(18.5rem, 82vw) !important;
    border-right: 1px solid rgba(120,170,210,.22) !important;
    box-shadow:
      22px 0 70px rgba(8,17,31,.26),
      inset -1px 0 0 rgba(255,255,255,.35) !important;
  }

  .ht-sidebar .ht-brand,
  .ht-brand.ht-brand-real-logo {
    padding-top: 1rem !important;
    padding-bottom: .55rem !important;
  }

  .ht-sidebar-real-logo {
    max-width: 9.5rem !important;
  }

  .ht-sidebar .ht-nav,
  .ht-sidebar nav {
    gap: .34rem !important;
    padding: .35rem .72rem !important;
  }

  .ht-sidebar .ht-nav-link,
  .ht-sidebar a {
    min-height: 2.72rem !important;
    border-radius: .95rem !important;
    padding: 0 .82rem !important;
    gap: .68rem !important;
    font-size: .92rem !important;
  }

  .ht-sidebar-card {
    margin: .75rem .72rem 1rem !important;
    padding: .9rem !important;
  }

  body.ht-mobile-sidebar-open #htMobileSidebarToggle,
  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle {
    top: .62rem !important;
    right: .72rem !important;
    left: auto !important;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    border-radius: 999px !important;
    background: rgba(8,17,31,.86) !important;
    color: #fff !important;
    z-index: 2147483647 !important;
  }
}

/* Desktop sidebar subtle refinement */
@media screen and (min-width: 1181px) {
  .ht-sidebar {
    box-shadow:
      10px 0 40px rgba(8,17,31,.04),
      inset -1px 0 0 rgba(120,170,210,.14) !important;
  }
}

/* =========================================================
   DASHBOARD KPI RESPONSIVE OVERFLOW FIX
   ========================================================= */

@media screen and (max-width: 1180px) {

  .ht-dashboard-stats,
  .ht-kpi-grid,
  .ht-stats-grid,
  .dashboard-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    min-width: 0 !important;
  }

  .ht-dashboard-stat,
  .ht-kpi-card,
  .ht-stat-card,
  .dashboard-stat-card {
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .ht-dashboard-stat *,
  .ht-kpi-card *,
  .ht-stat-card *,
  .dashboard-stat-card * {
    min-width: 0 !important;
    word-break: break-word !important;
  }

  .ht-dashboard-stat-title,
  .ht-kpi-title,
  .ht-stat-title {
    white-space: normal !important;
    line-height: 1.15 !important;
  }
}

@media screen and (max-width: 720px) {

  .ht-dashboard-stats,
  .ht-kpi-grid,
  .ht-stats-grid,
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   MEDIUM ONLY: fix activity badge/card horizontal overflow
   ========================================================= */

@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-content,
  .ht-admin-dashboard-v2,
  .ht-page-v2 {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .ht-activity-badges {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .75rem !important;

    overflow: visible !important;
  }

  .ht-activity-badge {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 6rem !important;

    padding: 1rem !important;
    border-radius: 1rem !important;

    overflow: hidden !important;
  }

  .ht-activity-badge span {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    font-size: .68rem !important;
    line-height: 1.18 !important;
    letter-spacing: .16em !important;
  }

  .ht-activity-badge strong {
    display: block !important;
    margin-top: .75rem !important;
    font-size: 2rem !important;
    line-height: .95 !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 900px) {
  .ht-activity-badges {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   HARD FIX: medium dashboard activity cards overflow
   ========================================================= */

@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-activity-badges {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: .65rem !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    overflow: visible !important;
  }

  .ht-activity-badges > *,
  .ht-activity-badge {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: unset !important;

    padding: .85rem .8rem !important;
    min-height: 5.4rem !important;
    height: auto !important;
    border-radius: 1rem !important;

    overflow: hidden !important;
  }

  .ht-activity-badge span {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;

    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;

    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;

    font-size: clamp(.48rem, 1.1vw, .66rem) !important;
    line-height: 1.18 !important;
    letter-spacing: .13em !important;
  }

  .ht-activity-badge strong {
    display: block !important;
    margin-top: .55rem !important;
    font-size: clamp(1.55rem, 3.3vw, 2.05rem) !important;
    line-height: .95 !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 980px) {
  .ht-activity-badges {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 820px) {
  .ht-activity-badges {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   FINAL FIX: stop dashboard activity cards from becoming skinny columns
   This overrides all previous KPI/activity patches.
   ========================================================= */

.ht-activity-badges {
  min-width: 0 !important;
  max-width: 100% !important;
}

.ht-activity-badges > .ht-activity-badge,
.ht-activity-badge {
  min-width: 0 !important;
  max-width: 100% !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

.ht-activity-badge span,
.ht-activity-badge strong {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* Wide desktop */
@media screen and (min-width: 1181px) {
  .ht-activity-badges {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    overflow: visible !important;
  }
}

/* Medium/tablet: 2 columns, never 5 tiny columns */
@media screen and (min-width: 901px) and (max-width: 1180px) {
  .ht-activity-badges {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .85rem !important;
    overflow: visible !important;
  }

  .ht-activity-badge {
    min-height: 5.4rem !important;
    padding: 1rem !important;
  }
}

/* Small split-screen/tablet/mobile: 1 clean column */
@media screen and (max-width: 900px) {
  .ht-activity-badges {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .85rem !important;
    overflow: visible !important;
  }

  .ht-activity-badge {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 5rem !important;
    padding: 1rem !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
  }

  .ht-activity-badge span {
    display: block !important;
    font-size: .68rem !important;
    line-height: 1.18 !important;
    letter-spacing: .14em !important;
  }

  .ht-activity-badge strong {
    display: block !important;
    margin-top: .6rem !important;
    font-size: 2rem !important;
    line-height: 1 !important;
  }
}

/* =========================================================
   REAL FIX: container-based KPI/activity cards
   Works even when iPad/Safari window reports weird viewport width.
   ========================================================= */

.ht-admin-dashboard-v2,
.ht-page-v2,
.ht-content {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.ht-activity-badges,
.ht-admin-dashboard-metrics,
.ht-metrics-grid-v2 {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)) !important;
  gap: .9rem !important;

  overflow: visible !important;
}

.ht-activity-badges > *,
.ht-admin-dashboard-metrics > *,
.ht-metrics-grid-v2 > *,
.ht-activity-badge,
.ht-metric-card-v2 {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 1 auto !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
}

.ht-activity-badge {
  min-height: 5.25rem !important;
  padding: 1rem !important;
  border-radius: 1rem !important;
}

.ht-activity-badge span,
.ht-metric-card-v2 span {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;

  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;

  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;

  font-size: .68rem !important;
  line-height: 1.18 !important;
  letter-spacing: .14em !important;
}

.ht-activity-badge strong,
.ht-metric-card-v2 strong {
  display: block !important;
  margin-top: .55rem !important;
  line-height: .95 !important;
}

/* Narrow content area: force one clean card per row */
@media screen and (max-width: 760px) {
  .ht-activity-badges,
  .ht-admin-dashboard-metrics,
  .ht-metrics-grid-v2 {
    grid-template-columns: 1fr !important;
  }

  .ht-activity-badge {
    min-height: 4.8rem !important;
  }
}

/* Medium content area: two clean columns max */
@media screen and (min-width: 761px) and (max-width: 1180px) {
  .ht-activity-badges,
  .ht-admin-dashboard-metrics,
  .ht-metrics-grid-v2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)) !important;
  }
}

/* =========================================================
   SMART KPI GRID: admin + client dashboard only
   New classes avoid old conflicting .ht-activity-badges/.ht-metrics rules.
   ========================================================= */

.ht-smart-kpi-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)) !important;
  gap: 1rem !important;

  overflow: visible !important;
}

.ht-smart-kpi-card {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;

  padding: 1.05rem 1.15rem !important;
  min-height: 7rem !important;
  border-radius: 1.15rem !important;

  border: 1px solid rgba(120,170,210,.28) !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(0,174,239,.10), transparent 44%),
    rgba(255,255,255,.66) !important;
  box-shadow:
    0 16px 34px rgba(8,17,31,.08),
    inset 0 1px 0 rgba(255,255,255,.76) !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
}

html.dark .ht-smart-kpi-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(0,174,239,.14), transparent 44%),
    rgba(12,24,42,.62) !important;
  border-color: rgba(160,220,255,.18) !important;
}

.ht-smart-kpi-card span {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;

  color: var(--ht-muted, #526173) !important;
  font-size: .72rem !important;
  line-height: 1.15 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  font-weight: 950 !important;

  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.ht-smart-kpi-card strong {
  display: block !important;
  margin-top: .62rem !important;
  color: var(--ht-heading, #071525) !important;
  font-size: clamp(2rem, 4vw, 2.7rem) !important;
  line-height: .95 !important;
  letter-spacing: -.04em !important;
  font-weight: 950 !important;
}

.ht-smart-kpi-card p {
  display: block !important;
  margin: .55rem 0 0 !important;
  color: var(--ht-muted, #526173) !important;
  font-size: .9rem !important;
  line-height: 1.28 !important;
}

.ht-smart-kpi-card.accent {
  background:
    radial-gradient(circle at 100% 0%, rgba(0,174,239,.16), transparent 44%),
    rgba(255,255,255,.70) !important;
}

.ht-smart-kpi-card.danger {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,45,85,.13), transparent 44%),
    rgba(255,255,255,.70) !important;
}

.ht-smart-kpi-card:hover {
  transform: translateY(-1px) !important;
  box-shadow:
    0 20px 42px rgba(8,17,31,.10),
    inset 0 1px 0 rgba(255,255,255,.80) !important;
}

/* Desktop: activity can show 5, metrics can show 4 */
@media screen and (min-width: 1181px) {
  .ht-smart-kpi-activity {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .ht-smart-kpi-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Medium: never create skinny columns */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-smart-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .85rem !important;
  }

  .ht-smart-kpi-card {
    min-height: 6.3rem !important;
    padding: 1rem !important;
  }

  .ht-smart-kpi-card span {
    font-size: .68rem !important;
    letter-spacing: .14em !important;
  }

  .ht-smart-kpi-card strong {
    font-size: 2.1rem !important;
  }
}

/* Small: one clean card per row */
@media screen and (max-width: 720px) {
  .ht-smart-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: .8rem !important;
  }

  .ht-smart-kpi-card {
    min-height: 5.4rem !important;
    padding: .95rem 1rem !important;
  }

  .ht-smart-kpi-card span {
    font-size: .66rem !important;
    letter-spacing: .13em !important;
  }

  .ht-smart-kpi-card strong {
    font-size: 2rem !important;
  }
}

/* =========================================================
   TABLES + LISTS PHASE
   Responsive admin/client tables, payment actions, ticket cards
   ========================================================= */

.ht-panel-v2 {
  min-width: 0 !important;
}

.ht-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  border-radius: 1.1rem !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0,174,239,.28) transparent !important;
}

.ht-table-wrap::-webkit-scrollbar {
  height: 7px !important;
}

.ht-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,174,239,.28) !important;
  border-radius: 999px !important;
}

.ht-clean-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 .55rem !important;
}

.ht-clean-table thead th {
  padding: .65rem .85rem !important;
  color: var(--ht-muted, #526173) !important;
  font-size: .68rem !important;
  line-height: 1.1 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

.ht-clean-table tbody tr {
  transition: transform .16s ease, box-shadow .16s ease !important;
}

.ht-clean-table tbody tr:hover {
  transform: translateY(-1px) !important;
}

.ht-clean-table tbody td {
  padding: .9rem .85rem !important;
  background: rgba(255,255,255,.62) !important;
  border-top: 1px solid rgba(120,170,210,.20) !important;
  border-bottom: 1px solid rgba(120,170,210,.20) !important;
  vertical-align: middle !important;
}

.ht-clean-table tbody td:first-child {
  border-left: 1px solid rgba(120,170,210,.20) !important;
  border-top-left-radius: .95rem !important;
  border-bottom-left-radius: .95rem !important;
}

.ht-clean-table tbody td:last-child {
  border-right: 1px solid rgba(120,170,210,.20) !important;
  border-top-right-radius: .95rem !important;
  border-bottom-right-radius: .95rem !important;
}

html.dark .ht-clean-table tbody td {
  background: rgba(12,24,42,.56) !important;
  border-color: rgba(160,220,255,.14) !important;
}

.ht-table-title {
  min-width: 0 !important;
}

.ht-table-title strong,
.ht-clean-table td strong,
.ht-clean-table td a {
  overflow-wrap: anywhere !important;
}

.ht-table-action,
.ht-payment-actions {
  white-space: nowrap !important;
}

.ht-table-action-link,
.ht-table-action a,
.ht-table-action-button {
  min-height: 2rem !important;
  padding: 0 .72rem !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* Ticket list cards */
.ht-ticket-list-v2 {
  display: grid !important;
  gap: .85rem !important;
  min-width: 0 !important;
}

.ht-ticket-card-v2 {
  min-width: 0 !important;
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 1rem !important;
  align-items: center !important;
  padding: 1rem !important;
  border-radius: 1.15rem !important;
}

.ht-ticket-main {
  min-width: 0 !important;
}

.ht-ticket-main h3,
.ht-ticket-main p,
.ht-ticket-meta {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

.ht-ticket-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .45rem .75rem !important;
}

.ht-ticket-side {
  min-width: 8.5rem !important;
}

.ht-ticket-badges {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .35rem !important;
  justify-content: flex-end !important;
}

/* Medium screens */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-clean-table {
    min-width: 46rem !important;
  }

  .ht-panel-head {
    gap: .8rem !important;
  }

  .ht-table-action.ht-payment-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: .35rem !important;
    min-width: 10rem !important;
    white-space: normal !important;
  }

  .ht-table-action-link,
  .ht-table-action a,
  .ht-table-action-button {
    font-size: .75rem !important;
    min-height: 1.9rem !important;
    padding: 0 .6rem !important;
  }

  .ht-ticket-card-v2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ht-ticket-side {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .75rem !important;
  }

  .ht-ticket-badges {
    justify-content: flex-start !important;
  }
}

/* Mobile: transform tables into clean cards */
@media screen and (max-width: 720px) {
  .ht-table-wrap {
    overflow: visible !important;
    border-radius: 0 !important;
  }

  .ht-clean-table {
    min-width: 0 !important;
    width: 100% !important;
    border-spacing: 0 !important;
  }

  .ht-clean-table thead {
    display: none !important;
  }

  .ht-clean-table,
  .ht-clean-table tbody,
  .ht-clean-table tr,
  .ht-clean-table td {
    display: block !important;
    width: 100% !important;
  }

  .ht-clean-table tbody {
    display: grid !important;
    gap: .85rem !important;
  }

  .ht-clean-table tbody tr {
    padding: .85rem !important;
    border-radius: 1.1rem !important;
    border: 1px solid rgba(120,170,210,.22) !important;
    background: rgba(255,255,255,.66) !important;
    box-shadow: 0 12px 28px rgba(8,17,31,.06) !important;
  }

  html.dark .ht-clean-table tbody tr {
    background: rgba(12,24,42,.60) !important;
    border-color: rgba(160,220,255,.15) !important;
  }

  .ht-clean-table tbody td {
    padding: .62rem 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;

    display: grid !important;
    grid-template-columns: minmax(7rem, .42fr) minmax(0, .58fr) !important;
    gap: .75rem !important;
    align-items: start !important;
    text-align: right !important;
  }

  .ht-clean-table tbody td::before {
    content: attr(data-label) !important;
    color: var(--ht-muted, #526173) !important;
    font-size: .66rem !important;
    line-height: 1.2 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase !important;
    font-weight: 950 !important;
    text-align: left !important;
  }

  .ht-clean-table tbody td:not([data-label])::before,
  .ht-clean-table tbody td[colspan]::before {
    content: none !important;
  }

  .ht-clean-table tbody td[colspan] {
    display: block !important;
    text-align: left !important;
  }

  .ht-clean-table td.ht-right {
    text-align: right !important;
  }

  .ht-table-action,
  .ht-table-action.ht-payment-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: .4rem !important;
    text-align: right !important;
    white-space: normal !important;
  }

  .ht-table-action-link,
  .ht-table-action a,
  .ht-table-action-button,
  .ht-table-action-form {
    width: auto !important;
    max-width: 100% !important;
  }

  .ht-ticket-card-v2 {
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
    padding: .95rem !important;
    border-radius: 1rem !important;
  }

  .ht-ticket-main {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: .75rem !important;
  }

  .ht-ticket-icon {
    width: 2.35rem !important;
    height: 2.35rem !important;
    min-width: 2.35rem !important;
    font-size: .75rem !important;
  }

  .ht-ticket-side {
    min-width: 0 !important;
    display: grid !important;
    gap: .65rem !important;
  }

  .ht-ticket-badges {
    justify-content: flex-start !important;
  }

  .ht-ticket-open-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Tiny mobile */
@media screen and (max-width: 430px) {
  .ht-clean-table tbody td {
    grid-template-columns: 1fr !important;
    gap: .25rem !important;
    text-align: left !important;
  }

  .ht-table-action,
  .ht-table-action.ht-payment-actions {
    justify-content: flex-start !important;
  }

  .ht-table-action-link,
  .ht-table-action a,
  .ht-table-action-button {
    width: 100% !important;
  }

  .ht-ticket-main {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   FIX CLIENT MOBILE TOPBAR UTILITY GAP
   - utility pill stays compact top-right
   - removes blank translucent strip
   - hides client/admin switch on mobile
   ========================================================= */

@media screen and (max-width: 720px) {
  header.ht-topbar {
    height: 3.2rem !important;
    min-height: 3.2rem !important;
    padding: .42rem 5.25rem .42rem 3.35rem !important;
    overflow: visible !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    top: .5rem !important;
    right: .45rem !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;

    width: auto !important;
    max-width: 4.95rem !important;
    height: 2.12rem !important;
    min-height: 2.12rem !important;
    padding: .17rem !important;
    gap: .1rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;

    border-radius: 999px !important;
    background: rgba(255,255,255,.72) !important;
    border: 1px solid rgba(120,170,210,.22) !important;
    box-shadow:
      0 12px 28px rgba(8,17,31,.13),
      inset 0 1px 0 rgba(255,255,255,.78) !important;
    backdrop-filter: blur(18px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.35) !important;
    overflow: visible !important;
    z-index: 10001 !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background: rgba(9,18,33,.76) !important;
    border-color: rgba(160,220,255,.18) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-logout-form,
  header.ht-topbar .ht-logout-btn,
  header.ht-topbar .ht-logout-label,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-theme-toggle-led {
    display: none !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn {
    width: 1.62rem !important;
    height: 1.62rem !important;
    min-width: 1.62rem !important;
    max-width: 1.62rem !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.42rem !important;
    height: 1.42rem !important;
    min-width: 1.42rem !important;
    font-size: .58rem !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .84rem !important;
  }

  header.ht-topbar .ht-notify-svg {
    width: .9rem !important;
    height: .9rem !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.24rem !important;
    right: -.2rem !important;
    min-width: .82rem !important;
    height: .82rem !important;
    font-size: .46rem !important;
    border-width: 2px !important;
  }

  .ht-main,
  .ht-content,
  .ht-client-dashboard,
  .ht-page-v2 {
    overflow-x: hidden !important;
  }
}

/* =========================================================
   FLUID TOPBAR UTILITY FIX
   - logout icon visible
   - utility area grows/shrinks naturally
   - clear on light + dark
   - no washed-out hidden white square
   ========================================================= */

@media screen and (max-width: 720px) {
  header.ht-topbar {
    height: 3.25rem !important;
    min-height: 3.25rem !important;
    padding: .42rem 9.8rem .42rem 3.35rem !important;
    overflow: visible !important;
  }

  header.ht-topbar > div:first-child {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    top: .48rem !important;
    right: .5rem !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;

    width: auto !important;
    min-width: max-content !important;
    max-width: calc(100vw - 4.25rem) !important;
    height: 2.22rem !important;
    min-height: 2.22rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: .16rem !important;

    padding: .18rem !important;
    border-radius: 999px !important;

    background:
      linear-gradient(135deg, rgba(255,255,255,.88), rgba(244,252,255,.76)) !important;
    border: 1px solid rgba(120,170,210,.26) !important;
    box-shadow:
      0 14px 30px rgba(8,17,31,.14),
      inset 0 1px 0 rgba(255,255,255,.86) !important;
    backdrop-filter: blur(20px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.35) !important;

    overflow: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10001 !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background:
      linear-gradient(135deg, rgba(9,18,33,.90), rgba(13,29,50,.76)) !important;
    border-color: rgba(160,220,255,.22) !important;
    box-shadow:
      0 14px 34px rgba(0,0,0,.36),
      inset 0 1px 0 rgba(255,255,255,.12) !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-theme-toggle-led,
  header.ht-topbar .ht-logout-label {
    display: none !important;
  }

  header.ht-topbar .ht-logout-form {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 1.78rem !important;
    height: 1.78rem !important;
    min-width: 1.78rem !important;
    max-width: 1.78rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: relative !important;
    inset: auto !important;
    transform: none !important;

    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;

    color: #071525 !important;
    background: rgba(255,255,255,.58) !important;
    border: 1px solid rgba(120,170,210,.18) !important;
    box-shadow:
      0 5px 13px rgba(8,17,31,.08),
      inset 0 1px 0 rgba(255,255,255,.74) !important;

    overflow: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  html.dark header.ht-topbar .ht-user-chip,
  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-logout-btn {
    color: #eaf7ff !important;
    background: rgba(255,255,255,.08) !important;
    border-color: rgba(160,220,255,.15) !important;
    box-shadow:
      0 5px 13px rgba(0,0,0,.26),
      inset 0 1px 0 rgba(255,255,255,.10) !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.52rem !important;
    height: 1.52rem !important;
    min-width: 1.52rem !important;
    font-size: .62rem !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .9rem !important;
    line-height: 1 !important;
  }

  header.ht-topbar .ht-notify-svg,
  header.ht-topbar .ht-logout-icon svg {
    width: .96rem !important;
    height: .96rem !important;
    display: block !important;
  }

  header.ht-topbar .ht-notify-svg {
    color: #0ea5e9 !important;
  }

  header.ht-topbar .ht-logout-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: .96rem !important;
    height: .96rem !important;
    color: currentColor !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.28rem !important;
    right: -.25rem !important;
    min-width: .88rem !important;
    height: .88rem !important;
    padding: 0 .18rem !important;
    font-size: .48rem !important;
    line-height: .88rem !important;
    border: 2px solid rgba(255,255,255,.95) !important;
    z-index: 5 !important;
  }

  html.dark header.ht-topbar .ht-notify-badge {
    border-color: rgba(9,18,33,.95) !important;
  }
}

/* Very narrow phones: slightly smaller, still all icons visible */
@media screen and (max-width: 430px) {
  header.ht-topbar {
    padding-right: 9.15rem !important;
  }

  header.ht-topbar .ht-topbar-actions {
    right: .38rem !important;
    height: 2.08rem !important;
    min-height: 2.08rem !important;
    padding: .15rem !important;
    gap: .1rem !important;
    max-width: calc(100vw - 3.95rem) !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 1.66rem !important;
    height: 1.66rem !important;
    min-width: 1.66rem !important;
    max-width: 1.66rem !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.42rem !important;
    height: 1.42rem !important;
    min-width: 1.42rem !important;
    font-size: .58rem !important;
  }

  header.ht-topbar .ht-notify-svg,
  header.ht-topbar .ht-logout-icon svg {
    width: .9rem !important;
    height: .9rem !important;
  }
}

/* Medium/tablet: show utility clearly, no washed-out icon clipping */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  header.ht-topbar .ht-topbar-actions {
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 2.6rem !important;
    min-height: 2.6rem !important;
    gap: .38rem !important;
    overflow: visible !important;
  }

  header.ht-topbar .ht-logout-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 2.28rem !important;
    height: 2.28rem !important;
    min-width: 2.28rem !important;
    max-width: 2.28rem !important;
    overflow: visible !important;
    opacity: 1 !important;
  }

  header.ht-topbar .ht-logout-label,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label {
    display: none !important;
  }

  header.ht-topbar .ht-logout-icon,
  header.ht-topbar .ht-logout-icon svg {
    display: block !important;
    width: 1.05rem !important;
    height: 1.05rem !important;
  }
}

/* =========================================================
   CLEAN MOBILE UTILITY BAR
   Fix weird square backgrounds / logout floating box.
   Makes utility one clean glass pill.
   ========================================================= */

@media screen and (max-width: 720px) {
  header.ht-topbar .ht-topbar-actions {
    position: fixed !important;
    top: .52rem !important;
    right: .5rem !important;
    left: auto !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;

    width: auto !important;
    min-width: 8.15rem !important;
    max-width: calc(100vw - 4.25rem) !important;
    height: 2.15rem !important;
    min-height: 2.15rem !important;

    gap: .18rem !important;
    padding: .18rem !important;
    border-radius: 999px !important;

    background: rgba(255,255,255,.78) !important;
    border: 1px solid rgba(125,170,205,.24) !important;
    box-shadow:
      0 12px 28px rgba(8,17,31,.12),
      inset 0 1px 0 rgba(255,255,255,.86) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;

    overflow: visible !important;
    z-index: 10001 !important;
  }

  html.dark header.ht-topbar .ht-topbar-actions {
    background: rgba(10,20,36,.82) !important;
    border-color: rgba(160,220,255,.18) !important;
    box-shadow:
      0 12px 30px rgba(0,0,0,.34),
      inset 0 1px 0 rgba(255,255,255,.12) !important;
  }

  header.ht-topbar .ht-logout-form {
    display: contents !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    position: relative !important;
    inset: auto !important;
    transform: none !important;

    width: 1.72rem !important;
    height: 1.72rem !important;
    min-width: 1.72rem !important;
    max-width: 1.72rem !important;

    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    color: #0b1728 !important;
    opacity: 1 !important;
    overflow: visible !important;
  }

  html.dark header.ht-topbar .ht-user-chip,
  html.dark header.ht-topbar .ht-theme-toggle,
  html.dark header.ht-topbar .ht-notify-btn,
  html.dark header.ht-topbar .ht-logout-btn {
    color: #eef8ff !important;
  }

  header.ht-topbar .ht-user-avatar {
    width: 1.44rem !important;
    height: 1.44rem !important;
    min-width: 1.44rem !important;
    font-size: .58rem !important;
    box-shadow: 0 0 0 1px rgba(0,174,239,.18), 0 6px 14px rgba(0,174,239,.12) !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .92rem !important;
  }

  header.ht-topbar .ht-notify-svg,
  header.ht-topbar .ht-logout-icon,
  header.ht-topbar .ht-logout-icon svg {
    width: .96rem !important;
    height: .96rem !important;
    display: block !important;
  }

  header.ht-topbar .ht-logout-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  header.ht-topbar .ht-notify-badge {
    top: -.27rem !important;
    right: -.22rem !important;
    z-index: 5 !important;
  }

  header.ht-topbar .ht-topbar-btn,
  header.ht-topbar .ht-user-meta,
  header.ht-topbar .ht-theme-toggle-label,
  header.ht-topbar .ht-theme-toggle-led,
  header.ht-topbar .ht-logout-label {
    display: none !important;
  }
}

@media screen and (max-width: 430px) {
  header.ht-topbar .ht-topbar-actions {
    min-width: 7.75rem !important;
    height: 2.05rem !important;
    min-height: 2.05rem !important;
    gap: .12rem !important;
  }

  header.ht-topbar .ht-user-chip,
  header.ht-topbar .ht-theme-toggle,
  header.ht-topbar .ht-notify-btn,
  header.ht-topbar .ht-logout-btn {
    width: 1.62rem !important;
    height: 1.62rem !important;
    min-width: 1.62rem !important;
    max-width: 1.62rem !important;
  }
}

/* =========================================================
   CLIENT DASHBOARD: match admin compact behavior on medium screens
   ========================================================= */

.ht-client-hero-v2 {
  overflow: hidden !important;
}

.ht-client-hero-v2 > div {
  min-width: 0 !important;
}

/* Medium/tablet/split screen */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-client-dashboard {
    gap: 1rem !important;
    overflow-x: hidden !important;
  }

  .ht-client-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;

    padding: 1.55rem 1.7rem !important;
    border-radius: 1.35rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-client-hero-v2 .ht-kicker {
    font-size: .68rem !important;
    line-height: 1 !important;
    letter-spacing: .20em !important;
    margin-bottom: .35rem !important;
  }

  .ht-client-hero-v2 h1 {
    font-size: clamp(2.15rem, 5vw, 3.25rem) !important;
    line-height: .95 !important;
    letter-spacing: -.06em !important;
    margin: .35rem 0 .65rem !important;
    max-width: 100% !important;
  }

  .ht-client-hero-v2 p {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    max-width: 52rem !important;
    margin-bottom: .9rem !important;
  }

  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .62rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-client-actions-v2 > a {
    height: 2.65rem !important;
    min-height: 2.65rem !important;
    padding: 0 .75rem !important;
    border-radius: .9rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: .86rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .ht-health-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem 1.45rem !important;
    border-radius: 1.1rem !important;
  }

  .ht-health-card strong {
    font-size: clamp(1.85rem, 4.5vw, 2.6rem) !important;
    line-height: .98 !important;
  }
}

/* Medium but narrow: stack action buttons cleanly */
@media screen and (min-width: 721px) and (max-width: 860px) {
  .ht-client-actions-v2 {
    grid-template-columns: 1fr !important;
  }
}

/* Desktop: compact like admin with health card to the side */
@media screen and (min-width: 1181px) {
  .ht-client-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(20rem, .75fr) !important;
    align-items: center !important;
    gap: 1.25rem !important;
    padding: 2rem 2.15rem !important;
  }

  .ht-client-hero-v2 h1 {
    font-size: clamp(3rem, 4.1vw, 4.85rem) !important;
    line-height: .92 !important;
    letter-spacing: -.065em !important;
    margin-bottom: .85rem !important;
  }

  .ht-client-hero-v2 p {
    max-width: 45rem !important;
    line-height: 1.35 !important;
  }

  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(8.5rem, 1fr)) !important;
    gap: .7rem !important;
    max-width: 50rem !important;
  }

  .ht-client-actions-v2 > a {
    height: 2.8rem !important;
    min-height: 2.8rem !important;
    padding: 0 .9rem !important;
    font-size: .88rem !important;
  }

  .ht-health-card {
    width: 100% !important;
    max-width: 28rem !important;
    justify-self: end !important;
  }
}

/* Small mobile stays clean */
@media screen and (max-width: 720px) {
  .ht-client-hero-v2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
    padding: 1.15rem .95rem !important;
    border-radius: 1.15rem !important;
  }

  .ht-client-hero-v2 h1 {
    font-size: clamp(2rem, 10.5vw, 2.85rem) !important;
    line-height: .92 !important;
    letter-spacing: -.065em !important;
    margin: .35rem 0 .65rem !important;
  }

  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
    width: 100% !important;
  }

  .ht-client-actions-v2 > a {
    width: 100% !important;
    height: 2.62rem !important;
    min-height: 2.62rem !important;
    border-radius: .92rem !important;
    justify-content: center !important;
  }
}

/* =========================================================
   UTILITY THEME ICON FIX
   Remove stray blue LED/dot. Keep moon/sun centered and clean.
   ========================================================= */

@media screen and (max-width: 1180px) {
  header.ht-topbar .ht-theme-toggle {
    gap: 0 !important;
    overflow: visible !important;
  }

  header.ht-topbar .ht-theme-toggle-led,
  header.ht-topbar [class*="theme-toggle-led"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
  }
}

@media screen and (min-width: 721px) and (max-width: 1180px) {
  header.ht-topbar .ht-theme-toggle {
    width: 2.28rem !important;
    height: 2.28rem !important;
    min-width: 2.28rem !important;
    max-width: 2.28rem !important;
    padding: 0 !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: 1rem !important;
  }
}

@media screen and (max-width: 720px) {
  header.ht-topbar .ht-theme-toggle {
    width: 1.72rem !important;
    height: 1.72rem !important;
    min-width: 1.72rem !important;
    max-width: 1.72rem !important;
    padding: 0 !important;
  }

  header.ht-topbar .ht-theme-toggle-icon {
    font-size: .92rem !important;
  }
}

/* =========================================================
   HAMBURGER CONSISTENT PREMIUM COLOR
   Medium + mobile: no pale/washed style
   ========================================================= */

@media screen and (max-width: 1180px) {
  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    background:
      linear-gradient(135deg, #02b9ef 0%, #2f8df7 48%, #6d5dfc 100%) !important;
    border: 1px solid rgba(255,255,255,.42) !important;
    color: #ffffff !important;
    box-shadow:
      0 14px 30px rgba(0,174,239,.28),
      0 8px 18px rgba(99,102,241,.20),
      inset 0 1px 0 rgba(255,255,255,.38) !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon,
  #htMobileSidebarToggle .ht-menu-line,
  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    background: #ffffff !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    opacity: 1 !important;
  }

  #htMobileSidebarToggle .ht-menu-line {
    height: 2px !important;
    border-radius: 999px !important;
    box-shadow: 0 1px 2px rgba(8,17,31,.18) !important;
  }

  #htMobileSidebarToggle:hover {
    transform: translateY(-1px) scale(1.02) !important;
    box-shadow:
      0 16px 34px rgba(0,174,239,.34),
      0 10px 22px rgba(99,102,241,.24),
      inset 0 1px 0 rgba(255,255,255,.42) !important;
  }
}

/* keep close state premium too */
body.ht-mobile-sidebar-open #htMobileSidebarToggle,
body.ht-mobile-sidebar-is-open #htMobileSidebarToggle {
  background:
    linear-gradient(135deg, #071525 0%, #10233f 48%, #1b3f72 100%) !important;
  border-color: rgba(255,255,255,.24) !important;
  color: #ffffff !important;
}

/* =========================================================
   FIX FLOATING HAMBURGER OPEN STATE
   Prevent old pseudo/icon rules from turning it into a mail box.
   Always show modern menu / close icon.
   ========================================================= */

@media screen and (max-width: 1180px) {
  #htMobileSidebarToggle.ht-mobile-menu-btn,
  button#htMobileSidebarToggle {
    width: 2.9rem !important;
    height: 2.9rem !important;
    min-width: 2.9rem !important;
    min-height: 2.9rem !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: linear-gradient(135deg, #08c5ee 0%, #2f8df7 48%, #6d5dfc 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.45) !important;
    box-shadow:
      0 14px 30px rgba(0,174,239,.30),
      0 8px 18px rgba(99,102,241,.22),
      inset 0 1px 0 rgba(255,255,255,.40) !important;

    overflow: hidden !important;
    opacity: 1 !important;
    z-index: 10005 !important;
  }

  #htMobileSidebarToggle::before,
  #htMobileSidebarToggle::after {
    content: none !important;
    display: none !important;
  }

  #htMobileSidebarToggle .ht-mobile-menu-btn__icon {
    width: 1.18rem !important;
    height: .92rem !important;
    display: grid !important;
    gap: .22rem !important;
    place-items: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #htMobileSidebarToggle .ht-menu-line {
    display: block !important;
    width: 1.18rem !important;
    height: 2px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 1px 2px rgba(8,17,31,.20) !important;
    opacity: 1 !important;
    transform-origin: center !important;
    transition: transform .18s ease, opacity .18s ease !important;
  }

  body.ht-mobile-sidebar-open #htMobileSidebarToggle,
  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle {
    background: linear-gradient(135deg, #071525 0%, #123052 52%, #2563eb 100%) !important;
    color: #ffffff !important;
  }

  body.ht-mobile-sidebar-open #htMobileSidebarToggle .ht-menu-line-1,
  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle .ht-menu-line-1 {
    transform: translateY(6px) rotate(45deg) !important;
  }

  body.ht-mobile-sidebar-open #htMobileSidebarToggle .ht-menu-line-2,
  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle .ht-menu-line-2 {
    opacity: 0 !important;
    transform: scaleX(.2) !important;
  }

  body.ht-mobile-sidebar-open #htMobileSidebarToggle .ht-menu-line-3,
  body.ht-mobile-sidebar-is-open #htMobileSidebarToggle .ht-menu-line-3 {
    transform: translateY(-6px) rotate(-45deg) !important;
  }
}

/* =========================================================
   COMPACT DASHBOARD KPIS ON LARGE / MEDIUM SCREENS
   Admin + Client dashboard KPI cards should feel premium, not huge.
   ========================================================= */

/* Base for the new smart KPI cards */
.ht-smart-kpi-grid {
  align-items: stretch !important;
}

.ht-smart-kpi-card {
  justify-content: flex-start !important;
}

/* Large screens: smaller card height + tighter text */
@media screen and (min-width: 1181px) {
  .ht-smart-kpi-grid {
    gap: .85rem !important;
  }

  .ht-smart-kpi-activity {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .ht-smart-kpi-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .ht-smart-kpi-card {
    min-height: 4.95rem !important;
    padding: .78rem .95rem !important;
    border-radius: .95rem !important;
  }

  .ht-smart-kpi-card span {
    font-size: .62rem !important;
    line-height: 1.12 !important;
    letter-spacing: .14em !important;
  }

  .ht-smart-kpi-card strong {
    margin-top: .42rem !important;
    font-size: clamp(1.7rem, 2.4vw, 2.25rem) !important;
    line-height: .95 !important;
  }

  .ht-smart-kpi-card p {
    margin-top: .32rem !important;
    font-size: .78rem !important;
    line-height: 1.2 !important;
  }
}

/* Wide desktop: keep them even more dashboard-like */
@media screen and (min-width: 1380px) {
  .ht-smart-kpi-card {
    min-height: 4.65rem !important;
    padding: .72rem .9rem !important;
  }

  .ht-smart-kpi-card strong {
    font-size: 2rem !important;
  }
}

/* Medium/tablet: compact but readable */
@media screen and (min-width: 721px) and (max-width: 1180px) {
  .ht-smart-kpi-grid {
    gap: .75rem !important;
  }

  .ht-smart-kpi-card {
    min-height: 5.05rem !important;
    padding: .82rem .9rem !important;
    border-radius: .95rem !important;
  }

  .ht-smart-kpi-card span {
    font-size: .62rem !important;
    line-height: 1.12 !important;
    letter-spacing: .135em !important;
  }

  .ht-smart-kpi-card strong {
    margin-top: .42rem !important;
    font-size: 1.85rem !important;
  }

  .ht-smart-kpi-card p {
    margin-top: .28rem !important;
    font-size: .78rem !important;
    line-height: 1.2 !important;
  }
}

/* Small mobile: keep full-card comfort */
@media screen and (max-width: 720px) {
  .ht-smart-kpi-card {
    min-height: 4.85rem !important;
    padding: .82rem .95rem !important;
  }

  .ht-smart-kpi-card strong {
    font-size: 1.9rem !important;
  }
}

/* =========================================================
   FIX KPI EMPTY GAP ON MEDIUM/LARGE
   The issue was not only card height; the grid was forcing 2 columns,
   leaving the 5th activity card alone and creating a big blank space.
   ========================================================= */

@media screen and (min-width: 721px) {
  .ht-smart-kpi-grid,
  .ht-smart-kpi-activity,
  .ht-smart-kpi-metrics,
  .ht-admin-dashboard-metrics,
  .ht-client-dashboard-metrics {
    display: grid !important;
    gap: .72rem !important;
    align-items: stretch !important;
    grid-auto-flow: row dense !important;
  }

  .ht-smart-kpi-card {
    min-height: 4.45rem !important;
    padding: .68rem .82rem !important;
    border-radius: .9rem !important;
  }

  .ht-smart-kpi-card span {
    font-size: .58rem !important;
    letter-spacing: .13em !important;
    line-height: 1.08 !important;
  }

  .ht-smart-kpi-card strong {
    margin-top: .3rem !important;
    font-size: 1.72rem !important;
    line-height: .95 !important;
  }

  .ht-smart-kpi-card p {
    margin-top: .22rem !important;
    font-size: .74rem !important;
    line-height: 1.15 !important;
  }
}

/* Medium landscape/tablet: 5 activity cards on one row, 4 metric cards on one row */
@media screen and (min-width: 900px) and (max-width: 1180px) {
  .ht-smart-kpi-activity {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .ht-smart-kpi-metrics,
  .ht-admin-dashboard-metrics,
  .ht-client-dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Medium narrower: 3 columns avoids skinny vertical text and avoids huge blank half-row */
@media screen and (min-width: 721px) and (max-width: 899px) {
  .ht-smart-kpi-activity,
  .ht-smart-kpi-metrics,
  .ht-admin-dashboard-metrics,
  .ht-client-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Desktop */
@media screen and (min-width: 1181px) {
  .ht-smart-kpi-activity {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .ht-smart-kpi-metrics,
  .ht-admin-dashboard-metrics,
  .ht-client-dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Stop any earlier rules from stretching individual KPI cards */
.ht-smart-kpi-grid > *,
.ht-smart-kpi-card {
  width: auto !important;
  max-width: none !important;
  grid-column: auto !important;
}

/* === HT PHASE: Smart dashboard attention panels === */
.ht-smart-attention-panel {
    display: grid !important;
    gap: clamp(.75rem, 1.4vw, 1rem) !important;
    padding: clamp(1rem, 2vw, 1.35rem) !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: clamp(1.05rem, 2vw, 1.45rem) !important;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--ht-primary, #14b8d4) 14%, transparent), transparent 23rem),
        color-mix(in srgb, var(--ht-surface, #fff) 92%, transparent) !important;
    box-shadow: 0 18px 44px color-mix(in srgb, var(--ht-primary, #14b8d4) 10%, transparent) !important;
    overflow: hidden !important;
}

.ht-smart-attention-head {
    display: flex !important;
    align-items: end !important;
    justify-content: space-between !important;
    gap: 1rem !important;
}

.ht-smart-attention-head span {
    display: block !important;
    color: var(--ht-primary, #14b8d4) !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
    font-size: clamp(.65rem, .9vw, .78rem) !important;
    font-weight: 950 !important;
}

.ht-smart-attention-head h2 {
    margin: .12rem 0 .2rem !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: clamp(1.15rem, 2.1vw, 1.75rem) !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

.ht-smart-attention-head p {
    margin: 0 !important;
    color: var(--ht-muted, #5b6675) !important;
    font-size: clamp(.82rem, 1.1vw, .95rem) !important;
}

.ht-smart-attention-head > a {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.25rem !important;
    padding: 0 .9rem !important;
    border-radius: 999px !important;
    border: 1px solid var(--ht-border) !important;
    background: var(--ht-surface, #fff) !important;
    color: var(--ht-heading, #07111f) !important;
    text-decoration: none !important;
    font-size: .82rem !important;
    font-weight: 900 !important;
}

.ht-smart-attention-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)) !important;
    gap: .72rem !important;
}

.ht-smart-attention-card {
    min-width: 0 !important;
    display: grid !important;
    gap: .32rem !important;
    padding: clamp(.82rem, 1.25vw, 1rem) !important;
    border-radius: 1rem !important;
    border: 1px solid var(--ht-border) !important;
    background: color-mix(in srgb, var(--ht-surface, #fff) 88%, transparent) !important;
    color: var(--ht-heading, #07111f) !important;
    text-decoration: none !important;
}

.ht-smart-attention-card span {
    min-width: 0 !important;
    color: var(--ht-muted, #5b6675) !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    font-size: clamp(.62rem, .8vw, .72rem) !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ht-smart-attention-card strong {
    min-width: 0 !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: clamp(1.25rem, 2.3vw, 2rem) !important;
    line-height: .98 !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

.ht-smart-attention-card p {
    margin: 0 !important;
    color: var(--ht-muted, #5b6675) !important;
    font-size: clamp(.76rem, .95vw, .86rem) !important;
    line-height: 1.25 !important;
}

.ht-smart-attention-card.good {
    border-color: color-mix(in srgb, #22c55e 28%, var(--ht-border)) !important;
}

.ht-smart-attention-card.info {
    border-color: color-mix(in srgb, var(--ht-primary, #14b8d4) 35%, var(--ht-border)) !important;
}

.ht-smart-attention-card.warn {
    border-color: color-mix(in srgb, #f59e0b 36%, var(--ht-border)) !important;
}

.ht-smart-attention-card.danger {
    border-color: color-mix(in srgb, #ef4444 36%, var(--ht-border)) !important;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, #ef4444 10%, transparent), transparent 12rem),
        color-mix(in srgb, var(--ht-surface, #fff) 90%, transparent) !important;
}

.ht-smart-activity-strip {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)) !important;
    gap: .65rem !important;
}

.ht-smart-activity-item,
.ht-smart-activity-empty {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: .65rem !important;
    padding: .72rem .8rem !important;
    border-radius: .95rem !important;
    border: 1px solid var(--ht-border) !important;
    background: color-mix(in srgb, var(--ht-surface-soft, #f6fbff) 90%, transparent) !important;
    color: var(--ht-heading, #07111f) !important;
    text-decoration: none !important;
}

.ht-smart-activity-item > span {
    flex: 0 0 auto !important;
    width: 1.85rem !important;
    height: 1.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--ht-primary, #14b8d4) 15%, white) !important;
    color: var(--ht-primary, #14b8d4) !important;
    font-size: .75rem !important;
    font-weight: 950 !important;
}

.ht-smart-activity-item div {
    min-width: 0 !important;
    display: grid !important;
    gap: .1rem !important;
}

.ht-smart-activity-item strong {
    min-width: 0 !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: .82rem !important;
    line-height: 1.12 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ht-smart-activity-item small {
    color: var(--ht-muted, #5b6675) !important;
    font-size: .72rem !important;
}

@media (min-width: 860px) {
    .ht-smart-attention-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .ht-smart-activity-strip {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 859px) {
    .ht-smart-attention-head {
        align-items: start !important;
    }

    .ht-smart-attention-grid,
    .ht-smart-activity-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    .ht-smart-attention-panel {
        padding: .9rem !important;
        border-radius: 1rem !important;
    }

    .ht-smart-attention-head {
        display: grid !important;
    }

    .ht-smart-attention-head > a {
        width: 100% !important;
    }

    .ht-smart-attention-grid,
    .ht-smart-activity-strip {
        grid-template-columns: 1fr !important;
    }
}

html.dark .ht-smart-attention-panel,
html.dark .ht-smart-attention-card,
html.dark .ht-smart-activity-item,
html.dark .ht-smart-activity-empty,
html.dark .ht-smart-attention-head > a {
    background-color: color-mix(in srgb, var(--ht-surface, #07111f) 88%, transparent) !important;
}

html.dark .ht-smart-attention-head h2,
html.dark .ht-smart-attention-card strong,
html.dark .ht-smart-activity-item strong,
html.dark .ht-smart-attention-head > a {
    color: var(--ht-heading, #f8fbff) !important;
}

/* =========================================================
   HT PHASE: Dashboard density + enterprise polish
   ========================================================= */

/* --- tighter dashboard shell --- */
.ht-admin-dashboard-v2,
.ht-client-dashboard,
.ht-client-dashboard-v2 {
    gap: clamp(.9rem, 1.4vw, 1.25rem) !important;
}

/* --- hero panels less vertically oversized --- */
.ht-admin-hero-v2,
.ht-client-hero-v2 {
    padding: clamp(1.1rem, 1.7vw, 1.55rem) !important;
    gap: clamp(.9rem, 1.4vw, 1.2rem) !important;
    min-height: unset !important;
}

/* --- better medium landscape title scaling --- */
.ht-admin-hero-v2 h1 {
    font-size: clamp(2.2rem, 4vw, 4.25rem) !important;
    line-height: .92 !important;
    letter-spacing: -.05em !important;
    max-width: 12ch !important;
}

.ht-client-hero-v2 h1 {
    font-size: clamp(2rem, 3.4vw, 3.4rem) !important;
    line-height: .94 !important;
    letter-spacing: -.05em !important;
}

/* --- tighter hero paragraph --- */
.ht-admin-hero-v2 p,
.ht-client-hero-v2 p {
    margin-top: .45rem !important;
    max-width: 58ch !important;
    line-height: 1.4 !important;
    font-size: clamp(.92rem, 1.05vw, 1.02rem) !important;
}

/* --- compact action grids --- */
.ht-admin-actions-v2,
.ht-client-actions-v2,
.ht-admin-actions-compact {
    gap: .7rem !important;
    margin-top: .9rem !important;
}

/* --- health/status cards no longer gigantic --- */
.ht-admin-health-card,
.ht-health-card {
    min-height: 0 !important;
    padding: 1.1rem 1.2rem !important;
    justify-content: center !important;
}

.ht-admin-health-card strong,
.ht-health-card strong {
    font-size: clamp(2rem, 3vw, 3rem) !important;
    line-height: .92 !important;
}

/* =========================================================
   KPI refinement
   ========================================================= */

.ht-smart-kpi-grid {
    gap: .72rem !important;
}

.ht-smart-kpi-card {
    padding: .82rem .9rem !important;
    min-height: 0 !important;
    border-radius: 1rem !important;
}

/* KPI labels */
.ht-smart-kpi-card span {
    letter-spacing: .11em !important;
    font-size: .68rem !important;
    line-height: 1.05 !important;
}

/* KPI values */
.ht-smart-kpi-card strong {
    margin-top: .22rem !important;
    font-size: clamp(1.55rem, 2.1vw, 2.25rem) !important;
    line-height: .92 !important;
    letter-spacing: -.045em !important;
}

/* KPI helper text */
.ht-smart-kpi-card p {
    margin-top: .2rem !important;
    font-size: .8rem !important;
    line-height: 1.22 !important;
}

/* activity KPI row slightly denser */
.ht-smart-kpi-activity .ht-smart-kpi-card {
    padding-top: .7rem !important;
    padding-bottom: .7rem !important;
}

.ht-smart-kpi-activity .ht-smart-kpi-card strong {
    font-size: clamp(1.3rem, 1.7vw, 1.8rem) !important;
}

/* =========================================================
   Better above-the-fold density
   ========================================================= */

.ht-admin-dashboard-v2 > section,
.ht-client-dashboard > section,
.ht-client-dashboard-v2 > section {
    margin-top: 0 !important;
}

/* tighter section rhythm */
.ht-admin-main-grid,
.ht-client-main-grid,
.ht-admin-lower-grid {
    gap: 1rem !important;
}

/* =========================================================
   Sidebar footer region
   ========================================================= */

.ht-sidebar-footer,
.ht-sidebar-system,
.ht-sidebar-help {
    margin-top: auto !important;
}

/* bottom utility area */
.ht-sidebar-footer {
    position: sticky !important;
    bottom: 0 !important;
    padding-top: .9rem !important;
    background:
        linear-gradient(
            to bottom,
            transparent,
            color-mix(in srgb, var(--ht-sidebar-bg, #fff) 94%, transparent)
        ) !important;
    backdrop-filter: blur(18px) !important;
}

/* =========================================================
   Large landscape optimization
   ========================================================= */

@media (min-width: 1280px) {

    .ht-admin-dashboard-v2,
    .ht-client-dashboard,
    .ht-client-dashboard-v2 {
        max-width:none!important;
    }

    .ht-smart-kpi-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .ht-smart-kpi-activity {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

/* =========================================================
   iPad landscape / medium desktop
   ========================================================= */

@media (max-width: 1180px) {

    .ht-admin-hero-v2 h1 {
        font-size: clamp(2rem, 4vw, 3.2rem) !important;
    }

    .ht-client-hero-v2 h1 {
        font-size: clamp(1.8rem, 3vw, 2.7rem) !important;
    }

    .ht-smart-kpi-card {
        padding: .76rem .82rem !important;
    }

    .ht-smart-kpi-card strong {
        font-size: clamp(1.3rem, 1.8vw, 1.9rem) !important;
    }
}

/* =========================================================
   Dark mode cleanup
   ========================================================= */

html.dark .ht-smart-kpi-card,
html.dark .ht-admin-health-card,
html.dark .ht-health-card {
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--ht-surface, #07111f) 96%, transparent),
            color-mix(in srgb, var(--ht-primary, #14b8d4) 6%, var(--ht-surface, #07111f))
        ) !important;
}


/* === HT PHASE 2: Dashboard Intelligence Board === */
.ht-intelligence-board {
    display: grid !important;
    gap: .85rem !important;
    padding: clamp(.95rem, 1.5vw, 1.25rem) !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: clamp(1rem, 1.8vw, 1.4rem) !important;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--ht-primary, #14b8d4) 10%, transparent), transparent 22rem),
        color-mix(in srgb, var(--ht-surface, #fff) 92%, transparent) !important;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--ht-primary, #14b8d4) 8%, transparent) !important;
}

.ht-intelligence-head span {
    display: block !important;
    color: var(--ht-primary, #14b8d4) !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
    font-size: clamp(.62rem, .8vw, .74rem) !important;
    font-weight: 950 !important;
}

.ht-intelligence-head h2 {
    margin: .1rem 0 .2rem !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: clamp(1.1rem, 1.8vw, 1.55rem) !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

.ht-intelligence-head p {
    margin: 0 !important;
    color: var(--ht-muted, #5b6675) !important;
    font-size: clamp(.78rem, 1vw, .9rem) !important;
}

.ht-intelligence-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .8rem !important;
}

.ht-intelligence-card {
    min-width: 0 !important;
    display: grid !important;
    align-content: start !important;
    gap: .55rem !important;
    padding: .85rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: 1rem !important;
    background: color-mix(in srgb, var(--ht-surface, #fff) 90%, transparent) !important;
}

.ht-intelligence-card h3 {
    margin: 0 0 .15rem !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: .95rem !important;
    font-weight: 950 !important;
}

.ht-intel-row {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: .12rem .65rem !important;
    padding: .65rem .7rem !important;
    border: 1px solid var(--ht-border) !important;
    border-radius: .82rem !important;
    background: color-mix(in srgb, var(--ht-surface-soft, #f6fbff) 90%, transparent) !important;
    color: var(--ht-heading, #07111f) !important;
    text-decoration: none !important;
}

.ht-intel-row strong,
.ht-intel-row span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.ht-intel-row strong {
    color: var(--ht-heading, #07111f) !important;
    font-size: .82rem !important;
    font-weight: 950 !important;
}

.ht-intel-row span {
    grid-column: 1 / 2 !important;
    color: var(--ht-muted, #5b6675) !important;
    font-size: .74rem !important;
    font-weight: 700 !important;
}

.ht-intel-row b {
    grid-row: 1 / 3 !important;
    grid-column: 2 / 3 !important;
    align-self: center !important;
    color: var(--ht-heading, #07111f) !important;
    font-size: .8rem !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

.ht-intel-row.warn {
    border-color: color-mix(in srgb, #f59e0b 34%, var(--ht-border)) !important;
}

.ht-intel-row.danger {
    border-color: color-mix(in srgb, #ef4444 36%, var(--ht-border)) !important;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, #ef4444 9%, transparent), transparent 9rem),
        color-mix(in srgb, var(--ht-surface, #fff) 92%, transparent) !important;
}

.ht-intel-row.info {
    border-color: color-mix(in srgb, var(--ht-primary, #14b8d4) 34%, var(--ht-border)) !important;
}

.ht-intel-empty {
    min-height: 4.25rem !important;
    display: grid !important;
    place-items: center !important;
    padding: .8rem !important;
    border: 1px dashed var(--ht-border) !important;
    border-radius: .85rem !important;
    color: var(--ht-muted, #5b6675) !important;
    font-size: .82rem !important;
    font-weight: 850 !important;
    text-align: center !important;
}

@media (max-width: 1100px) {
    .ht-intelligence-grid {
        grid-template-columns: 1fr !important;
    }

    .ht-intelligence-card {
        padding: .78rem !important;
    }
}

@media (min-width: 1101px) {
    .ht-intelligence-card {
        min-height: 13rem !important;
    }
}

@media (max-width: 560px) {
    .ht-intelligence-board {
        padding: .85rem !important;
        border-radius: 1rem !important;
    }

    .ht-intel-row {
        grid-template-columns: 1fr !important;
    }

    .ht-intel-row b {
        grid-row: auto !important;
        grid-column: auto !important;
        justify-self: start !important;
    }
}

html.dark .ht-intelligence-board,
html.dark .ht-intelligence-card,
html.dark .ht-intel-row {
    background-color: color-mix(in srgb, var(--ht-surface, #07111f) 88%, transparent) !important;
}

html.dark .ht-intelligence-head h2,
html.dark .ht-intelligence-card h3,
html.dark .ht-intel-row strong,
html.dark .ht-intel-row b {
    color: var(--ht-heading, #f8fbff) !important;
}

/* === HT FIX: compact hero action buttons globally on medium screens === */
@media (min-width: 700px) and (max-width: 1180px) {
  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .ht-page-hero-actions .ht-action-primary,
  .ht-page-hero-actions .ht-action-secondary,
  .ht-admin-actions-v2 .ht-action-primary,
  .ht-admin-actions-v2 .ht-action-secondary,
  .ht-client-actions-v2 .ht-action-primary,
  .ht-client-actions-v2 .ht-action-secondary {
    min-height: 2.4rem !important;
    height: 2.4rem !important;
    padding: 0 .8rem !important;
    border-radius: .85rem !important;
    font-size: .84rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (min-width: 1181px) {
  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .65rem !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > * {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 9rem !important;
    max-width: 14rem !important;
  }
}
/* === END HT FIX === */

/* === HT FINAL OVERRIDE: compact hero action buttons on medium screens === */
@media (min-width: 700px) and (max-width: 1180px) {
  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(9rem, max-content)) !important;
    justify-content: start !important;
    align-items: center !important;
    gap: .55rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > *,
  .ht-page-hero-actions > form,
  .ht-admin-actions-v2 > form,
  .ht-client-actions-v2 > form {
    width: auto !important;
    min-width: 9rem !important;
    max-width: 15rem !important;
    flex: unset !important;
    justify-self: start !important;
  }

  .ht-page-hero-actions a,
  .ht-page-hero-actions button,
  .ht-page-hero-actions .ht-action-primary,
  .ht-page-hero-actions .ht-action-secondary,
  .ht-admin-actions-v2 a,
  .ht-admin-actions-v2 button,
  .ht-admin-actions-v2 .ht-action-primary,
  .ht-admin-actions-v2 .ht-action-secondary,
  .ht-client-actions-v2 a,
  .ht-client-actions-v2 button,
  .ht-client-actions-v2 .ht-action-primary,
  .ht-client-actions-v2 .ht-action-secondary {
    width: auto !important;
    min-width: 9rem !important;
    max-width: 15rem !important;
    min-height: 2.55rem !important;
    height: 2.55rem !important;
    padding: 0 .9rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .42rem !important;
    border-radius: .82rem !important;
    font-size: clamp(.78rem, 1vw, .9rem) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact {
    grid-template-columns: repeat(2, minmax(9rem, 1fr)) !important;
  }

  .ht-admin-actions-v2.ht-admin-actions-compact > a {
    max-width: none !important;
    width: 100% !important;
  }
}

/* keep real phone/narrow portrait stacked and clean */
@media (max-width: 699px) {
  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > *,
  .ht-page-hero-actions a,
  .ht-page-hero-actions button,
  .ht-admin-actions-v2 a,
  .ht-admin-actions-v2 button,
  .ht-client-actions-v2 a,
  .ht-client-actions-v2 button {
    width: 100% !important;
    max-width: none !important;
  }
}

/* === HT FIX: desktop/tablet hero actions aligned right compact === */
@media (min-width: 900px) {

  .ht-page-hero-v2,
  .ht-admin-hero-v2,
  .ht-client-hero-v2 {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center !important;
    column-gap: 1.2rem !important;
  }

  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    width: auto !important;
    max-width: 18rem !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;

    gap: .7rem !important;
    margin-left: auto !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > * {
    width: 100% !important;
    min-width: 10rem !important;
    max-width: 14rem !important;
    flex: 0 0 auto !important;
  }

  .ht-page-hero-actions a,
  .ht-page-hero-actions button,
  .ht-page-hero-actions .ht-action-primary,
  .ht-page-hero-actions .ht-action-secondary,
  .ht-admin-actions-v2 a,
  .ht-admin-actions-v2 button,
  .ht-admin-actions-v2 .ht-action-primary,
  .ht-admin-actions-v2 .ht-action-secondary,
  .ht-client-actions-v2 a,
  .ht-client-actions-v2 button,
  .ht-client-actions-v2 .ht-action-primary,
  .ht-client-actions-v2 .ht-action-secondary {
    width: 100% !important;
    min-height: 3rem !important;
    height: 3rem !important;

    padding: 0 1rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
    white-space: nowrap !important;

    border-radius: 1rem !important;

    font-size: .95rem !important;
    line-height: 1 !important;
  }
}

/* keep stacked mobile layout */
@media (max-width: 899px) {

  .ht-page-hero-actions,
  .ht-admin-actions-v2,
  .ht-client-actions-v2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
    width: 100% !important;
  }

  .ht-page-hero-actions > *,
  .ht-admin-actions-v2 > *,
  .ht-client-actions-v2 > * {
    width: 100% !important;
    max-width: none !important;
  }
}

/* === HT FINAL FIX: medium hero buttons compact right side fallback === */
@media (min-width: 700px) and (max-width: 1180px) {
    .ht-page-hero-v2,
    .ht-admin-hero-v2,
    .ht-client-hero-v2 {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
    }

    .ht-page-hero-actions,
    .ht-admin-actions-v2,
    .ht-client-actions-v2,
    .ht-admin-actions-v2.ht-admin-actions-compact {
        width: auto !important;
        max-width: 13.5rem !important;
        min-width: 10.5rem !important;
        margin-left: auto !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .55rem !important;
        justify-self: end !important;
    }

    .ht-page-hero-actions > *,
    .ht-admin-actions-v2 > *,
    .ht-client-actions-v2 > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
    }

    .ht-page-hero-actions a,
    .ht-page-hero-actions button,
    .ht-admin-actions-v2 a,
    .ht-admin-actions-v2 button,
    .ht-client-actions-v2 a,
    .ht-client-actions-v2 button {
        min-height: 2.55rem !important;
        height: 2.55rem !important;
        padding: 0 .85rem !important;
        border-radius: .9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: .88rem !important;
    }
}

/* === HT FIX: admin dashboard large screens only fallback === */
@media (min-width: 1181px) {
    .ht-admin-dashboard-v2 .ht-admin-hero-v2 {
        display: grid !important;
        grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr) !important;
        align-items: center !important;
        gap: clamp(1.25rem, 2vw, 2rem) !important;
        padding: clamp(2rem, 3vw, 3rem) !important;
    }

    .ht-admin-dashboard-v2 .ht-admin-hero-v2 h1 {
        max-width: 12ch !important;
        font-size: clamp(3rem, 4.25vw, 4.7rem) !important;
        line-height: .92 !important;
        letter-spacing: -.075em !important;
    }

    .ht-admin-dashboard-v2 .ht-admin-actions-v2,
    .ht-admin-dashboard-v2 .ht-admin-actions-v2.ht-admin-actions-compact {
        width: min(100%, 18rem) !important;
        max-width: 18rem !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
        justify-self: start !important;
    }

    .ht-admin-dashboard-v2 .ht-admin-health-card {
        width: 100% !important;
        max-width: 36rem !important;
        justify-self: end !important;
    }
}

/* ============================================================
   FINAL OVERRIDE: Client dashboard compact premium layout
   Synced copy from resources/css/app.css
   ============================================================ */

body:has(.ht-client-dashboard) .ht-content,
body:has(.ht-client-dashboard-v2) .ht-content {
  padding-top: 1.6rem !important;
}

.ht-client-dashboard,
.ht-client-dashboard-v2 {
  gap: 1.05rem !important;
}

.ht-client-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child {
  min-height: unset !important;
  padding: clamp(1.55rem, 2vw, 2.2rem) clamp(1.45rem, 2.4vw, 2rem) !important;
  border-radius: 1.35rem !important;
  display: grid !important;
  grid-template-columns: minmax(20rem, 1.35fr) minmax(12rem, .65fr) minmax(16rem, .8fr) !important;
  align-items: center !important;
  gap: clamp(1rem, 2vw, 1.5rem) !important;
  overflow: hidden !important;
}

.ht-client-hero-v2::before,
.ht-client-dashboard > section:first-child::before,
.ht-client-dashboard-v2 > section:first-child::before {
  opacity: .9 !important;
  filter: blur(6px) !important;
}

.ht-client-hero-v2::after,
.ht-client-dashboard > section:first-child::after,
.ht-client-dashboard-v2 > section:first-child::after {
  opacity: .55 !important;
}

.ht-client-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker {
  font-size: .72rem !important;
  letter-spacing: .19em !important;
  margin-bottom: .45rem !important;
}

.ht-client-hero-v2 h1 {
  font-size: clamp(2.05rem, 3.4vw, 3.45rem) !important;
  line-height: .98 !important;
  letter-spacing: -.075em !important;
  margin: 0 0 .7rem !important;
  max-width: 720px !important;
}

.ht-client-hero-v2 p {
  max-width: 620px !important;
  font-size: clamp(.96rem, 1vw, 1.05rem) !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

.ht-client-actions-v2 {
  width: min(100%, 14rem) !important;
  display: grid !important;
  gap: .55rem !important;
  justify-self: end !important;
  align-self: center !important;
}

.ht-client-actions-v2 > *,
.ht-client-actions-v2 > form,
.ht-client-actions-v2 a,
.ht-client-actions-v2 button,
.ht-client-actions-v2 .ht-action-primary,
.ht-client-actions-v2 .ht-action-secondary {
  width: 100% !important;
  min-height: 2.95rem !important;
  height: 2.95rem !important;
  border-radius: .82rem !important;
  font-size: .87rem !important;
  font-weight: 950 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 .95rem !important;
  box-shadow: none !important;
}

.ht-client-actions-v2 a:first-child,
.ht-client-actions-v2 .ht-action-primary:first-child {
  box-shadow: 0 14px 28px rgba(14, 165, 233, .22) !important;
}

.ht-client-hero-v2 .ht-panel-v2,
.ht-client-hero-v2 .ht-card,
.ht-client-hero-v2 aside,
.ht-client-dashboard > section:first-child .ht-panel-v2,
.ht-client-dashboard > section:first-child aside {
  max-width: 28rem !important;
  justify-self: end !important;
  border-radius: 1.25rem !important;
}

.ht-client-hero-v2 .ht-panel-v2 h2,
.ht-client-hero-v2 aside h2,
.ht-client-dashboard > section:first-child aside h2 {
  font-size: clamp(1.85rem, 3vw, 3rem) !important;
  line-height: .98 !important;
  letter-spacing: -.07em !important;
  margin-bottom: .35rem !important;
}

.ht-client-dashboard-metrics,
.ht-client-dashboard .ht-metrics-grid-v2,
.ht-client-dashboard-v2 .ht-metrics-grid-v2 {
  gap: .7rem !important;
  margin-top: .25rem !important;
}

.ht-client-dashboard-metrics > *,
.ht-client-dashboard .ht-metric-card-v2,
.ht-client-dashboard-v2 .ht-metric-card-v2 {
  min-height: 5.8rem !important;
  padding: .85rem .95rem !important;
  border-radius: .95rem !important;
}

.ht-client-dashboard-metrics strong,
.ht-client-dashboard .ht-metric-card-v2 strong,
.ht-client-dashboard-v2 .ht-metric-card-v2 strong {
  font-size: 2rem !important;
  line-height: .95 !important;
  letter-spacing: -.055em !important;
}

.ht-client-dashboard-metrics p,
.ht-client-dashboard .ht-metric-card-v2 p,
.ht-client-dashboard-v2 .ht-metric-card-v2 p {
  font-size: .78rem !important;
  line-height: 1.25 !important;
}

.ht-client-main-grid,
.ht-client-main-grid.lower {
  gap: 1rem !important;
}

.ht-client-main-grid > *,
.ht-client-main-grid.lower > *,
.ht-client-dashboard .ht-panel-v2,
.ht-client-dashboard-v2 .ht-panel-v2 {
  border-radius: 1.15rem !important;
}

.ht-client-switcher,
.ht-client-switcher-compact {
  padding: .78rem .75rem !important;
  border-radius: 1rem !important;
}

.ht-client-switcher label,
.ht-client-switcher-compact label {
  font-size: .69rem !important;
  letter-spacing: .16em !important;
  margin-bottom: .45rem !important;
}

.ht-client-switcher select,
.ht-client-switcher-compact select {
  min-height: 2.55rem !important;
  height: 2.55rem !important;
  border-radius: .85rem !important;
  font-size: .82rem !important;
  padding: 0 2rem 0 .8rem !important;
  text-overflow: ellipsis !important;
}

.ht-active-customer-name {
  margin-top: .55rem !important;
  gap: .15rem !important;
}

.ht-active-customer-name strong,
.ht-active-customer-name span {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ht-active-customer-name strong {
  font-size: .82rem !important;
}

.ht-active-customer-name span {
  font-size: .72rem !important;
  opacity: .7 !important;
}

body:has(.ht-client-dashboard) .ht-topbar,
body:has(.ht-client-dashboard-v2) .ht-topbar {
  min-height: 2.85rem !important;
}

body:has(.ht-client-dashboard) .ht-topbar-btn,
body:has(.ht-client-dashboard-v2) .ht-topbar-btn {
  min-height: 2.1rem !important;
  padding: .45rem .8rem !important;
  border-radius: 999px !important;
}

@media (max-width: 1180px) {
  .ht-client-hero-v2,
  .ht-client-dashboard > section:first-child,
  .ht-client-dashboard-v2 > section:first-child {
    grid-template-columns: 1fr minmax(13rem, .55fr) !important;
  }

  .ht-client-actions-v2 {
    justify-self: stretch !important;
    width: 100% !important;
  }

  .ht-client-hero-v2 .ht-panel-v2,
  .ht-client-hero-v2 aside,
  .ht-client-dashboard > section:first-child aside {
    grid-column: 1 / -1 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }
}

@media (max-width: 760px) {
  body:has(.ht-client-dashboard) .ht-content,
  body:has(.ht-client-dashboard-v2) .ht-content {
    padding: .85rem !important;
  }

  .ht-client-hero-v2,
  .ht-client-dashboard > section:first-child,
  .ht-client-dashboard-v2 > section:first-child {
    grid-template-columns: 1fr !important;
    padding: 1.15rem !important;
    border-radius: 1.15rem !important;
    gap: .95rem !important;
  }

  .ht-client-hero-v2 h1 {
    font-size: clamp(2rem, 12vw, 2.75rem) !important;
    letter-spacing: -.07em !important;
  }

  .ht-client-actions-v2 {
    width: 100% !important;
    justify-self: stretch !important;
  }

  .ht-client-actions-v2 > *,
  .ht-client-actions-v2 a,
  .ht-client-actions-v2 button {
    min-height: 2.85rem !important;
    height: 2.85rem !important;
  }

  .ht-client-dashboard-metrics,
  .ht-client-dashboard .ht-metrics-grid-v2,
  .ht-client-dashboard-v2 .ht-metrics-grid-v2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {
  .ht-client-dashboard-metrics,
  .ht-client-dashboard .ht-metrics-grid-v2,
  .ht-client-dashboard-v2 .ht-metrics-grid-v2 {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   FINAL OVERRIDE v3: Client dashboard hero should match Admin hero
   ============================================================ */

.ht-client-dashboard .ht-client-hero-v2,
.ht-client-dashboard-v2 .ht-client-hero-v2,
.ht-client-dashboard > section:first-child,
.ht-client-dashboard-v2 > section:first-child {
  height: auto !important;
  min-height: 26rem !important;
  max-height: none !important;
  padding: clamp(2.4rem, 4vw, 3.4rem) clamp(2rem, 4vw, 3.2rem) !important;
  border-radius: 1.35rem !important;
  display: grid !important;
  grid-template-columns: minmax(24rem, .95fr) minmax(22rem, .78fr) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: clamp(2.5rem, 6vw, 7rem) !important;
  row-gap: 1.25rem !important;
  overflow: hidden !important;
}

.ht-client-hero-v2 > div:first-child {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: end !important;
  justify-self: start !important;
  max-width: 46rem !important;
  transform: none !important;
}

.ht-client-hero-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker {
  font-size: .72rem !important;
  line-height: 1 !important;
  letter-spacing: .22em !important;
  font-weight: 950 !important;
  color: var(--ht-accent, #05b6e8) !important;
  margin: 0 0 1.05rem !important;
}

.ht-client-hero-v2 h1 {
  font-size: clamp(3.2rem, 5vw, 5.1rem) !important;
  line-height: .92 !important;
  letter-spacing: -.085em !important;
  margin: 0 0 1.05rem !important;
  max-width: 48rem !important;
}

.ht-client-hero-v2 p {
  max-width: 43rem !important;
  font-size: clamp(1.05rem, 1.4vw, 1.28rem) !important;
  line-height: 1.42 !important;
  margin: 0 !important;
}

.ht-client-actions-v2 {
  grid-column: 1 !important;
  grid-row: 2 !important;
  justify-self: start !important;
  align-self: start !important;
  width: min(100%, 18rem) !important;
  max-width: 18rem !important;
  display: grid !important;
  gap: .75rem !important;
  transform: none !important;
  margin-top: .15rem !important;
}

.ht-client-actions-v2 > *,
.ht-client-actions-v2 > form,
.ht-client-actions-v2 a,
.ht-client-actions-v2 button,
.ht-client-actions-v2 .ht-action-primary,
.ht-client-actions-v2 .ht-action-secondary {
  width: 100% !important;
  height: 3rem !important;
  min-height: 3rem !important;
  border-radius: .86rem !important;
  font-size: .92rem !important;
  font-weight: 950 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1.05rem !important;
}

.ht-client-actions-v2 a:first-child,
.ht-client-actions-v2 .ht-action-primary:first-child {
  background: linear-gradient(135deg, #08bee8, #6957e8) !important;
  color: #fff !important;
  box-shadow: 0 18px 36px rgba(14, 165, 233, .24) !important;
}

.ht-client-actions-v2 a:not(:first-child),
.ht-client-actions-v2 .ht-action-secondary {
  background: rgba(255,255,255,.82) !important;
  color: var(--ht-ink, #07111f) !important;
  border: 1px solid rgba(148, 163, 184, .28) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045) !important;
}

.ht-client-hero-v2 aside,
.ht-client-hero-v2 .ht-panel-v2,
.ht-client-hero-v2 .ht-card,
.ht-client-dashboard > section:first-child aside,
.ht-client-dashboard > section:first-child .ht-panel-v2,
.ht-client-dashboard-v2 > section:first-child aside,
.ht-client-dashboard-v2 > section:first-child .ht-panel-v2 {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  width: 100% !important;
  max-width: 35rem !important;
  min-width: 0 !important;
  justify-self: end !important;
  align-self: center !important;
  padding: clamp(1.55rem, 2.4vw, 2.25rem) !important;
  border-radius: 1.25rem !important;
  background: rgba(255,255,255,.78) !important;
  border: 1px solid rgba(148,163,184,.32) !important;
  box-shadow: 0 24px 58px rgba(15,23,42,.11) !important;
  backdrop-filter: blur(16px) saturate(1.18) !important;
}

.ht-client-hero-v2 aside h2,
.ht-client-hero-v2 .ht-panel-v2 h2,
.ht-client-dashboard > section:first-child aside h2,
.ht-client-dashboard > section:first-child .ht-panel-v2 h2,
.ht-client-dashboard-v2 > section:first-child aside h2,
.ht-client-dashboard-v2 > section:first-child .ht-panel-v2 h2 {
  font-size: clamp(3rem, 4.5vw, 4.4rem) !important;
  line-height: .9 !important;
  letter-spacing: -.08em !important;
  margin: .55rem 0 .55rem !important;
  max-width: 100% !important;
}

.ht-client-hero-v2 aside p,
.ht-client-hero-v2 .ht-panel-v2 p,
.ht-client-dashboard > section:first-child aside p,
.ht-client-dashboard > section:first-child .ht-panel-v2 p {
  font-size: clamp(1rem, 1.25vw, 1.2rem) !important;
  line-height: 1.35 !important;
}

.ht-client-dashboard-metrics,
.ht-client-dashboard .ht-metrics-grid-v2,
.ht-client-dashboard-v2 .ht-metrics-grid-v2 {
  margin-top: .8rem !important;
}

@media (max-width: 1180px) {
  .ht-client-dashboard .ht-client-hero-v2,
  .ht-client-dashboard-v2 .ht-client-hero-v2,
  .ht-client-dashboard > section:first-child,
  .ht-client-dashboard-v2 > section:first-child {
    min-height: 0 !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    gap: 1rem !important;
  }

  .ht-client-hero-v2 > div:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: start !important;
  }

  .ht-client-actions-v2 {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: min(100%, 20rem) !important;
    max-width: 20rem !important;
  }

  .ht-client-hero-v2 aside,
  .ht-client-hero-v2 .ht-panel-v2,
  .ht-client-dashboard > section:first-child aside,
  .ht-client-dashboard > section:first-child .ht-panel-v2 {
    grid-column: 1 !important;
    grid-row: 3 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }
}

@media (max-width: 760px) {
  .ht-client-dashboard .ht-client-hero-v2,
  .ht-client-dashboard-v2 .ht-client-hero-v2,
  .ht-client-dashboard > section:first-child,
  .ht-client-dashboard-v2 > section:first-child {
    padding: 1.2rem !important;
    border-radius: 1.1rem !important;
  }

  .ht-client-hero-v2 h1 {
    font-size: clamp(2.35rem, 13vw, 3.25rem) !important;
    line-height: .94 !important;
  }

  .ht-client-hero-v2 p {
    font-size: .98rem !important;
  }

  .ht-client-actions-v2 {
    width: 100% !important;
    max-width: none !important;
  }

  .ht-client-hero-v2 aside h2,
  .ht-client-hero-v2 .ht-panel-v2 h2 {
    font-size: clamp(2.25rem, 11vw, 3rem) !important;
  }
}

/* ============================================================
   FINAL OVERRIDE v4: Client hero exact admin-style placement
   Fix: buttons must sit under left copy, not center.
   ============================================================ */

@media (min-width: 1181px) {
  .ht-client-dashboard .ht-client-hero-v2,
  .ht-client-dashboard-v2 .ht-client-hero-v2 {
    position: relative !important;
    min-height: 28rem !important;
    padding: 3rem 3.2rem !important;
    display: grid !important;
    grid-template-columns: minmax(32rem, 1fr) minmax(26rem, 38rem) !important;
    grid-template-rows: auto 1fr !important;
    column-gap: clamp(3rem, 8vw, 9rem) !important;
    row-gap: 1.25rem !important;
    align-items: center !important;
  }

  .ht-client-dashboard .ht-client-hero-v2 > div:first-child,
  .ht-client-dashboard-v2 .ht-client-hero-v2 > div:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: end !important;
    justify-self: start !important;
    width: 100% !important;
    max-width: 48rem !important;
  }

  .ht-client-dashboard .ht-client-hero-v2 h1,
  .ht-client-dashboard-v2 .ht-client-hero-v2 h1 {
    font-size: clamp(3.3rem, 4.7vw, 5.15rem) !important;
    line-height: .91 !important;
    letter-spacing: -.085em !important;
    max-width: 48rem !important;
  }

  .ht-client-dashboard .ht-client-hero-v2 p,
  .ht-client-dashboard-v2 .ht-client-hero-v2 p {
    max-width: 44rem !important;
    font-size: clamp(1.08rem, 1.25vw, 1.3rem) !important;
    line-height: 1.42 !important;
  }

  .ht-client-dashboard .ht-client-actions-v2,
  .ht-client-dashboard-v2 .ht-client-actions-v2 {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: start !important;
    width: 18rem !important;
    max-width: 18rem !important;
    margin: .35rem 0 0 0 !important;
    padding: 0 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: .75rem !important;
  }

  .ht-client-dashboard .ht-client-actions-v2 > *,
  .ht-client-dashboard .ht-client-actions-v2 a,
  .ht-client-dashboard .ht-client-actions-v2 button,
  .ht-client-dashboard-v2 .ht-client-actions-v2 > *,
  .ht-client-dashboard-v2 .ht-client-actions-v2 a,
  .ht-client-dashboard-v2 .ht-client-actions-v2 button {
    width: 18rem !important;
    max-width: 18rem !important;
    height: 3rem !important;
    min-height: 3rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .ht-client-dashboard .ht-client-hero-v2 aside,
  .ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2,
  .ht-client-dashboard-v2 .ht-client-hero-v2 aside,
  .ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    justify-self: end !important;
    width: 100% !important;
    max-width: 36rem !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .ht-client-dashboard .ht-client-hero-v2 aside h2,
  .ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2 h2,
  .ht-client-dashboard-v2 .ht-client-hero-v2 aside h2,
  .ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 h2 {
    font-size: clamp(3.2rem, 4.4vw, 4.55rem) !important;
    line-height: .9 !important;
    white-space: normal !important;
  }
}

/* ============================================================
   FINAL OVERRIDE: Client sidebar normal spacing
   Fixes overly tall/spread-out client portal nav spacing.
   ============================================================ */

.ht-sidebar {
  padding: 1.15rem .85rem !important;
}

.ht-client-sidebar,
body:has(.ht-client-dashboard) .ht-sidebar,
body:has(.ht-client-dashboard-v2) .ht-sidebar {
  width: 15.75rem !important;
  min-width: 15.75rem !important;
  max-width: 15.75rem !important;
  padding: 1.05rem .75rem .9rem !important;
  overflow-y: auto !important;
}

.ht-client-sidebar .ht-brand,
body:has(.ht-client-dashboard) .ht-sidebar .ht-brand,
body:has(.ht-client-dashboard-v2) .ht-sidebar .ht-brand {
  min-height: auto !important;
  margin-bottom: .45rem !important;
  padding: 0 .25rem .55rem !important;
}

.ht-client-sidebar .ht-sidebar-real-logo,
body:has(.ht-client-dashboard) .ht-sidebar-real-logo,
body:has(.ht-client-dashboard-v2) .ht-sidebar-real-logo {
  max-width: 12.7rem !important;
  height: auto !important;
}

.ht-client-portal-label {
  margin: .25rem 0 .75rem !important;
  padding: 0 .25rem .65rem !important;
  font-size: .72rem !important;
  letter-spacing: .22em !important;
}

.ht-client-switcher,
.ht-client-switcher-compact {
  margin: 0 0 1.05rem !important;
  padding: .75rem .7rem !important;
  border-radius: .95rem !important;
}

.ht-client-switcher label,
.ht-client-switcher-compact label {
  margin-bottom: .45rem !important;
  font-size: .68rem !important;
}

.ht-client-switcher select,
.ht-client-switcher-compact select {
  height: 2.45rem !important;
  min-height: 2.45rem !important;
  font-size: .8rem !important;
}

.ht-sidebar nav,
.ht-nav {
  display: grid !important;
  gap: .42rem !important;
  margin-top: .25rem !important;
  padding: 0 !important;
}

.ht-sidebar a,
.ht-nav-link {
  min-height: 3.05rem !important;
  height: 3.05rem !important;
  padding: 0 .9rem !important;
  border-radius: .9rem !important;
  gap: .72rem !important;
  font-size: .9rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
}

.ht-nav-icon,
.ht-sidebar a svg {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-width: 1.05rem !important;
}

.ht-sidebar a.active,
.ht-nav-link.active {
  min-height: 3.25rem !important;
  height: 3.25rem !important;
  padding: 0 .95rem !important;
  border-radius: .95rem !important;
}

.ht-sidebar-card,
.ht-client-help-card {
  margin-top: 1.2rem !important;
  padding: .85rem .8rem !important;
  border-radius: .95rem !important;
}

.ht-sidebar-card-title {
  font-size: .76rem !important;
  margin-bottom: .25rem !important;
}

.ht-sidebar-card-text {
  font-size: .76rem !important;
  line-height: 1.18 !important;
}

.ht-status-pill,
.ht-client-help-btn {
  margin-top: .65rem !important;
  min-height: 2.25rem !important;
  height: 2.25rem !important;
  border-radius: .75rem !important;
  font-size: .82rem !important;
}

.ht-client-sidebar .ht-nav-link + .ht-nav-link,
body:has(.ht-client-dashboard) .ht-nav-link + .ht-nav-link,
body:has(.ht-client-dashboard-v2) .ht-nav-link + .ht-nav-link {
  margin-top: 0 !important;
}

@media (max-width: 900px) {
  .ht-client-sidebar,
  body:has(.ht-client-dashboard) .ht-sidebar,
  body:has(.ht-client-dashboard-v2) .ht-sidebar {
    width: 17rem !important;
    min-width: 17rem !important;
    max-width: 17rem !important;
  }

  .ht-sidebar a,
  .ht-nav-link {
    min-height: 3rem !important;
    height: 3rem !important;
  }
}

/* ============================================================
   FINAL OVERRIDE: Dynamic login/auth submit button
   ============================================================ */

.login-card button[type="submit"],
.auth-card button[type="submit"],
.ht-login-card button[type="submit"],
.ht-auth-card button[type="submit"],
form[action*="login"] button[type="submit"],
form[action*="authenticate"] button[type="submit"],
button[type="submit"]:has(+ .ht-login-submit-fallback) {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, #08bee8 0%, #2563eb 45%, #6957e8 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 1rem !important;
  min-height: 3.15rem !important;
  font-weight: 950 !important;
  letter-spacing: -.01em !important;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .28), 0 4px 10px rgba(14, 165, 233, .18) !important;
  transform: translateY(0) !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background-position .35s ease !important;
  background-size: 160% 160% !important;
  background-position: 0% 50% !important;
}

.login-card button[type="submit"]::before,
.auth-card button[type="submit"]::before,
.ht-login-card button[type="submit"]::before,
.ht-auth-card button[type="submit"]::before,
form[action*="login"] button[type="submit"]::before,
form[action*="authenticate"] button[type="submit"]::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  background: radial-gradient(circle at 25% 20%, rgba(255,255,255,.38), transparent 28%), linear-gradient(135deg, rgba(255,255,255,.12), transparent 55%) !important;
  opacity: .85 !important;
  transition: opacity .18s ease !important;
}

.login-card button[type="submit"]:hover,
.auth-card button[type="submit"]:hover,
.ht-login-card button[type="submit"]:hover,
.ht-auth-card button[type="submit"]:hover,
form[action*="login"] button[type="submit"]:hover,
form[action*="authenticate"] button[type="submit"]:hover {
  transform: translateY(-2px) !important;
  filter: saturate(1.08) brightness(1.03) !important;
  background-position: 100% 50% !important;
  box-shadow: 0 22px 44px rgba(37, 99, 235, .34), 0 8px 18px rgba(14, 165, 233, .22) !important;
}

.login-card button[type="submit"]:active,
.auth-card button[type="submit"]:active,
.ht-login-card button[type="submit"]:active,
.ht-auth-card button[type="submit"]:active,
form[action*="login"] button[type="submit"]:active,
form[action*="authenticate"] button[type="submit"]:active {
  transform: translateY(0) scale(.99) !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .25), 0 3px 8px rgba(14, 165, 233, .16) !important;
}

.login-card button[type="submit"]:focus-visible,
.auth-card button[type="submit"]:focus-visible,
.ht-login-card button[type="submit"]:focus-visible,
.ht-auth-card button[type="submit"]:focus-visible,
form[action*="login"] button[type="submit"]:focus-visible,
form[action*="authenticate"] button[type="submit"]:focus-visible {
  outline: 3px solid rgba(14, 165, 233, .34) !important;
  outline-offset: 3px !important;
}

/* ============================================================
   HT FIX: dashboard wrappers should fill available content width
   Scope only:
   - .ht-admin-dashboard-v2
   - .ht-client-dashboard
   - .ht-client-dashboard-v2
   ============================================================ */

.ht-admin-dashboard-v2,
.ht-client-dashboard,
.ht-client-dashboard-v2 {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.ht-content:has(.ht-admin-dashboard-v2),
.ht-content:has(.ht-client-dashboard),
.ht-content:has(.ht-client-dashboard-v2),
main:has(.ht-admin-dashboard-v2),
main:has(.ht-client-dashboard),
main:has(.ht-client-dashboard-v2) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

.ht-admin-dashboard-v2 > *,
.ht-client-dashboard > *,
.ht-client-dashboard-v2 > * {
    max-width: none !important;
}

.ht-admin-dashboard-v2 .ht-page-hero-v2,
.ht-client-dashboard .ht-client-hero-v2,
.ht-client-dashboard-v2 .ht-client-hero-v2,
.ht-admin-dashboard-v2 .ht-metrics-grid-v2,
.ht-client-dashboard .ht-metrics-grid-v2,
.ht-client-dashboard-v2 .ht-metrics-grid-v2,
.ht-admin-dashboard-v2 .ht-panel-v2,
.ht-client-dashboard .ht-panel-v2,
.ht-client-dashboard-v2 .ht-panel-v2 {
    width: 100% !important;
    max-width: none !important;
}


/* HT-DASHBOARD-WIDTH-SOURCE-OF-TRUTH
   Dashboards should fill the available portal content area.
   Do not cap admin/client dashboards at 1680px.
*/
@media (width >= 1280px) {
    .ht-admin-dashboard-v2,
    .ht-client-dashboard,
    .ht-client-dashboard-v2 {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================================
   HT FIX: Dashboard hero typography scale
   Scope only admin/client dashboards.
   ============================================================ */

.ht-admin-dashboard-v2 .ht-admin-hero-v2 h1,
.ht-client-dashboard .ht-client-hero-v2 h1,
.ht-client-dashboard-v2 .ht-client-hero-v2 h1 {
    font-size: clamp(2.55rem, 3.65vw, 4rem) !important;
    line-height: .94 !important;
    letter-spacing: -.07em !important;
    max-width: 15ch !important;
}

.ht-admin-dashboard-v2 .ht-admin-health-card strong,
.ht-admin-dashboard-v2 .ht-health-card strong,
.ht-client-dashboard .ht-health-card strong,
.ht-client-dashboard-v2 .ht-health-card strong,
.ht-client-dashboard .ht-client-hero-v2 aside h2,
.ht-client-dashboard-v2 .ht-client-hero-v2 aside h2,
.ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2 h2,
.ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 h2 {
    font-size: clamp(1.85rem, 2.45vw, 2.7rem) !important;
    line-height: .96 !important;
    letter-spacing: -.055em !important;
    max-width: 14ch !important;
}

.ht-admin-dashboard-v2 .ht-admin-hero-v2 p,
.ht-client-dashboard .ht-client-hero-v2 p,
.ht-client-dashboard-v2 .ht-client-hero-v2 p {
    font-size: clamp(.95rem, 1.05vw, 1.08rem) !important;
    line-height: 1.42 !important;
    max-width: 42rem !important;
}

.ht-admin-dashboard-v2 .ht-kicker,
.ht-client-dashboard .ht-kicker,
.ht-client-dashboard-v2 .ht-kicker {
    font-size: .68rem !important;
    letter-spacing: .20em !important;
}

@media (width >= 1181px) {
    .ht-admin-dashboard-v2 .ht-admin-hero-v2 h1,
    .ht-client-dashboard .ht-client-hero-v2 h1,
    .ht-client-dashboard-v2 .ht-client-hero-v2 h1 {
        font-size: clamp(2.75rem, 3.35vw, 4.15rem) !important;
    }

    .ht-admin-dashboard-v2 .ht-admin-health-card strong,
    .ht-admin-dashboard-v2 .ht-health-card strong,
    .ht-client-dashboard .ht-health-card strong,
    .ht-client-dashboard-v2 .ht-health-card strong,
    .ht-client-dashboard .ht-client-hero-v2 aside h2,
    .ht-client-dashboard-v2 .ht-client-hero-v2 aside h2,
    .ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2 h2,
    .ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 h2 {
        font-size: clamp(2rem, 2.35vw, 2.85rem) !important;
    }
}

@media (width <= 760px) {
    .ht-admin-dashboard-v2 .ht-admin-hero-v2 h1,
    .ht-client-dashboard .ht-client-hero-v2 h1,
    .ht-client-dashboard-v2 .ht-client-hero-v2 h1 {
        font-size: clamp(2.15rem, 10vw, 3rem) !important;
        max-width: 100% !important;
    }

    .ht-admin-dashboard-v2 .ht-admin-health-card strong,
    .ht-admin-dashboard-v2 .ht-health-card strong,
    .ht-client-dashboard .ht-health-card strong,
    .ht-client-dashboard-v2 .ht-health-card strong,
    .ht-client-dashboard .ht-client-hero-v2 aside h2,
    .ht-client-dashboard-v2 .ht-client-hero-v2 aside h2,
    .ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2 h2,
    .ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 h2 {
        font-size: clamp(1.75rem, 8vw, 2.35rem) !important;
        max-width: 100% !important;
    }
}


/* HT FIX: Dashboard hero typography scale - post-build */
.ht-admin-dashboard-v2 .ht-admin-hero-v2 h1,
.ht-client-dashboard .ht-client-hero-v2 h1,
.ht-client-dashboard-v2 .ht-client-hero-v2 h1 {
    font-size: clamp(2.55rem, 3.65vw, 4rem) !important;
    line-height: .94 !important;
    letter-spacing: -.07em !important;
    max-width: 15ch !important;
}

.ht-admin-dashboard-v2 .ht-admin-health-card strong,
.ht-admin-dashboard-v2 .ht-health-card strong,
.ht-client-dashboard .ht-health-card strong,
.ht-client-dashboard-v2 .ht-health-card strong,
.ht-client-dashboard .ht-client-hero-v2 aside h2,
.ht-client-dashboard-v2 .ht-client-hero-v2 aside h2,
.ht-client-dashboard .ht-client-hero-v2 .ht-panel-v2 h2,
.ht-client-dashboard-v2 .ht-client-hero-v2 .ht-panel-v2 h2 {
    font-size: clamp(1.85rem, 2.45vw, 2.7rem) !important;
    line-height: .96 !important;
    letter-spacing: -.055em !important;
    max-width: 14ch !important;
}

.ht-admin-dashboard-v2 .ht-admin-hero-v2 p,
.ht-client-dashboard .ht-client-hero-v2 p,
.ht-client-dashboard-v2 .ht-client-hero-v2 p {
    font-size: clamp(.95rem, 1.05vw, 1.08rem) !important;
    line-height: 1.42 !important;
    max-width: 42rem !important;
}
