/* Responsive presentation only. Role workflows and desktop layouts stay in their existing files. */
@media (min-width: 992px) { .mobile-table-scroll { display: contents; } }
@media (max-width: 991.98px) {
    html { overflow-x: hidden; }
    body .dash-container, body .dash-content, body .page-content, body main { min-width: 0; }
    body .dash-content > .row, body .dash-content .row > * { min-width: 0; }
    body .card, body .card-body, body .card-header { min-width: 0; }
    body .pmx-workspace-main > .row { margin-inline: 0; }
    body .card .table-responsive, body .table-responsive {
        width: 100%; max-width: 100%; min-width: 0; margin: 0 !important; padding-inline: 0 !important;
        overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
    }
    body .dataTable-container, body .dataTables_scrollBody, body .mobile-table-scroll {
        max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    body .mobile-scroll-region { max-width: 100%; overscroll-behavior-inline: contain; }
    body .mobile-scroll-region:focus-visible { outline: 2px solid #a393ba; outline-offset: 3px; }
    body .mobile-scroll-label { margin: 6px 0; padding-inline: 3px; color: #7a7a88; font-size: 11px; line-height: 1.8; }
    body .modal .modal-dialog { width: auto !important; max-width: calc(100vw - 20px) !important; margin: 10px auto !important; }
    body .modal .modal-content { max-height: calc(100dvh - 20px); min-width: 0; }
    body .modal .modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
    body .modal .modal-header { gap: 12px; flex-shrink: 0; }
    body .modal .modal-title { min-width: 0; overflow-wrap: anywhere; line-height: 1.7; }
    body .modal .modal-footer { flex-wrap: wrap; gap: 8px; flex-shrink: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    body .modal .modal-footer > * { margin: 0; }
    body dialog[open] { max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; }
    body .dropdown-menu { max-width: calc(100vw - 24px); }
    body .dash-content img, body .modal-body img { max-width: 100%; }
    body .dash-content input:not([type="checkbox"]):not([type="radio"]), body .dash-content select,
    body .modal input:not([type="checkbox"]):not([type="radio"]), body .modal select { max-width: 100%; }
    body .choices, body .select2-container { max-width: 100%; min-width: 0; }
    body .choices__list--multiple .choices__item { max-width: 100%; overflow-wrap: anywhere; }
    body .invoices-export-hidden, body .contracts-export-hidden { position: fixed; }
    body.modal-open #ai-chat-widget { visibility: hidden; }
}

@media (max-width: 767.98px) {
    body .dash-header .desktop-sidebar-item { display: none !important; }
    body .dash-header .header-wrapper { padding-inline: 8px !important; gap: 4px !important; justify-content: space-between; }
    body .dash-header .header-wrapper > .dash-mob-drp, body .dash-header .header-wrapper > .ms-auto { flex: 0 0 auto; min-width: 0; }
    body .dash-header .dash-head-link { width: 40px; min-width: 40px; height: 40px; margin-inline: 1px !important; padding: 6px !important; }
    body .dash-header .drp-company .theme-avtar { width: 27px; height: 27px; }
    body .dash-header .drp-company > .btn {
        max-width: clamp(64px, calc(100vw - 280px), 110px); margin-inline: 0 !important;
        padding: 5px !important; font-size: 11px; line-height: 1.4; white-space: normal;
    }
    body .dash-header .drp-language .drp-arrow, body .dash-header .drp-language .hide-mob,
    body .dash-header .header-role-badge-slot { display: none !important; }
    body .dash-header .dropdown-menu.show { position: fixed !important; inset: 70px 12px auto !important; width: auto !important; transform: none !important; max-height: calc(100dvh - 88px); overflow-y: auto; }
    body .dash-sidebar { max-width: calc(100vw - 40px); }
    body .dash-content .page-header { gap: 12px; }
    body .dash-content .page-header .row { row-gap: 12px; }
    body .dash-content .page-header .col-auto { max-width: 100%; }
    body .dash-content .page-header .header_breadcrumb { flex: 0 0 100%; width: 100%; max-width: 100%; }
    body .all-button-box, body .all-button-box > .d-flex { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    body .all-button-box { justify-content: flex-start !important; margin-top: 8px; }
    body .dash-content .card-body > form.d-flex { min-width: 0; max-width: 100%; }
    body .dash-content select.form-select { min-width: 0 !important; }
    body .apexcharts-canvas, body .apexcharts-canvas > svg { max-width: 100%; }
    body .drp-languages { flex-wrap: wrap; gap: 8px; }
    body .drp-languages > * { min-width: 0; max-width: 100%; margin-inline: 0 !important; }
    body .dash-content .page-header .col-auto, body .card-header .float-end { flex-wrap: wrap; }
    body .dash-content h1, body .dash-content h2, body .dash-content h3, body .dash-content h4,
    body .modal-title, body .task-card h6 { overflow-wrap: anywhere; }
    body .form-control, body .form-select, body .choices__input, body .select2-search__field,
    body #ai-chat-input, body .messenger-search, body textarea.m-send { font-size: 16px; }
    body .form-control:not(textarea), body .form-select, body .choices__inner { min-height: 44px; }
    body .form-check-input { width: 19px; height: 19px; flex-shrink: 0; }
    body .btn:not(.btn-link):not(.btn-close), body .pmx-button { min-height: 40px; }
    body .action-btn { min-width: 36px; min-height: 36px; }
    body .btn-group { flex-wrap: wrap; gap: 3px; }
    body .modal-header, body .modal-body { padding: 16px; }
    body .modal-body .row { row-gap: 12px; }
    body .modal-body .form-group { margin-bottom: 12px; }
    body .modal-dialog .select2-container { width: 100% !important; }
    body .dataTable-top, body .dataTable-bottom, body .dataTables_wrapper .dataTables_length,
    body .dataTables_wrapper .dataTables_filter { max-width: 100%; margin-inline: 0; }
    body .dataTable-top, body .dataTable-bottom { display: flex; flex-wrap: wrap; gap: 12px; }
    body .dataTable-search, body .dataTable-search .dataTable-input { width: 100%; min-width: 0; }
    body .pagination { flex-wrap: wrap; gap: 3px; margin: 0; }
    body .page-link { min-width: 36px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    body nav[role="navigation"] { max-width: 100%; }
    body nav[role="navigation"] svg { width: 18px; height: 18px; }
    body nav[role="navigation"] > div:first-child { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    body nav[role="navigation"] > div.hidden { display: none; }
    body nav[role="navigation"] > div:first-child a, body nav[role="navigation"] > div:first-child > span { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 14px; }
    body .kanban-board, body .mm-board { max-width: 100%; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    body .kanban-board .kanban-col { min-width: 0; flex: 0 0 min(320px, calc(100vw - 60px)); width: min(320px, calc(100vw - 60px)); scroll-snap-align: start; }
    body .kanban-col .task-card { overflow-wrap: anywhere; }
    body .kanban-col .task-card h6 { min-width: 0; }
    body .task-card-actions { flex-shrink: 0; }
    body .pmx-workspace-main > .dash-content > .row { margin-inline: 0; }
    body .pmx-workspace-main > .row { margin-inline: 0; }
    body .pmx-page { min-width: 0; }
    body .pmx-card > header, body .pmx-card-header { flex-wrap: wrap; }
    body .pmx-card b, body .pmx-card strong, body .pmx-task-name { min-width: 0; overflow-wrap: anywhere; }
    body .pmx-teams-grid, body .pmx-goals-grid, body .pmx-files-grid { grid-template-columns: minmax(0, 1fr); }
    body .pmx-profile-copy, body .pmx-search-wrap { min-width: 0; }
    body .pmx-customize-drawer { max-width: calc(100vw - 20px); }
    body .notification-panel__header, body .notification-card { padding-inline: 14px; }
    body .notification-panel__title { font-size: 14px; }
    body .notification-panel__clear { flex-shrink: 0; }
    body #ai-chat-window { max-height: calc(100dvh - 20px); }
    body .messenger { min-height: 0 !important; height: calc(100dvh - 150px); padding-inline: 0 !important; margin-top: 0 !important; }
    body .messenger-listView, body .messenger-messagingView { min-width: 0; max-width: 100%; }
    body .messenger .m-header { padding-inline: 12px; }
    body .messenger .m-send { max-width: 100%; }
}

@media (max-width: 360px) {
    body .dash-header .header-wrapper .dash-h-item:not(:has(> .btn)) { width: 34px; min-width: 34px; flex: 0 0 34px; }
    body .dash-header .dash-head-link { width: 34px; min-width: 34px; margin-inline: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
    @media (max-width: 991.98px) { body .mobile-scroll-region { scroll-behavior: auto; } }
}
