/* ============================================================
   Telerik UI Overrides (_telerik-overrides.css)
   Global overrides for Telerik component internals.
   Scoped CSS cannot reach these without ::deep, so they live
   here namespaced by .mh-* CSS classes set via the
   component's Class parameter.
   ============================================================ */


/* ---- BillingTabStrip (.billing-tabs-telerik) ----------------
   Applied via <TelerikTabStrip Class="billing-tabs-telerik">
   ------------------------------------------------------------ */
.billing-tabs-telerik.k-tabstrip {
    background-color: transparent;
    border: none;
    box-shadow: none;
    flex: 1;
}

.billing-tabs-telerik .k-tabstrip-items-wrapper {
    border-bottom: none;
    background-color: transparent;
}

.billing-tabs-telerik .k-tabstrip-items {
    background-color: transparent;
    border-bottom: none;
    flex-wrap: wrap;
}

.billing-tabs-telerik .k-tabstrip-item {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background-color: transparent;
}

.billing-tabs-telerik .k-tabstrip-item .k-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--mh-font-size-sm);
    font-weight: var(--mh-font-weight-medium);
    padding: 10px 18px;
    background-color: transparent;
    border: none;
}

.billing-tabs-telerik .k-tabstrip-item:hover,
.billing-tabs-telerik .k-tabstrip-item.k-hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.billing-tabs-telerik .k-tabstrip-item:hover .k-link,
.billing-tabs-telerik .k-tabstrip-item.k-hover .k-link {
    color: #fff;
}

.billing-tabs-telerik .k-tabstrip-item.k-active,
.billing-tabs-telerik .k-tabstrip-item.k-selected {
    border-bottom-color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.billing-tabs-telerik .k-tabstrip-item.k-active .k-link,
.billing-tabs-telerik .k-tabstrip-item.k-selected .k-link {
    color: #fff;
    background-color: transparent;
}

.billing-tabs-telerik .k-tabstrip-content,
.billing-tabs-telerik .k-tabstrip-panels {
    display: none !important;
}

/* Email Us flat button inside billing tab strip */
.billing-tab-email-btn {
    color: color-mix(in srgb, var(--mh-menu-text) 85%, transparent) !important;
    font-size: var(--mh-font-size-sm);
}

.billing-tab-add-loan-btn {
    color: color-mix(in srgb, var(--mh-menu-text) 85%, transparent) !important;
    font-size: var(--mh-font-size-sm);
}

.billing-tab-email-btn:hover {
    color: #fff !important;
    text-decoration: underline;
    background-color: transparent !important;
}

.billing-tab-add-loan-btn:hover {
    color: #fff !important;
    text-decoration: underline;
    background-color: transparent !important;
}

/* ---- Menu (.mh-menu) ----------------------------------------
   Applied via <TelerikMenu Class="mh-menu">
   ------------------------------------------------------------ */
.mh-menu.k-menu {
    background-color: transparent;
    border: none;
    flex-grow: 0;
    display: flex;
    align-items: center;
}

.mh-menu.k-menu-horizontal {
    flex-wrap: nowrap;
}

.mh-menu .k-menu-item {
    color: var(--mh-menu-text);
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.mh-menu .k-menu-link {
    color: var(--mh-menu-text);
    display: flex;
    align-items: center;
    padding: 0.5rem;
    padding-inline: 0.4rem;
    font-weight: var(--mh-font-weight-bold);
    gap: 0.5rem;
}

.mh-menu .k-menu-link .k-icon {
    order: 2;
    margin-left: auto;
}

.mh-menu .k-menu-link:hover,
.mh-menu .k-menu-link.k-hover {
    background-color: var(--mh-menu-hover, rgba(255, 255, 255, 0.15));
}

.mh-menu .k-menu-link-text {
    color: var(--mh-menu-text);
    white-space: nowrap;
}


/* ---- DropDownButton popup items (.k-dropdownbutton-popup) ------
   The TelerikDropDownButton popup renders as a portal outside the
   component DOM, so scoped CSS cannot reach it. This override
   aligns the popup item font family and size with the app's
   compact density to be consistent with the rest of the UI.
   ------------------------------------------------------------ */
.k-dropdownbutton-popup .k-list-item {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: var(--mh-font-size-sm);
    font-weight: var(--mh-font-weight-normal);
}

.k-dropdownbutton-popup .k-list-item:hover,
.k-dropdownbutton-popup .k-list-item.k-hover {
    font-weight: var(--mh-font-weight-normal);
}


/* ---- Account History Grid (.mh-account-history-grid) ----------
   Applied via <TelerikGrid Class="mh-account-history-grid">
   ------------------------------------------------------------ */
.mh-account-history-grid .unpaid-row {
    background-color: #ffcccc;
}

/* Widen the last column (Comments) so the columns fill the grid and no empty
   space is left after the last column. Targets the shared <colgroup> in both
   the header and body tables so the two stay aligned. */
.mh-account-history-grid .k-grid-header col:last-child,
.mh-account-history-grid .k-grid-content col:last-child {
    width: var(--mh-account-history-comments-col-width, 550px);
}


/* Account History radio labels: non-bold 0.9rem to match .filter-label (Telerik-internal, so not in scoped CSS). */
.mh-accounthistory-radio .k-radio-label {
    font-size: 0.9rem;
    font-weight: var(--mh-font-weight-normal, 400);
}

/* Mobile/tablet: stack the RadioGroup into a tight single column. */
@media (max-width: 991.98px) {
    .mh-accounthistory-radio .k-radio-list,
    .mh-accounthistory-radio .k-radio-list.k-list-horizontal {
        flex-direction: column;
        gap: 0.25rem;
        margin: 0;
    }
}

/* Mobile/tablet: collapse Search/Account Info/Totals GridLayouts to a single flex column and reorder cells. */
@media (max-width: 991.98px) {
    #sect-accounthistory-search-grid .k-grid-layout,
    #accounthistory-account-info-group .k-grid-layout,
    #sect-accounthistory-totals .k-grid-layout {
        display: flex !important;
        flex-direction: column;
    }

    /* Keep radios then their dependent search input adjacent (radios -> input -> dates). */
    #sect-accounthistory-search-grid .k-grid-layout > *:has(#sect-accounthistory-search-by) {
        order: -2;
    }

    #sect-accounthistory-search-grid .k-grid-layout > *:has(.accounthistory-search-input) {
        order: -1;
    }

    /* Hide the empty spacer grid items so the stacked column has no gaps. */
    #sect-accounthistory-search-grid .k-grid-layout > *:not(:has(*)) {
        display: none;
    }
}


/* ---- Account History Radio Group (.mh-accounthistory-radio) --
   Applied via <TelerikRadioGroup Class="mh-accounthistory-radio">
   Renders the "Policy ID / Lender/Servicer" radio labels in the
   same non-bold 0.9rem style as the surrounding .filter-label
   captions. Lives here (not in the scoped .razor.css) because
   .k-radio-label is Telerik-internal markup and Blazor scoped
   CSS cannot reach it.
   ------------------------------------------------------------ */
.mh-accounthistory-radio .k-radio-label {
    font-size: 0.9rem;
    font-weight: var(--mh-font-weight-normal, 400);
}


/* ---- Input Width Classes (.mh-input-*) ---------------------
   Telerik components render wrapper divs that need explicit
   width constraints. These rules ensure mh-input-* classes
   properly control the width of Telerik inputs.
   ------------------------------------------------------------ */
.mh-input-xs.k-numerictextbox,
.mh-input-xs.k-combobox,
.mh-input-xs.k-textbox,
.mh-input-xs.k-input {
    width: var(--mh-input-width-xs) !important;
    max-width: var(--mh-input-width-xs) !important;
}

.mh-input-sm.k-numerictextbox,
.mh-input-sm.k-combobox,
.mh-input-sm.k-textbox,
.mh-input-sm.k-input {
    width: var(--mh-input-width-sm) !important;
    max-width: var(--mh-input-width-sm) !important;
}

.mh-input-md.k-numerictextbox,
.mh-input-md.k-combobox,
.mh-input-md.k-textbox,
.mh-input-md.k-input {
    width: var(--mh-input-width-md) !important;
    max-width: var(--mh-input-width-md) !important;
}

.mh-input-lg.k-numerictextbox,
.mh-input-lg.k-combobox,
.mh-input-lg.k-textbox,
.mh-input-lg.k-input {
    width: var(--mh-input-width-lg) !important;
    max-width: var(--mh-input-width-lg) !important;
}

.mh-input-xl.k-numerictextbox,
.mh-input-xl.k-combobox,
.mh-input-xl.k-textbox,
.mh-input-xl.k-input {
    width: var(--mh-input-width-xl) !important;
    max-width: var(--mh-input-width-xl) !important;
}

/* ---- AlertBar (.mh-alert-bar) ------------------------------
   Applied via <TelerikNotification Class="mh-alert-bar">
   TelerikNotification renders outside the component DOM tree
   (portal), so scoped CSS cannot reach it — overrides go here.
   ------------------------------------------------------------ */
.mh-alert-bar .k-notification-container .k-notification {
    width: 600px;
    height: 120px;
    font-size: 1.2em;
    text-align: center;
    margin-top: 40px;
    margin-right: 40px;
    align-items: center;
}

/* Global highlight for an active/selected Telerik Grid row */
.k-grid tr.grid-row-editing > td,
.k-grid tr.grid-row-editing.k-table-alt-row > td {
    background-color: #fff3cd; /* amber highlight for editing */
}

.k-grid tr.grid-row-removing > td,
.k-grid tr.grid-row-removing.k-table-alt-row > td {
    background-color: #f8d7da; /* red highlight for removing */
}

.k-grid tr.grid-row-details > td,
.k-grid tr.grid-row-details.k-table-alt-row > td {
    background-color: #d9edf7; /* light blue highlight for info */
}

/* ---- Administration windows/dialogs (administration-*) ----
   Applied via Class="administration-edit-window" etc. on TelerikWindow
   and TelerikDialog. Scoped CSS cannot reach .k-window /
   .k-dialog elements rendered by Telerik.
   ------------------------------------------------------------ */
.administration-edit-window.k-window,
.administration-permissions-window.k-window,
.administration-delete-dialog.k-dialog-container .k-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100vw - 2rem);
}

.administration-edit-window.k-window {
    width: 520px;
}

.administration-permissions-window.k-window,
.administration-delete-dialog.k-dialog-container .k-dialog {
    width: 400px;
}

/* ---- Administration users grid (administration-users-grid) --
   Applied via Class="administration-users-grid" on TelerikGrid in Users.razor.
   Forces the grid table to always fit within its container width —
   columns share available space proportionally and wrap content
   instead of growing the table, so a horizontal scrollbar never appears.
   ------------------------------------------------------------ */
.administration-users-grid .k-grid-table {
    table-layout: fixed;
    width: 100% !important;
}

.administration-users-grid .k-grid-content {
    overflow-x: hidden;
}

.administration-users-grid .k-table-td {
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}


.payment-detail-window.k-window,
.payment-edit-window.k-window,
.payment-remove-window.k-window,
.payment-comment-window.k-window {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
}

.payment-detail-window.k-window {
    width: min(1280px, calc(100vw - 2rem)) !important;
}

.payment-detail-window .k-window-content {
    max-height: calc(100vh - 8rem);
    overflow: auto;
}






