/**
 * Sketch Labs — global responsive layer
 * Loaded last from component/header.php so it applies across all app pages.
 * Breakpoint: 1150px matches existing sidebar / mobile-header behavior.
 */

/* ----- Base: prevent horizontal page scroll across browsers ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* List pages should not scroll the document; the table card scrolls instead */
body:has(.crm-list-page),
body:has(.task-list-page),
body:has(.template-list-page) {
    overflow: hidden;
    height: 100%;
}

img,
svg,
video,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* max-width only — height:auto collapses LiveCodes / DartPad / embeds */
iframe {
    max-width: 100%;
}

/* Chart.js canvases need explicit sizing — do not force height:auto */
canvas {
    max-width: 100%;
}

/* Tables / wide data: scroll locally instead of blowing out the page */
.table-responsive,
.table-container,
.employee-info,
.sales-info,
.deployment-info,
.ats-rdb-table-scroll,
.task-reminder-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Keep list-table headers fixed while body scrolls */
.crm-list-page .crm-list-table-card .table-container,
.task-list-page .crm-list-table-card .table-container,
.template-list-page .crm-list-table-card .table-container,
.crm-list-page .employee-info.table-container {
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crm-list-page .table thead th,
.task-list-page .table thead th,
.template-list-page .table thead th,
.employee-info .table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #121212 !important;
    color: #fff !important;
}

.table {
    width: 100%;
}

/* Sidebar mobile backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(15, 23, 42, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.is-visible {
    display: block;
}

/* ----- Tablet / mobile shell (matches sidebar hide breakpoint) ----- */
@media only screen and (max-width: 1150px) {
    /* Keep ATS pipeline header prod layout: title left, actions+search right (don't force columns to 100%) */
    .ats-pipeline-page .ats-pipeline-toolbar.divide-column {
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__title.column-one,
    .ats-pipeline-page .ats-pipeline-toolbar__actions.column-two {
        width: auto !important;
        margin-bottom: 0 !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__title.column-one {
        margin-right: auto !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__search {
        flex: 0 1 240px;
        width: 240px;
        min-width: 160px;
        max-width: 280px;
    }

    .main-container,
    body.sidebar-collapsed .main-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 60px;
        padding: 10px;
        height: auto;
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Fixed list pages: lock the page; only the table card scrolls */
    .main-container.crm-list-page,
    .main-container.task-list-page,
    .main-container.template-list-page,
    body.sidebar-collapsed .main-container.crm-list-page,
    body.sidebar-collapsed .main-container.task-list-page,
    body.sidebar-collapsed .main-container.template-list-page {
        height: calc(100vh - 60px) !important;
        height: calc(100dvh - 60px) !important;
        min-height: 0 !important;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow: hidden !important;
        padding: 8px;
        box-sizing: border-box;
    }

    .crm-list-page.fixed-by .sub-container,
    .task-list-page.fixed-by .sub-container,
    .template-list-page.fixed-by .sub-container {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        padding: 12px 10px;
    }

    .crm-list-page .crm-list-header,
    .crm-list-page .crm-list-header .column-one h2,
    .crm-list-page .crm-list-header h2 {
        font-size: 1.125rem;
    }

    /* Keep desktop-style toolbar in one row from tablet up */
    .crm-list-page .crm-list-header {
        flex-wrap: nowrap;
        align-items: center;
    }

    .crm-list-page .crm-list-header .column-one,
    .crm-list-page .crm-list-header .column-two {
        width: auto;
    }

    .crm-list-page .crm-list-toolbar {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .crm-list-page .crm-list-toolbar .btn-black,
    .template-list-page .template-list-toolbar .btn-black,
    .crm-list-page .crm-list-toolbar .employee-add-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .sub-container {
        padding: 16px 12px;
        max-width: 100%;
    }

    .header {
        display: flex;
        height: 56px;
        padding: 0 16px;
        z-index: 100;
    }

    .header-menu-toggle {
        font-size: 18px;
        color: #111827;
    }

    body.sidebar-open .header-menu-toggle {
        pointer-events: auto;
    }

    /* Lock page scroll while the drawer is open; only the menu scrolls */
    html.sidebar-open,
    html.sidebar-open body,
    body.sidebar-open {
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
    }

    body.sidebar-open {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
    }

    body.sidebar-open .main-container,
    body.sidebar-open .header {
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
        pointer-events: none;
    }


    body.sidebar-open .sidebar {
        overflow: hidden;
        touch-action: pan-y;
        pointer-events: auto;
        overscroll-behavior: contain;
    }

    body.sidebar-open .sidebar-nav {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    body.sidebar-open .sidebar-backdrop {
        touch-action: none;
        pointer-events: auto;
    }

    .divide-column {
        flex-wrap: wrap;
        gap: 12px;
        align-items: flex-start;
    }

    .column-one,
    .column-two {
        width: 100%;
    }

    .column-two {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .column-one h2,
    .common-heading h2 {
        font-size: 1.25rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .filter-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-row select,
    .filter-row .form-select,
    .filter-row .form-control {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
    }

    .search,
    .search-input,
    #searchInput {
        width: 100%;
        max-width: 100%;
    }

    /* Keep Filters + Search + Add packed (no flex-grow gap) on list toolbars */
    .crm-list-page .crm-list-toolbar .search,
    .crm-list-page .crm-list-toolbar .search-input,
    .crm-list-page .crm-list-toolbar #searchInput {
        width: 250px;
        max-width: 250px;
        flex: 0 0 auto;
    }


    .btn-black,
    .btn-white {
        min-width: 0;
    }

    .split-view {
        flex-wrap: wrap;
    }

    .list-view ul li {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Wide CRM / ATS toolbars */
    .crm-list-toolbar,
    .template-list-toolbar,
    .ats-rdb-filters-inline,
    .resume-filters-row {
        flex-wrap: wrap;
        max-width: 100%;
    }
}

/* ----- Phones ----- */
@media only screen and (max-width: 767.98px) {
    /* Toasts: bottom of screen on mobile (desktop stays top-right) */
    .crm-toast-stack,
    .position-fixed.end-0.p-3:has(.toast),
    .position-fixed.end-0.p-3:has(#liveToast),
    .position-fixed.end-0.p-3:has(#liveErrorToast) {
        top: auto !important;
        bottom: 0 !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        padding: 12px !important;
        z-index: 1080 !important;
        transform: none !important;
    }

    .crm-toast-stack .toast,
    .position-fixed.end-0.p-3 .toast {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .main-container {
        padding: 8px;
        margin-top: 56px;
        min-height: calc(100vh - 56px);
        min-height: calc(100dvh - 56px);
    }

    .main-container.crm-list-page,
    .main-container.task-list-page,
    .main-container.template-list-page {
        margin-top: 56px !important;
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
        max-height: calc(100vh - 56px);
        max-height: calc(100dvh - 56px);
        min-height: 0 !important;
        padding: 6px;
    }

    .sub-container {
        padding: 12px 10px;
    }

    .common-heading {
        margin-bottom: 16px;
    }

    /* Unified mobile page headings across all modules */
    .column-one h2,
    .common-heading h2,
    .crm-list-header h2,
    .template-list-header h2,
    .sales-pitch-list-header h2,
    .sequence-list-header h2,
    .employee-list-title,
    .template-list-title,
    .sales-pitch-list-title,
    .sequence-page-title,
    .task-list-title,
    .crm-sales-list-title,
    .asset-list-title,
    .main-container h2.mb-0,
    .main-container .sequence-page-title,
    .main-container .task-list-title,
    .main-container .crm-sales-list-title,
    .main-container .asset-list-title {
        font-size: 15px !important;
        line-height: 1.3;
        font-weight: 600;
    }

    /* Asset list mobile: row1 title+type left / filter+add right; row2 search full width */
    .asset-list-page.main-container {
        margin-top: 56px !important;
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
        max-height: calc(100dvh - 56px);
        padding: 4px !important;
    }

    .asset-list-page .sub-container {
        padding: 8px !important;
    }

    .asset-list-page .asset-list-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .asset-list-page .asset-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .asset-list-page .asset-list-title-wrap {
        order: unset;
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
    }

    .asset-list-page .asset-list-title {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .asset-list-page .asset-list-title-wrap .ss-type {
        height: 34px;
        min-height: 34px;
        min-width: 96px;
        max-width: 120px;
        font-size: 12px;
        padding: 0 24px 0 8px;
    }

    .asset-list-page .asset-list-actions {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    .asset-list-page .asset-list-actions .template-filters-toggle-btn,
    .asset-list-page .asset-add-btn {
        order: unset;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        font-size: 12px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .asset-list-page .asset-list-actions .template-filters-toggle-btn {
        width: 34px !important;
        padding: 0;
    }

    .asset-list-page .template-filters-toggle-label {
        display: none;
    }

    .asset-list-page .asset-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .asset-list-page .asset-list-search .search-input,
    .asset-list-page .asset-list-search input,
    .asset-list-page .asset-list-search #searchInput {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        height: 34px;
    }

    .asset-list-page .asset-info.table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .asset-list-page .asset-info .table {
        min-width: 720px;
    }

    /* Companies / Prospects / Leads / Opportunities mobile:
       row1 title left + filter/add right; row2 search full width */
    .crm-list-page .crm-sales-list-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .crm-list-page .crm-sales-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .crm-list-page .crm-sales-list-title {
        order: unset;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .crm-list-page .crm-sales-list-actions {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    .crm-list-page .crm-sales-list-actions .template-filters-toggle-btn,
    .crm-list-page .crm-sales-add-btn,
    .crm-list-page .crm-sales-list-actions #bulkDeleteCompaniesBtn {
        order: unset;
        box-sizing: border-box;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        font-size: 12px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .crm-list-page .crm-sales-list-actions .template-filters-toggle-btn {
        width: 34px !important;
        padding: 0;
    }

    .crm-list-page .crm-sales-list-header .template-filters-toggle-label {
        display: none;
    }

    .crm-list-page .crm-sales-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .crm-list-page .crm-sales-list-search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 34px;
    }

    .crm-list-page .crm-sales-list-search .search-input input,
    .crm-list-page .crm-sales-list-search #searchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        height: 34px;
    }

    /* Task page mobile: row1 title + actions; row2 date nav full width */
    .task-list-page .task-list-header {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin-bottom: 10px !important;
    }

    .task-list-page .task-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .task-list-page .task-list-title {
        order: unset;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .task-list-page .task-list-actions {
        order: unset;
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    .task-list-page .task-list-actions > * {
        order: unset;
    }

    .task-list-page .task-list-actions .btn,
    .task-list-page .task-list-actions .btn-black,
    .task-list-page .task-list-actions .template-filters-toggle-btn {
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        font-size: 12px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .task-list-page .task-list-actions #taskFiltersToggleBtn {
        width: 34px;
        padding: 0;
    }

    .task-list-page .task-holidays-label-full {
        display: none;
    }

    .task-list-page .task-holidays-label-short {
        display: inline;
    }

    .task-list-page .template-filters-toggle-label {
        display: none;
    }

    .task-list-page .task-date-filter-wrap {
        order: 2;
        display: flex !important;
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .task-list-page .task-date-filter-wrap .btn {
        height: 34px;
        min-height: 34px;
        font-size: 12px;
        padding: 0 8px;
    }

    .task-list-page .task-date-nav-btn {
        min-width: 34px;
        flex: 0 0 auto;
    }

    .task-list-page .task-date-chip {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    .task-list-page .task-date-filter-wrap #taskDateToday {
        flex: 0 0 auto;
    }

    .task-list-page .inner-tabs {
        margin-top: 4px;
        margin-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .task-list-page .crm-list-table-card .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .task-list-page .crm-list-table-card .table {
        min-width: 720px;
    }

    /* Keep Send Email / Send Message side by side on mobile */
    .task-list-page .task-row-actions-cell {
        white-space: normal !important;
        min-width: 200px;
        vertical-align: middle;
    }

    .task-list-page .task-row-actions {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        max-width: none;
    }

    .task-list-page .task-row-actions .task-channel-actions {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        min-width: 0;
    }

    .task-list-page .task-row-actions .crm-send-email-link,
    .task-list-page .task-row-actions .crm-send-message-link {
        display: inline;
        margin: 0 !important;
        padding: 0;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .sub-heading {
        padding: 10px 12px;
    }

    .sub-heading h2 {
        font-size: 14px;
    }

    /* Search inputs default to 250px — force full width on mobile list toolbars */
    .main-container .search,
    .main-container .search-input {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .main-container .search input,
    .main-container .search-input input {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    .btn-black,
    .btn-white {
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
        width: auto;
        flex: 0 0 auto;
    }

    /* Employees mobile only: row1 title left + Filters/Add right; row2 search full width */
    .crm-list-page.employee-list-page .employee-list-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .crm-list-page.employee-list-page .employee-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .crm-list-page.employee-list-page .employee-list-actions {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    .crm-list-page.employee-list-page .employee-list-title {
        order: unset;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crm-list-page.employee-list-page .employee-list-header .template-filters-toggle-btn,
    .crm-list-page.employee-list-page .employee-add-btn,
    .crm-list-page.employee-list-page .employee-list-search input {
        order: unset;
        box-sizing: border-box;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 12px;
        margin-left: 0;
    }

    .crm-list-page.employee-list-page .employee-list-header .template-filters-toggle-btn,
    .crm-list-page.employee-list-page .employee-add-btn {
        flex: 0 0 auto !important;
        width: auto !important;
        padding-left: 10px;
        padding-right: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .crm-list-page.employee-list-page .employee-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .crm-list-page.employee-list-page .employee-list-search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 34px;
    }

    .crm-list-page.employee-list-page .employee-list-search .search-input input,
    .crm-list-page.employee-list-page .employee-list-search #searchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    .crm-list-page.employee-list-page .template-filters-toggle-label {
        display: none;
    }

    /* Templates mobile: row1 title left + refresh/filter/create right; row2 search full width */
    .template-list-page .template-list-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .template-list-page .template-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .template-list-page .template-list-title {
        order: unset;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .template-list-page .template-list-actions {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    .template-list-page .template-list-header #templateRefreshBtn,
    .template-list-page .template-list-header #templateFiltersToggleBtn {
        order: unset;
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .template-list-page .template-create-btn {
        order: unset;
        flex: 0 0 auto !important;
        width: auto !important;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        padding: 0 10px;
        font-size: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .template-list-page .template-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .template-list-page .template-list-search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 34px;
    }

    .template-list-page .template-list-search .search-input input,
    .template-list-page .template-list-search #templateSearchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        height: 34px;
    }

    .template-list-page .template-filters-toggle-label {
        display: none;
    }

    /* Sales Pitch Deck mobile: row1 title left + Add right; row2 search full width */
    .sales-pitch-list-page .sales-pitch-list-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 12px !important;
    }

    .sales-pitch-list-page .sales-pitch-list-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1;
    }

    .sales-pitch-list-page .sales-pitch-list-title {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .sales-pitch-list-page .sales-pitch-add-btn {
        flex: 0 0 auto !important;
        width: auto !important;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        padding: 0 10px;
        font-size: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        margin: 0;
    }

    .sales-pitch-list-page .sales-pitch-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .sales-pitch-list-page .sales-pitch-list-search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 34px;
    }

    .sales-pitch-list-page .sales-pitch-list-search .search-input input,
    .sales-pitch-list-page .sales-pitch-list-search #salesPitchSearchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        height: 34px;
    }

    /* Templates mobile: pin eye + ⋮ action column while the table scrolls horizontally */
    .template-list-page .sales-info.table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .template-list-page .sales-info.table-container .table {
        min-width: 900px;
    }

    .template-list-page .sales-info.table-container .fixed-action-column {
        position: sticky !important;
        right: 0;
        z-index: 4;
        overflow: visible;
        box-shadow: -6px 0 10px -8px rgba(0, 0, 0, 0.28);
        white-space: nowrap;
        width: 72px;
        min-width: 72px;
        max-width: 72px;
        padding-left: 8px !important;
        padding-right: 10px !important;
    }

    .template-list-page .sales-info.table-container thead .fixed-action-column {
        background-color: #121212 !important;
        color: #fff !important;
        z-index: 5;
    }

    .template-list-page .sales-info.table-container tbody .fixed-action-column {
        background-color: #fff !important;
    }

    .template-list-page .sales-info.table-container tbody tr:hover .fixed-action-column {
        background-color: #f8f9fa !important;
    }

    .crm-list-page .crm-list-table-footer {
        padding: 10px 12px;
    }

    .crm-list-page .pagination a {
        padding: 3px 8px;
        font-size: 13px;
    }

    .table thead tr th,
    .table tbody tr td {
        font-size: 12px;
        padding: 8px 6px;
    }

    /* Prefer horizontal scroll over crushed / overlapping cells */
    .table-responsive .table thead tr th,
    .table-responsive .table tbody tr td,
    .table-container .table thead tr th,
    .table-container .table tbody tr td,
    .hike-table .table thead tr th,
    .hike-table .table tbody tr td,
    .employee-info .table thead tr th,
    .employee-info .table tbody tr td,
    .sales-info .table thead tr th,
    .sales-info .table tbody tr td {
        white-space: nowrap;
    }

    .list-view {
        padding: 0 4px;
    }

    .list-view ul li {
        width: 100%;
    }

    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }

    .form-floating {
        margin-bottom: 24px;
    }

    /* Stack Bootstrap form rows that use fixed column classes without wrap helpers */
    .row > [class*="col-"] {
        max-width: 100%;
    }
}

/* ----- Small phones ----- */
@media only screen and (max-width: 399.98px) {
    .header {
        padding: 0 12px;
    }

    .product-card,
    .home-main {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ----- Module polish: CRM / ATS / forms ----- */
@media only screen and (max-width: 900px) {
    .crm-list-page .crm-list-toolbar,
    .template-list-page .template-list-toolbar,
    .task-list-page .task-list-toolbar,
    .bookmark-list-page .divide-column {
        flex-wrap: wrap;
        gap: 10px;
    }

    .crm-list-page .search,
    .template-list-page .search,
    .task-list-page .search {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .company-details-quality-pill:not(.is-mobile),
    .prospect-detail-actions,
    .lead-detail-actions {
        max-width: 100%;
    }

    .inner-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .inner-tabs ul,
    ul.inner-tabs {
        display: flex;
        flex-wrap: nowrap;
        width: max-content;
        max-width: none;
    }
}

@media only screen and (max-width: 575.98px) {
    .empty-state {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .empty-state img {
        max-width: min(280px, 80vw);
    }

    .add-employee .row > [class*="col-"],
    .asset-form .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ----- Prefer reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .main-container,
    .sidebar-backdrop {
        transition: none !important;
    }
}

/* ==========================================================================
   Assessment list — horizontal table scroll on mobile only
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .ats-assessment-page .assessment-table-responsive,
    .ats-assessment-page .table-responsive.assessment-table-responsive {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .ats-assessment-page .assessment-table-responsive .table {
        width: max-content;
        min-width: 100%;
    }

    .ats-assessment-page .assessment-table-responsive .table th,
    .ats-assessment-page .assessment-table-responsive .table td {
        white-space: nowrap;
    }
}

/* ==========================================================================
   Assessment submission modal
   Desktop: match production (modal-xl, side-by-side runner, footer L/R)
   Mobile: fullscreen phone layout only
   ========================================================================== */

/* Desktop / tablet — restore production Bootstrap modal-xl behavior */
@media only screen and (min-width: 768px) {
    #resumeAssessmentAttemptPreviewModal .modal-dialog.modal-xl {
        max-width: var(--bs-modal-width, 1140px) !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 1.75rem auto !important;
    }

    #resumeAssessmentAttemptPreviewModal .modal-content {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        border-radius: var(--bs-border-radius-lg, 0.5rem);
        border: var(--bs-modal-border-width, 1px) solid var(--bs-modal-border-color, #dee2e6);
        display: flex;
        flex-direction: column;
    }

    #resumeAssessmentAttemptPreviewModal .modal-header {
        padding: var(--bs-modal-header-padding, 1rem);
    }

    #resumeAssessmentAttemptPreviewModal .modal-title {
        font-size: 1.25rem;
        font-weight: 500;
        line-height: 1.5;
    }

    #resumeAssessmentAttemptPreviewModal .modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: var(--bs-modal-padding, 1rem);
    }

    #resumeAssessmentAttemptPreviewModal .modal-footer {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        padding: var(--bs-modal-footer-padding, 0.75rem);
    }

    #resumeAssessmentAttemptPreviewModal .modal-footer .btn {
        width: auto !important;
        min-height: 0;
        margin: 0 !important;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-livecodes,
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-livecodes-inner {
        min-height: 360px !important;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-dartpad,
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-dartpad-iframe {
        min-height: 320px !important;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-split {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) !important;
        gap: 12px;
    }
}

@media only screen and (min-width: 768px) and (max-width: 900px) {
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-split {
        grid-template-columns: 1fr !important;
    }
}

@media only screen and (max-width: 767.98px) {
    /* Phone-only: keep dialogs inside the viewport without touching desktop modal-xl */
    .modal-dialog {
        max-width: min(100%, calc(100vw - 1rem));
        margin-left: auto;
        margin-right: auto;
    }

    .modal-content {
        max-width: 100%;
    }

    .offcanvas {
        max-width: 100vw;
    }

    #resumeAssessmentAttemptPreviewModal .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100dvh;
    }

    #resumeAssessmentAttemptPreviewModal.modal.show .modal-dialog {
        transform: none;
    }

    #resumeAssessmentAttemptPreviewModal .modal-content {
        height: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    #resumeAssessmentAttemptPreviewModal .modal-header {
        flex: 0 0 auto;
        padding: 0.7rem 0.85rem;
        gap: 8px;
    }

    #resumeAssessmentAttemptPreviewModal .modal-title {
        font-size: 0.95rem;
        line-height: 1.3;
        font-weight: 600;
        padding-right: 0.25rem;
        word-break: break-word;
    }

    #resumeAssessmentAttemptPreviewModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0.85rem;
    }

    #resumeAssessmentAttemptPreviewModal #resumeAssessmentAttemptPreviewMeta {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 0.65rem !important;
    }

    #resumeAssessmentAttemptPreviewModal .modal-footer {
        flex: 0 0 auto;
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 8px !important;
        padding: 0.7rem 0.85rem;
        padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
    }

    #resumeAssessmentAttemptPreviewModal .modal-footer .btn {
        width: 100% !important;
        min-height: 40px;
        margin: 0 !important;
    }

    #resumeAssessmentAttemptPreviewModal .border.rounded.p-3 {
        padding: 0.75rem !important;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-split {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-code-answer {
        max-height: 220px;
        padding: 8px;
        font-size: 11px;
        white-space: pre;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-livecodes,
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-livecodes-inner,
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-dartpad,
    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-dartpad-iframe {
        min-height: 240px !important;
        max-width: 100% !important;
    }

    #resumeAssessmentAttemptPreviewModal .resume-assessment-preview-dartpad {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Requirements list — title + Add button one row on mobile
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .ats-requirements-page .ats-requirements-header.divide-column {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        margin-bottom: 12px;
    }

    .ats-requirements-page .ats-requirements-header .column-one,
    .ats-requirements-page .ats-requirements-header .column-two {
        width: auto !important;
        flex: 0 1 auto;
        margin-bottom: 0 !important;
    }

    .ats-requirements-page .ats-requirements-header .column-one {
        min-width: 0;
        flex: 1 1 auto;
    }

    .ats-requirements-page .ats-requirements-header .column-one h2 {
        font-size: 15px !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ats-requirements-page .ats-requirements-header .column-two {
        flex: 0 0 auto !important;
        justify-content: flex-end !important;
        width: auto !important;
    }

    .ats-requirements-page .ats-requirements-header #reqBtnAdd {
        height: 34px;
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
        white-space: nowrap;
        width: auto !important;
    }

    /* Client/Role Select2 must stay under offcanvas/modal (sales.css uses 9999) */
    .ats-requirements-page .req-filters-compact .select2-container {
        z-index: 1 !important;
    }

    .ats-requirements-page .req-filters-compact .select2-container--open {
        z-index: 20 !important;
    }

    body.modal-open .ats-requirements-page .req-filters-compact .select2-container,
    body:has(.offcanvas.show) .ats-requirements-page .req-filters-compact .select2-container {
        z-index: 1 !important;
    }

    body.modal-open .ats-requirements-page .select2-dropdown.req-filters-select2-dropdown,
    body:has(.offcanvas.show) .ats-requirements-page .select2-dropdown.req-filters-select2-dropdown,
    body.modal-open .select2-dropdown.req-filters-select2-dropdown,
    body:has(.requirements-offcanvas.show) .select2-dropdown.req-filters-select2-dropdown {
        z-index: 1 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* ==========================================================================
   ATS Setting — tabs side-by-side on mobile (desktop unchanged)
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .ats-setting-page .ats-setting-tabs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        width: 100%;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #dee2e6;
    }

    .ats-setting-page .ats-setting-tabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
    }

    .ats-setting-page .ats-setting-tabs .nav-link {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.25;
        font-size: 11px;
        font-weight: 600;
        padding: 0.55rem 0.35rem;
        margin-bottom: 0;
        border-radius: 0;
    }
}

/* ==========================================================================
   Generate Apply Link — mobile only (desktop markup/layout unchanged)
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .main-container.ats-apply-link-generate-page,
    body.sidebar-collapsed .main-container.ats-apply-link-generate-page {
        padding: 0 !important;
        margin-top: 56px !important;
    }

    .ats-apply-link-generate-page > .sub-container {
        padding: 10px 12px !important;
        border-radius: 0;
        max-width: 100% !important;
    }

    .ats-apply-link-generate-page .divide-column {
        margin-bottom: 8px !important;
    }

    .ats-apply-link-generate-page .column-one {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-bottom: 0 !important;
    }

    .ats-apply-link-generate-page .column-one h2,
    .ats-apply-link-generate-page h2.mb-0 {
        font-size: 15px !important;
    }

    .ats-apply-link-generate-page .column-one .btn.btn-link {
        padding: 4px !important;
        margin-bottom: 0 !important;
    }

    .ats-apply-link-generate-page .al-examples {
        margin-bottom: 10px !important;
        line-height: 1.45;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Avoid orphan commas from d-block example spans on phones */
    .ats-apply-link-generate-page .al-examples .d-block {
        display: inline !important;
    }

    .ats-apply-link-generate-page .ats-dashboard-content {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ats-apply-link-generate-page .ats-apply-link-form.row {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.55rem;
    }

    /* Flatten nested col-md-5 / col-md-2 to full width on mobile only */
    .ats-apply-link-generate-page .ats-apply-link-form > [class*="col-"],
    .ats-apply-link-generate-page .ats-apply-link-form .row > [class*="col-"],
    .ats-apply-link-generate-page .ats-apply-link-result .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .ats-apply-link-generate-page .ats-apply-link-form .form-label {
        margin-bottom: 0.2rem;
        font-size: 13px;
        line-height: 1.25;
    }

    .ats-apply-link-generate-page .ats-apply-link-form .form-control,
    .ats-apply-link-generate-page .ats-apply-link-form .form-select {
        font-size: 14px;
        min-height: 38px;
        width: 100%;
    }

    .ats-apply-link-generate-page .ats-apply-link-form .form-text {
        font-size: 12px;
        margin-top: 0.2rem;
    }

    .ats-apply-link-generate-page .ats-apply-link-actions {
        margin-top: 4px;
    }

    .ats-apply-link-generate-page .ats-apply-link-actions .btn-black,
    .ats-apply-link-generate-page #alGenerateBtn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px;
    }

    .ats-apply-link-generate-page .ats-apply-link-result {
        padding: 12px !important;
        margin-bottom: 0;
    }

    .ats-apply-link-generate-page .ats-apply-link-result h3 {
        font-size: 14px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .ats-apply-link-generate-page #alCopyBtn {
        width: 100%;
        min-height: 40px;
    }
}

/* ==========================================================================
   Add Resume form — edge-to-edge, dense mobile shell
   ========================================================================== */
@media only screen and (max-width: 1150px) {
    .main-container.ats-add-resume-page,
    body.sidebar-collapsed .main-container.ats-add-resume-page {
        padding: 2px !important;
        margin-top: 56px !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .ats-add-resume-page > .sub-container {
        padding: 10px 8px !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0;
    }
}

@media only screen and (max-width: 767.98px) {
    .main-container.ats-add-resume-page,
    body.sidebar-collapsed .main-container.ats-add-resume-page {
        padding: 0 !important;
        margin-top: 56px !important;
    }

    .ats-add-resume-page > .sub-container {
        padding: 10px 12px !important;
        border-radius: 0;
    }

    .ats-add-resume-page .divide-column {
        margin-bottom: 6px !important;
    }

    .ats-add-resume-page .column-one {
        gap: 6px !important;
    }

    .ats-add-resume-page .column-one h2,
    .ats-add-resume-page h2.mb-0 {
        font-size: 15px !important;
    }

    .ats-add-resume-page .ats-dashboard-content {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ats-add-resume-page .ats-add-resume-form.row {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
        margin: 0 !important;
    }

    .ats-add-resume-page .ats-add-resume-form > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ats-add-resume-page .ats-add-resume-form .form-label {
        margin-bottom: 0.2rem;
        font-size: 13px;
        line-height: 1.25;
    }

    .ats-add-resume-page .ats-add-resume-form .form-control,
    .ats-add-resume-page .ats-add-resume-form .form-select {
        font-size: 14px;
        min-height: 38px;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .ats-add-resume-page .ats-add-resume-form .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .ats-add-resume-page .ats-add-resume-actions {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 8px !important;
        margin-top: 4px;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ats-add-resume-page .ats-add-resume-actions .btn,
    .ats-add-resume-page .ats-add-resume-actions .btn-black,
    .ats-add-resume-page .ats-add-resume-actions a.btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-content: center;
        min-height: 40px;
        display: inline-flex !important;
        align-items: center;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   Resume Database list page — mobile (title+actions / search / scroll tabs)
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .main-container.ats-resume-page {
        padding: 2px !important;
        margin-top: 56px !important;
        height: calc(100dvh - 56px) !important;
        max-height: calc(100dvh - 56px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* ATS pipeline phone: row1 title left + icons right; row2 search full width */
    .ats-pipeline-page .ats-pipeline-toolbar.divide-column {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__title.column-one {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        order: 1 !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__actions.column-two {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 0 0 auto !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        order: 2 !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__search {
        flex: 1 1 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        order: 3 !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__search .search,
    .ats-pipeline-page .ats-pipeline-toolbar__search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__search .search-input input,
    .ats-pipeline-page .ats-pipeline-toolbar__search #resumeSearchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        height: 34px;
        font-size: 13px;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__title h2 {
        font-size: 15px !important;
        margin: 0 !important;
        white-space: nowrap;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__actions .btn,
    .ats-pipeline-page .ats-pipeline-toolbar__actions .btn-group .btn,
    .ats-pipeline-page .ats-pipeline-toolbar__actions .ats-reminders-bell-btn,
    .ats-pipeline-page .ats-pipeline-toolbar__actions .resume-filters-toggle-btn {
        height: 34px;
        min-height: 34px;
        font-size: 12px;
        padding: 0 8px;
        white-space: nowrap;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__actions .ats-reminders-bell-btn,
    .ats-pipeline-page .ats-pipeline-toolbar__actions .resume-filters-toggle-btn {
        width: 34px !important;
        padding: 0;
        flex: 0 0 auto;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__actions .resume-filters-toggle-label {
        display: none;
    }

    .ats-pipeline-page .ats-pipeline-toolbar__actions .ats-segment-toggle {
        flex: 0 0 auto;
    }

    .ats-resume-page > .sub-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        max-height: 100% !important;
        padding: 6px !important;
        border-radius: 6px;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ats-resume-page .ats-resume-list-header,
    .ats-resume-page .resume-owner-tabs-row {
        flex: 0 0 auto !important;
    }

    .ats-resume-list-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 8px !important;
    }

    .ats-resume-list-top {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        order: 1 !important;
    }

    .ats-resume-list-title-wrap {
        order: 1 !important;
        flex: 1 1 auto !important;
        min-width: 0;
        display: flex !important;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .ats-resume-list-title {
        order: unset !important;
        font-size: 15px !important;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0 !important;
    }

    .ats-resume-list-actions {
        order: 2 !important;
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }

    .ats-resume-list-actions .ats-reminders-bell-btn,
    .ats-resume-list-actions .resume-filters-toggle-btn,
    .ats-resume-list-actions .dropdown,
    .ats-resume-list-actions .btn-black {
        order: unset !important;
        box-sizing: border-box;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        font-size: 12px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .ats-resume-list-actions .ats-reminders-bell-btn,
    .ats-resume-list-actions .resume-filters-toggle-btn {
        width: 34px !important;
        padding: 0;
    }

    .ats-resume-list-actions .resume-filters-toggle-label {
        display: none;
    }

    .ats-resume-list-search {
        order: 2;
        display: block !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }

    .ats-resume-list-search .search,
    .ats-resume-list-search .search-input {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ats-resume-list-search .search-input input,
    .ats-resume-list-search #resumeSearchInput {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        height: 34px;
        font-size: 13px;
    }

    .ats-resume-page:not(.ats-pipeline-page) .resume-table-col,
    .ats-pipeline-page .resume-table-col {
        margin-top: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 0% !important;
        align-self: stretch !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    .ats-resume-page .row.g-3.align-items-start {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
        display: flex !important;
        flex: 1 1 0% !important;
        align-items: stretch !important;
        min-height: 0 !important;
        overflow: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Pipeline: keep toolbar + stage tabs out of the scrollport */
    .ats-pipeline-page .ats-pipeline-toolbar,
    .ats-pipeline-page .ats-pipeline-nav-shell {
        flex: 0 0 auto !important;
        min-height: 0;
    }

    .ats-pipeline-page .ats-pipeline-nav {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Card list is the only vertical scroller — unlock desktop 70vh lock */
    .ats-resume-page:not(.ats-pipeline-page) .resume-table-col .table-container,
    .ats-resume-page .resume-table-col .table-container,
    .ats-pipeline-page .resume-table-col .table-container {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .ats-resume-page .resume-table-footer,
    .ats-pipeline-page .resume-table-footer {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        position: relative;
        z-index: 2;
        background: #fff;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Mobile candidate cards — compact, scannable */
    .ats-resume-page .resume-table thead {
        display: none;
    }

    .ats-resume-page .resume-table,
    .ats-resume-page .resume-table tbody {
        display: block;
        width: 100%;
    }

    .ats-resume-page .resume-table tbody tr {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 12px 10px;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        background: #fff;
        box-sizing: border-box;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .ats-resume-page .resume-table tbody tr:hover {
        background: #fff;
    }

    .ats-resume-page .resume-table tbody td {
        display: none !important;
        border: none !important;
        padding: 0 !important;
        width: 100%;
        min-width: 0;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell,
    .ats-resume-page .resume-table tbody td.resume-contact-cell,
    .ats-resume-page .resume-table tbody td.resume-role-cell,
    .ats-resume-page .resume-table tbody td.resume-exp-cell,
    .ats-resume-page .resume-table tbody td.resume-salary-cell,
    .ats-resume-page .resume-table tbody td.resume-added-cell,
    .ats-resume-page .resume-table tbody td.resume-assign-cell,
    .ats-resume-page .resume-table tbody td[colspan] {
        display: block !important;
    }

    .ats-resume-page .resume-table tbody td[colspan] {
        text-align: center;
        padding: 1rem 0.5rem !important;
        color: #6b7280;
    }

    /* Name + status */
    .ats-resume-page .resume-table tbody td.resume-name-cell {
        margin-bottom: 4px;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-name-status-row {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-name-title-wrap {
        flex: 1 1 auto;
        min-width: 0;
        gap: 6px !important;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-open {
        font-size: 14px;
        font-weight: 650;
        line-height: 1.3;
        color: #0d6efd;
        word-break: break-word;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-table-status {
        flex-shrink: 0;
        font-size: 11px;
        padding: 0.15rem 0.45rem;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-name-secondary {
        margin-top: 4px !important;
        gap: 6px !important;
        font-size: 11px;
        color: #6b7280;
    }

    .ats-resume-page .resume-table tbody td.resume-name-cell .resume-ai-fab {
        position: absolute;
        right: 8px;
        top: 8px;
        opacity: 1;
    }

    .ats-resume-page .resume-table tbody tr {
        position: relative;
    }

    /* Contact: email · phone on one flowing line */
    .ats-resume-page .resume-table tbody td.resume-contact-cell {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px 0;
        margin: 0 0 8px;
        font-size: 12px;
        color: #6b7280;
        line-height: 1.35;
        word-break: break-word;
    }

    .ats-resume-page .resume-table tbody td.resume-contact-cell > div {
        display: inline;
    }

    .ats-resume-page .resume-table tbody td.resume-contact-cell > div:not(:last-child)::after {
        content: "·";
        display: inline-block;
        margin: 0 6px;
        color: #d1d5db;
    }

    /* Meta block: Role / Exp / Salary / Added by as clean rows */
    .ats-resume-page .resume-table tbody td.resume-role-cell {
        display: flex !important;
        align-items: baseline;
        gap: 8px;
        margin-top: 2px;
        padding-top: 8px;
        border-top: 1px solid #f1f1f1;
        font-size: 13px;
        font-weight: 550;
        color: #111827;
        line-height: 1.35;
        word-break: break-word;
    }

    .ats-resume-page .resume-table tbody td.resume-exp-cell,
    .ats-resume-page .resume-table tbody td.resume-salary-cell,
    .ats-resume-page .resume-table tbody td.resume-added-cell {
        display: flex !important;
        align-items: baseline;
        gap: 8px;
        margin-top: 5px;
        font-size: 12px;
        color: #374151;
        line-height: 1.35;
        word-break: break-word;
    }

    .ats-resume-page .resume-table tbody td.resume-role-cell::before,
    .ats-resume-page .resume-table tbody td.resume-exp-cell::before,
    .ats-resume-page .resume-table tbody td.resume-salary-cell::before,
    .ats-resume-page .resume-table tbody td.resume-added-cell::before {
        content: attr(data-label);
        flex: 0 0 3.75rem;
        width: 3.75rem;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.01em;
        text-transform: none;
        color: #9ca3af;
        margin: 0;
    }

    .ats-resume-page .resume-table tbody td.resume-card-meta-value {
        flex: 1 1 auto;
        min-width: 0;
    }

    .ats-resume-page .resume-table tbody td.resume-added-cell .resume-added-details {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 6px;
        min-width: 0;
    }

    .ats-resume-page .resume-table tbody td.resume-added-cell .resume-added-date,
    .ats-resume-page .resume-table tbody td.resume-added-cell .resume-added-by {
        font-size: 12px;
        color: #374151;
        line-height: 1.3;
    }

    .ats-resume-page .resume-table tbody td.resume-added-cell .resume-added-date:not(:empty) + .resume-added-by:not(:empty)::before {
        content: "·";
        margin-right: 6px;
        color: #d1d5db;
    }

    .ats-resume-page .resume-table tbody td.resume-salary-cell .resume-salary-line,
    .ats-resume-page .resume-table tbody td.resume-salary-cell .resume-salary-cell {
        font-size: 12px;
    }

    .ats-resume-page .resume-table tbody td.resume-role-cell .role-skills-info {
        padding: 0 !important;
        margin-left: 4px !important;
        line-height: 1;
        vertical-align: middle;
    }

    .ats-resume-page .resume-table tbody td.resume-assign-cell {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #f1f1f1;
        text-align: left !important;
    }

    .ats-resume-page .resume-table tbody td.resume-assign-cell .btn {
        font-size: 12px;
    }

    .ats-resume-page.resume-owner-tab-unassigned .resume-table tbody td.resume-salary-cell {
        display: none !important;
    }

    .ats-resume-page .resume-table-footer,
    .ats-pipeline-page .resume-table-footer {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px 4px max(12px, env(safe-area-inset-bottom, 0px));
        margin-top: 0;
        border-top: 1px solid #eee;
        box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
        visibility: visible !important;
        opacity: 1 !important;
    }

    .ats-resume-page .resume-pagination-info,
    .ats-pipeline-page .resume-pagination-info {
        font-size: 12px;
        line-height: 1.3;
    }

    .ats-resume-page .resume-pagination-wrap,
    .ats-pipeline-page .resume-pagination-wrap {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 6px;
        width: 100%;
        visibility: visible !important;
    }

    .ats-resume-page .resume-pagination-wrap .pagination-limit,
    .ats-pipeline-page .resume-pagination-wrap .pagination-limit {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .ats-resume-page .resume-pagination-nav,
    .ats-pipeline-page .resume-pagination-nav {
        display: block !important;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        visibility: visible !important;
    }

    .ats-resume-page .resume-pagination-nav .pagination,
    .ats-pipeline-page .resume-pagination-nav .pagination {
        display: flex !important;
        flex-wrap: nowrap;
        width: max-content;
        max-width: none;
        margin-bottom: 0;
    }

    .ats-resume-page .resume-pagination-nav .page-link,
    .ats-pipeline-page .resume-pagination-nav .page-link {
        padding: 0.3rem 0.55rem;
        font-size: 12px;
        min-width: 1.85rem;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Candidate detail drawer — General info | Resume tabs on phones */
    .resume-candidate-offcanvas.offcanvas.offcanvas-end {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .resume-candidate-mobile-tabs {
        display: flex !important;
        gap: 6px;
        width: 100%;
        padding: 0;
        margin-bottom: 10px !important;
    }

    .resume-candidate-mobile-tab {
        flex: 1 1 0;
        min-height: 36px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #f8f9fa;
        color: #6b7280;
        font-size: 13px;
        font-weight: 600;
        padding: 0.4rem 0.5rem;
    }

    .resume-candidate-mobile-tab.is-active {
        background: #121212;
        border-color: #121212;
        color: #fff;
    }

    .resume-candidate-split,
    .resume-candidate-split.resume-candidate-split--copilot {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        max-height: 100dvh;
        overflow: hidden !important;
    }

    .resume-candidate-left,
    .resume-candidate-right,
    .resume-candidate-split--copilot .resume-candidate-left,
    .resume-candidate-split--copilot .resume-candidate-right,
    .resume-copilot-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .resume-candidate-left {
        order: 1;
        border-right: none !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .resume-candidate-detail-panel {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .resume-candidate-left .candidate-drawer-sticky-wrap {
        flex: 0 0 auto;
    }

    /* General info: hide resume pane; scroll info content */
    .resume-candidate-split[data-mobile-panel="info"] .resume-candidate-left {
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    .resume-candidate-split[data-mobile-panel="info"] #resumeCandidateAtsTabsContent {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .resume-candidate-split[data-mobile-panel="info"] .resume-candidate-right,
    .resume-candidate-split[data-mobile-panel="info"] .resume-copilot-panel {
        display: none !important;
    }

    /* Resume: keep header + mobile tabs; show preview full height */
    .resume-candidate-split[data-mobile-panel="resume"] .resume-candidate-left {
        flex: 0 0 auto !important;
        overflow: visible !important;
    }

    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateRejectedDetailsCard,
    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateQuickFileEditWrap,
    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateAtsTabs,
    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateAtsTabsContent,
    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateEditActions,
    .resume-candidate-split[data-mobile-panel="resume"] .resume-copilot-panel {
        display: none !important;
    }

    .resume-candidate-split[data-mobile-panel="resume"] .resume-candidate-right {
        display: flex !important;
        flex-direction: column !important;
        order: 2;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        border-top: 1px solid #e9ecef;
        overflow: hidden !important;
    }

    .resume-candidate-split[data-mobile-panel="resume"] #resumeCandidateFrame {
        flex: 1 1 auto;
        height: 100% !important;
        min-height: 0;
    }

    /* Reminder / map-role panels live in the right pane — must scroll on phones */
    .resume-candidate-split[data-mobile-panel="resume"] .resume-candidate-reminder-panel,
    .resume-candidate-split[data-mobile-panel="resume"] .resume-candidate-requirements-picker,
    .resume-candidate-split[data-mobile-panel="resume"] .resume-candidate-screening-advance {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: 100%;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 12px !important;
    }

    .candidate-close-btn {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 20px !important;
        box-shadow: none !important;
    }

    .candidate-drawer-grid {
        grid-template-columns: 1fr !important;
    }

    .resume-copilot-banner {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }

    .resume-copilot-banner__status {
        padding-left: 0 !important;
        border-left: none !important;
    }

    .resume-copilot-panel__body,
    .resume-copilot-card,
    .resume-copilot-card p,
    .resume-copilot-card li {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ==========================================================================
   ATS dashboards — shared mobile shell (all hub / RDB / prediction / etc.)
   ========================================================================== */
@media only screen and (max-width: 767.98px) {
    .main-container.ats-dash-shell,
    .main-container.ats-rdb-dashboard-page,
    .main-container.ats-rdb-prediction-page,
    .main-container.ats-hub-page,
    .main-container.ats-rej-email-page,
    .main-container.consult-dash,
    .main-container.ats-dash-hub-page {
        padding: 2px !important;
        margin-top: 56px !important;
    }

    .ats-dash-shell > .sub-container,
    .ats-rdb-dashboard-page > .sub-container,
    .ats-rdb-prediction-page > .sub-container,
    .ats-hub-page > .sub-container,
    .ats-rej-email-page > .sub-container,
    .ats-dash-hub-page > .sub-container {
        padding: 6px !important;
        border-radius: 6px;
        max-width: 100%;
    }

    /* Nested consult surface already provides the card — avoid double padding */
    .consult-dash > .sub-container.consult-dash__wrap {
        padding: 0 !important;
        background: transparent;
        box-shadow: none;
    }

    .ats-dash-page-header,
    .ats-rdb-dash-header,
    .ats-ov-header-bar.divide-column {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin-bottom: 8px !important;
    }

    .ats-dash-page-header .column-one,
    .ats-dash-page-header .column-two,
    .ats-rdb-dash-header .column-one,
    .ats-rdb-dash-header .column-two,
    .ats-ov-header-bar .column-one,
    .ats-ov-header-bar .column-two,
    .ats-rej-email-page .divide-column .column-one,
    .ats-rej-email-page .divide-column .column-two {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100%;
        margin: 0 !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    /* Back left + switcher full remaining width */
    .ats-dash-header-bar,
    .ats-rdb-dash-header-bar,
    .ats-hub-header-toolbar {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        align-items: center;
        justify-content: flex-start !important;
        gap: 8px;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ats-dash-shell .ats-dashboard-back-label,
    .ats-rdb-dashboard-page .ats-dashboard-back-label,
    .ats-hub-page .ats-dashboard-back-label,
    .ats-rej-email-page .ats-dashboard-back-label {
        display: none !important;
    }

    .ats-dash-shell .ats-dashboard-back-btn,
    .ats-rdb-dashboard-page .ats-dashboard-back-btn,
    .ats-hub-page .ats-dashboard-back-btn,
    .ats-rej-email-page .ats-dashboard-back-btn {
        flex: 0 0 34px !important;
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 0 !important;
        justify-content: center;
        align-self: center;
    }

    .ats-dash-shell .ats-dashboard-switcher,
    .ats-rdb-dashboard-page .ats-dashboard-switcher,
    .ats-hub-page .ats-dashboard-switcher,
    .ats-rej-email-page .ats-dashboard-switcher {
        display: block !important;
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        margin-left: 0 !important;
    }

    .ats-dash-shell .ats-dashboard-switcher-btn,
    .ats-rdb-dashboard-page .ats-dashboard-switcher-btn,
    .ats-hub-page .ats-dashboard-switcher-btn,
    .ats-rej-email-page .ats-dashboard-switcher-btn {
        display: flex !important;
        width: 100% !important;
        min-height: 34px;
        height: 34px;
        font-size: 13px;
        padding-left: 10px;
        padding-right: 10px;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    /* ----- Resume DB / Prediction filters ----- */
    .ats-rdb-dashboard-page .ats-rdb-filters-inline,
    .ats-rdb-dashboard-page .ats-rdb-filters-inline__body,
    .ats-rdb-dashboard-page .ats-rdb-filters__fields {
        width: 100%;
        max-width: 100%;
    }

    .ats-rdb-dashboard-page .ats-rdb-filters__fields {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .ats-rdb-dashboard-page .ats-rdb-filters__field {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .ats-rdb-dashboard-page .ats-rdb-date-filter-wrap {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
    }

    .ats-rdb-dashboard-page .ats-rdb-date-nav-btn {
        flex: 0 0 32px;
        min-width: 32px;
        width: 32px;
        padding: 0;
    }

    .ats-rdb-dashboard-page .ats-rdb-date-chip {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ats-rdb-dashboard-page #rdbDateToday {
        flex: 0 0 auto;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 12px;
    }

    .ats-rdb-prediction-page .ats-rdb-page-title {
        margin-bottom: 8px !important;
    }

    .ats-rdb-prediction-page .ats-rdb-page-title h5 {
        font-size: 15px;
        margin-bottom: 0 !important;
    }

    .ats-rdb-prediction-page .ats-rdb-section--fu-prediction {
        padding: 0.15rem 0.25rem 0.1rem;
        margin-left: 0;
        margin-right: 0;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-tech__pills,
    .ats-rdb-prediction-page .ats-rdb-unassigned-role-pills,
    .ats-rdb-prediction-page .ats-rdb-wp-status-filters {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        max-width: 100%;
    }

    .ats-rdb-prediction-page .ats-rdb-unassigned-pill,
    .ats-rdb-prediction-page .ats-rdb-wp-status-filter {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 12px;
        padding: 0.35rem 0.7rem;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-tabs {
        width: 100%;
        max-width: 100%;
        display: flex;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-tab {
        flex: 1 1 0;
        text-align: center;
        font-size: 12px;
        padding: 0.4rem 0.5rem;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-avail {
        padding: 0.55rem 0.6rem;
        gap: 0.5rem;
        align-items: center;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-avail__count {
        font-size: 1.05rem;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-avail__title {
        font-size: 0.8125rem;
    }

    .ats-rdb-prediction-page .ats-rdb-fu-pred-avail__blurb {
        display: none;
    }

    .ats-rdb-prediction-page .ats-rdb-section__head h6 {
        font-size: 14px;
    }

    /* Resume DB dashboard — denser cards / charts on phones */
    .ats-rdb-dashboard-page .ats-rdb-section {
        margin-bottom: 0.65rem;
        margin-left: 0;
        margin-right: 0;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .ats-rdb-dashboard-page .ats-rdb-section--minheight {
        min-height: 0 !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-section__head {
        padding: 10px 12px 0 !important;
        font-size: 14px;
    }

    .ats-rdb-dashboard-page .ats-rdb-section__head h6 {
        font-size: 14px;
        font-weight: 700;
    }

    .ats-rdb-dashboard-page .ats-rdb-section__body {
        padding: 8px 12px 12px !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-empty {
        padding: 0.85rem 0.65rem;
        font-size: 0.8125rem;
    }

    /* Email fetch: title then meta stacked left, no tall sparse head */
    .ats-rdb-dashboard-page .ats-rdb-section--email-fetch .ats-rdb-section__head--split {
        flex-direction: column;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-email-fetch-head-meta {
        width: 100%;
        text-align: left !important;
        margin: 0;
    }

    .ats-rdb-dashboard-page .ats-rdb-email-fetch-head-meta__label {
        margin-bottom: 0.1rem;
    }

    .ats-rdb-dashboard-page .ats-rdb-email-fetch-head-meta__value {
        font-size: 0.8125rem;
    }

    .ats-rdb-dashboard-page .ats-rdb-email-fetch-head-meta__status,
    .ats-rdb-dashboard-page .ats-rdb-email-fetch-head-meta__actions {
        max-width: 100%;
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }

    /* Source wise: select full width under title */
    .ats-rdb-dashboard-page .ats-rdb-section--source-wise .ats-rdb-section__head--split {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-source-status-form,
    .ats-rdb-dashboard-page .ats-rdb-source-status-form .form-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Chart hosts shorter on mobile */
    .ats-rdb-dashboard-page .ats-rdb-chart-host,
    .ats-rdb-dashboard-page .ats-rdb-chart-skeleton,
    .ats-rdb-dashboard-page .ats-rdb-source-wise-chart-host {
        height: 200px !important;
        max-height: 200px;
    }

    .ats-rdb-dashboard-page .ats-rdb-chart-skeleton.d-none {
        height: 0 !important;
        max-height: 0 !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-wp-daterange {
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }

    .ats-rdb-dashboard-page .ats-rdb-section__head--split {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .ats-rdb-dashboard-page .ats-rdb-kpi {
        padding: 10px 12px;
    }

    .ats-rdb-dashboard-page .ats-rdb-kpi-grid {
        margin-bottom: 0.75rem;
    }

    .ats-rdb-dashboard-page .row.g-3 {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .ats-rdb-dashboard-page .ats-rdb-unassigned-role-pills,
    .ats-rdb-dashboard-page .ats-rdb-wp-status-filters {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        max-width: 100%;
    }

    .ats-rdb-dashboard-page .ats-rdb-unassigned-pill,
    .ats-rdb-dashboard-page .ats-rdb-wp-status-filter {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* ----- Requirement dashboard ----- */
    .ats-dash-page-filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .ats-dash-page-filters .form-control,
    .ats-dash-page-filters .form-select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .ats-hub-page .nav-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .ats-hub-page .nav-tabs .nav-link {
        font-size: 13px;
        padding: 0.4rem 0.65rem;
    }

    .ats-hub-page .table-responsive {
        margin-left: -2px;
        margin-right: -2px;
    }

    /* ----- Rejection emails ----- */
    .ats-rej-email-page .ats-rej-header-actions {
        width: 100%;
        justify-content: flex-start !important;
        gap: 8px;
    }

    .ats-rej-email-page .ats-rej-header-actions .ats-rej-filter,
    .ats-rej-email-page .ats-rej-header-actions .ats-rej-search,
    .ats-rej-email-page .ats-rej-date-wrap,
    .ats-rej-email-page .ats-rej-date-wrap .ats-rej-date {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .ats-rej-email-page .ats-rej-date-wrap {
        display: flex !important;
    }

    .ats-rej-email-page .ats-rej-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .ats-rej-email-page .ats-rej-tab {
        min-width: 0;
        padding: 10px 12px;
    }

    .ats-rej-email-page .ats-rej-tab.active::after {
        display: none;
    }

    .ats-rej-email-page .ats-rej-tab__label {
        font-size: 12px;
    }

    .ats-rej-email-page .ats-rej-tab__count {
        font-size: 18px;
    }

    .ats-rej-email-page .ats-rej-pager {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    /* ----- Consultancy ----- */
    .main-container.consult-dash {
        padding: 2px !important;
    }

    .consult-dash__toolbar {
        padding: 8px 10px !important;
    }

    .consult-dash__body {
        padding: 10px !important;
    }

    .consult-dash-kpi {
        min-height: 0;
        padding: 0.85rem 0.9rem;
    }

    .consult-dash__section-head {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* ----- ATS hub cards ----- */
    .ats-dash-hub {
        max-width: 100%;
    }

    .ats-dash-hub-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.85rem;
        gap: 0.5rem;
    }

    .ats-dash-hub-header h2 {
        font-size: 1.2rem;
    }

    .ats-dash-hub-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .ats-dash-card {
        min-height: 0;
        padding: 1rem;
    }
}

/* ==========================================================================
   Dashboards — CRM / Employee / Asset / ATS / Funding
   Stack metric rows, gauges, and chart cards so they don't overlap on phones.
   ========================================================================== */

@media only screen and (max-width: 1280px) {
    /* CRM filter toolbar: switcher + user + date */
    .sales .sub-container > .divide-column {
        flex-wrap: wrap;
        gap: 12px;
        align-items: stretch;
    }

    .sales .sub-container > .divide-column > .column-one,
    .sales .sub-container > .divide-column > .column-two.re-two {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        flex: 1 1 100%;
    }

    .sales .column-two.re-two {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: stretch;
        justify-content: stretch;
    }

    .sales .column-two.re-two .select-crm-user-d,
    .sales .column-two.re-two #reportrange {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        box-sizing: border-box;
    }

    .sales .column-two.re-two #reportrange {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    /* Metric tab strip: 2-col grid instead of 5 crushed columns */
    .crm-dashboard-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }

    .crm-dashboard-tabs .dashboard-tabs {
        width: 100%;
        min-width: 0;
        padding: 12px;
        box-sizing: border-box;
    }

    .crm-dashboard-tabs .dashboard-tabs h5 {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 4px;
        word-break: break-word;
    }

    .crm-dashboard-tabs .dashboard-tabs h3 {
        font-size: 20px;
        line-height: 1.2;
    }

    .crm-dashboard-tabs .dashboard-tabs.active:after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Dashboard card rows: stack full width */
    .crm-dashbpard-row {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 20px;
    }

    .crm-dashbpard-row > .crm-dash-card,
    .crm-dashbpard-row > .width50,
    .crm-dashbpard-row > .width100,
    .crm-dashbpard-row > .status-chart,
    .crm-dashbpard-row > .selection-chart,
    .crm-dashbpard-row > .industry-chart,
    .crm-dashbpard-row > .location-chart {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .width50,
    .status-chart,
    .selection-chart,
    .industry-chart,
    .location-chart {
        width: 100% !important;
        max-width: 100%;
    }

    .status-chart,
    .selection-chart,
    .industry-chart,
    .location-chart,
    .max-h-500 {
        max-height: none;
        min-height: 0;
    }

    .crm-dash-card {
        overflow: hidden;
    }

    .crm-dash-card h5 {
        font-size: 16px;
        margin-bottom: 12px;
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 6px 10px;
    }

    .crm-dash-card h5 span {
        float: none;
        display: block;
        width: 100%;
        font-size: 11px;
        line-height: 1.35;
    }

    .crm-dash-card-heading {
        flex-wrap: wrap;
        gap: 8px;
    }

    .crm-dash-card-heading .form-select {
        width: 100%;
        max-width: 100%;
    }

    /* Gauge / doughnut rows inside task cards */
    .today-task .company-chart,
    .overdue-chart .company-chart,
    .crm-dash-card .company-chart {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        align-items: flex-start;
        gap: 8px 4px;
        width: 100%;
        min-width: 0;
    }

    .crm-dash-card .status-container,
    .today-task .status-container,
    .overdue-chart .status-container {
        width: 31% !important;
        min-width: 96px;
        max-width: 120px;
        height: auto !important;
        min-height: 110px;
        margin: 0 auto;
        position: relative;
        flex: 1 1 96px;
    }

    .crm-dash-card .status-container canvas,
    .today-task .status-container canvas,
    .overdue-chart .status-container canvas {
        max-width: 96px !important;
        max-height: 96px !important;
        width: 96px !important;
        height: 96px !important;
        margin: 0 auto;
        display: block;
    }

    .today-task .status-container label,
    .overdue-chart .status-container label,
    .crm-dash-card .status-container label {
        position: absolute;
        left: 0;
        right: 0;
        top: 42px;
        font-size: 16px !important;
        line-height: 1.15;
        text-align: center;
        pointer-events: none;
    }

    .crm-dash-card .status-container label span,
    .today-task .status-container label span,
    .overdue-chart .status-container label span {
        display: block;
        font-size: 11px;
        font-weight: 400;
        margin-top: 2px;
    }

    #remindersChartContainer,
    #taskby-el {
        height: 280px !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
    }

    .company-chart-industry {
        min-height: 240px;
        max-height: 360px;
    }

    .contact-info ul {
        flex-wrap: wrap;
    }

    .contact-info ul li {
        width: 50%;
        padding: 8px 12px;
    }

    /* Employee / asset dashboard cards — asset.css keeps fixed % widths */
    .emp-small-card-view {
        flex-wrap: wrap;
        gap: 10px;
    }

    .emp-small-card,
    .asset .emp-small-card {
        width: 100% !important;
        max-width: 100%;
        margin: 0 0 10px !important;
        box-sizing: border-box;
    }

    .emp-dash-split .status-container,
    .insurance-status .status-container,
    .pf-status .status-container {
        width: min(220px, 72vw) !important;
        max-width: 100% !important;
        height: 280px !important;
        min-height: 280px;
        margin: 0 auto;
        flex: none;
    }

    .ats-dash-hub-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .funding-card-grid {
        grid-template-columns: 1fr;
    }

    .funding-compact-main {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 575.98px) {
    .crm-dashboard-tabs {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .crm-dashboard-tabs .dashboard-tabs.active:after {
        display: none;
    }

    .crm-dash-card .status-container,
    .today-task .status-container,
    .overdue-chart .status-container {
        width: 30% !important;
        min-width: 88px;
        max-width: 110px;
        flex: 1 1 88px;
        min-height: 100px;
    }

    .crm-dash-card .status-container canvas,
    .today-task .status-container canvas,
    .overdue-chart .status-container canvas {
        max-width: 88px !important;
        max-height: 88px !important;
        width: 88px !important;
        height: 88px !important;
    }

    .today-task .status-container label,
    .overdue-chart .status-container label,
    .crm-dash-card .status-container label {
        top: 36px;
        font-size: 14px !important;
    }

    .contact-info ul li {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    #remindersChartContainer,
    #taskby-el {
        height: 220px !important;
    }

    .shift-company-card h3 {
        font-size: 24px;
    }

    /* All ATS dashboards — keep shell tight on small phones */
    .main-container.ats-dash-shell,
    .main-container.ats-rdb-dashboard-page,
    .main-container.ats-rdb-prediction-page,
    .main-container.ats-hub-page,
    .main-container.ats-rej-email-page,
    .main-container.consult-dash,
    .main-container.ats-dash-hub-page {
        padding: 2px !important;
    }

    .ats-dash-shell > .sub-container,
    .ats-rdb-dashboard-page > .sub-container,
    .ats-hub-page > .sub-container,
    .ats-rej-email-page > .sub-container,
    .ats-dash-hub-page > .sub-container {
        padding: 6px !important;
    }

    .consult-dash > .sub-container.consult-dash__wrap {
        padding: 0 !important;
    }

    .ats-dash-header-bar,
    .ats-rdb-dash-header-bar,
    .ats-hub-header-toolbar {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .ats-dash-shell .ats-dashboard-back-btn,
    .ats-hub-page .ats-dashboard-back-btn,
    .ats-rej-email-page .ats-dashboard-back-btn {
        margin-left: 0 !important;
    }

    .ats-dash-shell .ats-dashboard-switcher,
    .ats-dash-shell .ats-dashboard-switcher-btn,
    .ats-hub-page .ats-dashboard-switcher,
    .ats-hub-page .ats-dashboard-switcher-btn,
    .ats-rej-email-page .ats-dashboard-switcher,
    .ats-rej-email-page .ats-dashboard-switcher-btn {
        width: 100% !important;
    }

    .ats-rej-email-page .ats-rej-tabs {
        grid-template-columns: 1fr 1fr;
    }
}

/* Document viewer: keep title + close above the file on phones */
@media only screen and (max-width: 1150px) {
    body:has(#documentModal.show) .modal-backdrop {
        z-index: 1100 !important;
    }

    #documentModal.modal {
        z-index: 1110 !important;
    }

    #documentModal .modal-dialog {
        margin: 12px auto;
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
    }

    #documentModal .modal-content {
        max-height: calc(100dvh - 24px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #documentModal .modal-header {
        flex: 0 0 auto;
        position: relative;
        z-index: 2;
        background: #fff;
    }

    #documentModal .modal-body {
        position: relative;
        z-index: 1;
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    #documentModal #documentIframe {
        display: block;
        width: 100%;
        height: min(68dvh, 560px);
        max-height: calc(100dvh - 140px);
    }
}

/* Email tracking dashboard: let the wide table scroll sideways on phones */
@media only screen and (max-width: 1150px) {
    .crm-email-tracking-dashboard-page.fixed-by .sub-container {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .crm-email-tracking-dashboard-page .crm-list-table-card {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .crm-email-tracking-dashboard-page .crm-list-table-card .table-container {
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .crm-email-tracking-dashboard-page .crm-list-table-card .table {
        width: max-content;
        min-width: 100%;
    }

    .crm-et-overview {
        overflow: visible;
        min-height: auto;
    }

    #emailTrackingSendCardMain {
        grid-template-columns: 1fr;
    }

    .crm-et-send-card-chart-wrap {
        align-items: stretch;
    }
}

/* Funding dashboard: fit the toolbar so the page does not scroll sideways */
@media only screen and (max-width: 1150px) {
    .crm-funding-dashboard-page.fixed-by .sub-container {
        overflow-x: hidden;
        max-width: 100%;
    }

    .crm-funding-dashboard-page .divide-column,
    .crm-funding-dashboard-page .column-one,
    .crm-funding-dashboard-page .column-two,
    .crm-funding-dashboard-page .column-two.re-two,
    .crm-funding-dashboard-page .funding-dashboard-toolbar,
    .crm-funding-dashboard-page .funding-dashboard-groups,
    .crm-funding-dashboard-page .funding-day-section,
    .crm-funding-dashboard-page .funding-timeline-list,
    .crm-funding-dashboard-page .funding-timeline-card,
    .crm-funding-dashboard-page .funding-card-item {
        min-width: 0;
        max-width: 100%;
    }

    .crm-funding-dashboard-page .column-two,
    .crm-funding-dashboard-page .column-two.re-two,
    .crm-funding-dashboard-page .funding-dashboard-toolbar {
        justify-content: flex-start;
        width: 100%;
    }

    .crm-funding-dashboard-page .funding-dashboard-toolbar {
        flex-wrap: wrap;
    }

    .crm-funding-dashboard-page .schedule-dashboard-date-filter-wrap {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .crm-funding-dashboard-page .schedule-dashboard-date-chip {
        flex: 1 1 140px;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .crm-funding-dashboard-page #scheduleDashboardDateLabel {
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .crm-funding-dashboard-page .funding-dashboard-source-filter,
    .crm-funding-dashboard-page .funding-dashboard-view-toggle,
    .crm-funding-dashboard-page #fundingRefreshBtn {
        max-width: 100%;
    }

    .crm-funding-dashboard-page .funding-timeline-item {
        grid-template-columns: 20px minmax(0, 1fr);
        max-width: 100%;
    }

    .crm-funding-dashboard-page .funding-headline,
    .crm-funding-dashboard-page .funding-summary,
    .crm-funding-dashboard-page .funding-company-name {
        overflow-wrap: anywhere;
    }

    .crm-funding-dashboard-page.sales .column-two.re-two #reportrange.schedule-dashboard-date-picker-anchor {
        position: absolute !important;
        left: 0 !important;
        top: 100% !important;
        flex: none !important;
        width: 1px !important;
        max-width: 1px !important;
        height: 1px !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        display: block !important;
        overflow: hidden !important;
    }
}
