/* Shared responsive overrides for the admin, business, and consumer layouts. */
.hp-app-layout>.ant-layout,
.hp-content-main,
.hp-content-main .ant-col {
    min-width: 0;
}

.dispatch-tab-label {
    display: none;
}

.hp-main-content-column {
    padding-right: 16px;
    padding-left: 16px;
}

@media screen and (max-width: 991px) {
    .report-page>.ant-row:first-child {
        flex-wrap: wrap;
        gap: 12px;
    }

    .report-page .report-summary {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-page .report-summary>div {
        min-width: 0;
    }

    .report-page .report-filters {
        flex-direction: column;
        align-items: stretch !important;
    }

    .report-page .report-filter-fields {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .report-page .report-filter-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .report-page .ant-table-wrapper,
    .report-page .ant-table-container,
    .report-page .table-responsive {
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .report-page .ant-table-container table {
        min-width: 680px;
    }
}

@media screen and (max-width: 1199px) {
    body.hp-sidebar-open {
        overflow: hidden;
    }

    .hp-app-layout>.hp-sidebar.ant-layout-sider {
        display: flex !important;
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 1051;
        width: min(82vw, 280px) !important;
        min-width: min(82vw, 280px) !important;
        max-width: min(82vw, 280px) !important;
        height: 100dvh;
        flex: none !important;
        overflow: hidden;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
    }

    .hp-app-layout>.hp-sidebar.ant-layout-sider.is-mobile-open {
        transform: translateX(0);
    }

    .hp-app-layout>.hp-sidebar .ant-layout-sider-children {
        width: 100%;
        height: 100dvh;
    }

    .hp-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        border: 0;
        padding: 0;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .hp-sidebar-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .hp-app-layout>.ant-layout {
        width: 100%;
        flex: 1 1 100%;
    }

    .hp-content-main {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hp-content-main .table-responsive,
    .hp-content-main .ant-table-content,
    .hp-content-main .ant-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hp-content-main img,
    .hp-content-main video,
    .hp-content-main canvas {
        max-width: 100%;
        height: auto;
    }

    .modal-dialog,
    .ant-modal {
        max-width: calc(100vw - 32px) !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }
}

@media screen and (max-width: 767px) {
    .hp-main-content-column {
        padding-right: 0;
        padding-left: 0;
    }

    .hp-content-main {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .report-page .report-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px !important;
        padding: 12px 12px 0 !important;
    }

    .report-page .report-summary>div {
        width: 100%;
        padding: 16px !important;
    }

    .report-page .report-filters {
        gap: 10px !important;
        padding: 12px !important;
    }

    .report-page .report-filter-fields,
    .report-page .report-filter-fields>div {
        width: 100% !important;
    }

    .report-page .report-filter-fields input#daterange {
        width: 100% !important;
    }

    .report-page .report-filter-actions>.ant-btn {
        flex: 1 1 140px;
        margin-right: 0 !important;
    }

    .report-page>.ant-row:first-child>* {
        width: 100%;
    }

    .report-page .ant-table-wrapper {
        padding-bottom: 4px;
    }

    .report-page #itemsModal>div {
        width: calc(100vw - 24px) !important;
        max-width: none !important;
        max-height: calc(100dvh - 32px) !important;
    }

    .daterangepicker {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px);
    }

    .daterangepicker .ranges,
    .daterangepicker .drp-calendar {
        width: 100% !important;
        max-width: none !important;
    }

    .hp-content-main .ant-card-body {
        padding: 16px;
    }

    .hp-content-main input:not([type="checkbox"]):not([type="radio"]),
    .hp-content-main select,
    .hp-content-main textarea,
    .hp-content-main .select2-container {
        max-width: 100%;
    }

    .hp-content-main .ant-pagination {
        float: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .dispatch-layout {
        display: flex !important;
        flex-direction: column;
        padding-right: 0 !important;
    }

    .dispatch-layout .dispatch-status-navigation {
        display: block !important;
        width: 100%;
        padding: 0 !important;
        overflow: visible;
    }

    .dispatch-layout .dispatch-status-tabs {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 2px;
        margin: 0;
        padding: 4px;
        border: 0;
        border-radius: 6px;
        background: #f1f4f7;
        overflow-x: hidden;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item {
        display: flex;
        flex: 1 1 0;
        align-items: stretch;
        justify-content: center;
        min-width: 0;
        height: auto;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid transparent;
        border-radius: 4px;
        background: transparent;
        color: #667085;
        transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item::after {
        display: none;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item.ant-menu-item-selected {
        border-color: #e3e7ec;
        background: #fff;
        color: #172b4d;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    }

    .dispatch-layout .dispatch-status-tabs .ant-menu-title-content,
    .dispatch-layout .dispatch-status-tabs a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }

    .dispatch-layout .dispatch-status-tabs a {
        min-height: 38px;
        padding: 8px 4px;
        color: inherit;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    .dispatch-layout .dispatch-status-tabs img {
        display: none !important;
    }

    .dispatch-layout .dispatch-tab-label {
        display: inline;
        font-size: 11px;
        font-weight: 500;
        text-align: center;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item.ant-menu-item-selected .dispatch-tab-label {
        font-weight: 700;
    }

    .dispatch-layout>.ant-col:last-child {
        width: 100%;
        padding: 16px !important;
        overflow: visible !important;
    }

    .ant-btn.ant-btn-background-ghost.export,
    .ant-btn.ant-btn-background-ghost.pdf {
        padding: 0 4px !important;
        font-size: 12px !important;
    }
}

/* Shared responsive overrides for the admin, business, and consumer layouts. */
.hp-app-layout>.ant-layout,
.hp-content-main,
.hp-content-main .ant-col {
    min-width: 0;
}

.dispatch-tab-label {
    display: none;
}

.hp-main-content-column {
    padding-right: 16px;
    padding-left: 16px;
}

@media screen and (max-width: 1199px) {
    body.hp-sidebar-open {
        overflow: hidden;
    }

    .hp-app-layout>.hp-sidebar.ant-layout-sider {
        display: flex !important;
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 1051;
        width: min(82vw, 280px) !important;
        min-width: min(82vw, 280px) !important;
        max-width: min(82vw, 280px) !important;
        height: 100dvh;
        flex: none !important;
        overflow: hidden;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
    }

    .hp-app-layout>.hp-sidebar.ant-layout-sider.is-mobile-open {
        transform: translateX(0);
    }

    .hp-app-layout>.hp-sidebar .ant-layout-sider-children {
        width: 100%;
        height: 100dvh;
    }

    .hp-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        border: 0;
        padding: 0;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .hp-sidebar-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .hp-app-layout>.ant-layout {
        width: 100%;
        flex: 1 1 100%;
    }

    .hp-content-main {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hp-content-main .table-responsive,
    .hp-content-main .ant-table-content,
    .hp-content-main .ant-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hp-content-main img,
    .hp-content-main video,
    .hp-content-main canvas {
        max-width: 100%;
        height: auto;
    }

    .modal-dialog,
    .ant-modal {
        max-width: calc(100vw - 32px) !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }
}

@media screen and (max-width: 767px) {
    .hp-main-content-column {
        padding-right: 0;
        padding-left: 0;
    }

    .hp-content-main {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .hp-content-main .ant-card-body {
        padding: 16px;
    }

    .hp-content-main input:not([type="checkbox"]):not([type="radio"]),
    .hp-content-main select,
    .hp-content-main textarea,
    .hp-content-main .select2-container {
        max-width: 100%;
    }

    .hp-content-main .ant-pagination {
        float: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .dispatch-layout {
        display: flex !important;
        flex-direction: column;
        padding-right: 0 !important;
    }

    .dispatch-layout .dispatch-status-navigation {
        display: block !important;
        width: 100%;
        padding: 12px 8px !important;
        overflow: visible;
    }

    .dispatch-layout .dispatch-status-tabs {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 2px;
        margin: 0;
        padding: 4px;
        border: 0;
        border-radius: 6px;
        background: #f1f4f7;
        overflow-x: hidden;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item {
        display: flex;
        flex: 1 1 0;
        align-items: stretch;
        justify-content: center;
        min-width: 0;
        height: auto;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid transparent;
        border-radius: 4px;
        background: transparent;
        color: #667085;
        transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item::after {
        display: none;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item.ant-menu-item-selected {
        border-color: #e3e7ec;
        background: #fff;
        color: #172b4d;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    }

    .dispatch-layout .dispatch-status-tabs .ant-menu-title-content,
    .dispatch-layout .dispatch-status-tabs a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }

    .dispatch-layout .dispatch-status-tabs a {
        min-height: 38px;
        padding: 8px 4px;
        color: inherit;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    .dispatch-layout .dispatch-status-tabs img {
        display: none !important;
    }

    .dispatch-layout .dispatch-tab-label {
        display: inline;
        font-size: 11px;
        font-weight: 500;
        text-align: center;
    }

    .dispatch-layout .dispatch-status-tabs>.ant-menu-item.ant-menu-item-selected .dispatch-tab-label {
        font-weight: 700;
    }

    .dispatch-layout>.ant-col:last-child {
        width: 100%;
        padding: 16px !important;
        overflow: visible !important;
    }

    .ant-btn.ant-btn-background-ghost.export,
    .ant-btn.ant-btn-background-ghost.pdf {
        padding: 0 4px !important;
        font-size: 12px !important;
    }
}