@media (min-width: 768px) {
    .delivery-filters .delivery-date-field {
        flex: 0 0 220px;
        max-width: 220px;
    }
}
.delivery-page .delivery-filters { margin-bottom: 1.5rem; }
.delivery-filters > div { margin-bottom: .75rem; }
.delivery-page label { display: block; margin-bottom: .35rem; }
.delivery-table td, .delivery-table th,
#deliveryModal .table td, #deliveryModal .table th {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: middle;
}
.delivery-table .delivery-action { white-space: nowrap; }
.delivery-unit-control { min-width: 125px; }
.delivery-unit-control .dropdown-menu { max-height: 220px; overflow-y: auto; z-index: 1060; }
#deliveryModal .modal-dialog { max-width: 1100px; }
#deliveryModal .modal-content { max-height: calc(100vh - 3.5rem); max-height: calc(100dvh - 3.5rem); }
#deliveryModal .modal-body { overflow-y: auto; min-height: 0; }
#deliveryModal .modal-header, #deliveryModal .modal-footer { flex-shrink: 0; }
#deliveryModal .modal-title { margin: 0; }
#deliveryModal .modal-footer { background: #fff; }
#deliveryModal .actual, #deliveryModal .price { min-width: 90px; }
#deliveryModal .close { min-width: 44px; min-height: 44px; }
.delivery-empty { text-align: center; padding: 2rem !important; color: #6c757d; }
@media (max-width: 767.98px) {
    .delivery-page h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
    .delivery-page .form-control, #deliveryModal .form-control,
    .delivery-login .form-control { font-size: 16px; min-height: 44px; }
    .delivery-page .btn, #deliveryModal .btn, .delivery-login .btn { min-height: 44px; }
    .delivery-filters .delivery-search { width: 100%; }
    .delivery-table, .delivery-table tbody { display: block; width: 100%; }
    .delivery-table thead, #deliveryModal thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .delivery-table tr {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        border: 1px solid #dee2e6; border-radius: .5rem; margin-bottom: 1rem;
        padding: .75rem; background: #fff !important;
    }
    .delivery-table td { display: block; border: 0; padding: .5rem; min-width: 0; }
    .delivery-table td::before, #deliveryModal td::before {
        content: attr(data-label); display: block; color: #6c757d;
        font-size: .875rem; margin-bottom: .25rem;
    }
    .delivery-table .delivery-customer { grid-column: 1 / -1; font-weight: 600; }
    .delivery-table .delivery-action { display: flex; grid-column: 1 / -1; align-items: end; justify-content: end; }
    .delivery-table .delivery-action::before { display: none; }
    .delivery-table .delivery-action .btn { width: 100%; }
    .delivery-table .delivery-empty { grid-column: 1 / -1; }
    #deliveryModal .modal-dialog { margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; }
    #deliveryModal .modal-content {
        height: 100%; max-height: 100%; border: 0; border-radius: 0;
    }
    #deliveryModal .modal-body { padding: 1rem; overscroll-behavior: contain; }
    #deliveryModal .table, #deliveryDetails { display: block; width: 100%; margin: 0; }
    #deliveryDetails tr {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1rem; border: 1px solid #dee2e6; border-radius: .5rem;
        padding: 1rem; margin-bottom: 1rem;
    }
    #deliveryDetails td { display: block; border: 0; padding: 0; min-width: 0; }
    #deliveryDetails .delivery-product-name { grid-column: 1 / -1; font-size: 1.1rem; font-weight: 600; }
    #deliveryModal .actual, #deliveryModal .price, #deliveryModal .delivery-unit-control { min-width: 0; width: 100%; }
    #deliveryModal .modal-footer {
        display: flex; flex-wrap: nowrap; padding: .75rem;
        padding-bottom: max(.75rem, env(safe-area-inset-bottom));
    }
    #deliveryModal .modal-footer .btn { flex: 1; margin: 0 .25rem; }
    .delivery-login h1 { font-size: 1.75rem; }
    .delivery-login .btn { width: 100%; }
}
