body {
    background-color: #f5f6f8;
}

header h1 {
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    font-weight: 600;
}

.card {
    border-radius: 0.75rem;
}

.btn {
    border-radius: 0.5rem;
}

.schedule-calendar {
    table-layout: fixed;
    background-color: #ffffff;
}

.schedule-calendar th {
    background-color: #f0f2f5;
    font-size: 0.85rem;
    text-align: center;
}

.schedule-calendar td {
    height: 8.5rem;
    min-width: 8.5rem;
    vertical-align: top;
}

.schedule-calendar-muted {
    background-color: #f8f9fa;
    color: #6c757d;
}

.schedule-calendar-today {
    box-shadow: inset 0 0 0 2px #0d6efd;
}

.schedule-calendar-day {
    font-weight: 700;
}

.schedule-calendar-event {
    display: block;
    border: 1px solid #cfe2ff;
    border-radius: 0.375rem;
    background-color: #eaf3ff;
    color: #1f3f73;
    font-size: 0.82rem;
    line-height: 1.2;
    padding: 0.3rem 0.4rem;
}

.schedule-calendar-delivery {
    border-color: #badbcc;
    background-color: #e8f5ee;
    color: #1f5132;
}

.schedule-calendar-time {
    display: inline-block;
    font-weight: 700;
    margin-right: 0.2rem;
}

.schedule-calendar-feeder {
    display: block;
    color: #5f6f84;
    font-size: 0.76rem;
    margin-top: 0.15rem;
}

.request-card-list {
    display: none;
}

.delivery-card-list {
    display: none;
}

.selected-food-display {
    display: none;
}

.upc-video-frame {
    background-color: #111827;
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
}

.upc-video-frame video {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.upc-result {
    background-color: #f8f9fa;
    border: 1px solid #d9dee7;
    border-radius: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.75rem;
    overflow-wrap: anywhere;
}

.upc-photo-preview {
    border-radius: 0.5rem;
    display: block;
    max-height: 16rem;
    max-width: 100%;
    object-fit: contain;
}

.upc-photo-preview:not([src]) {
    display: none;
}

.upc-product-match {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.upc-product-image {
    background-color: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 0.375rem;
    height: 5rem;
    object-fit: contain;
    width: 5rem;
}

.upc-add-form {
    background-color: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 0.5rem;
    padding: 0.85rem;
}

.pack-car-list {
    display: grid;
    gap: 0.9rem;
}

.pack-car-item {
    background-color: #ffffff;
    border: 1px solid #d9dee7;
    border-left: 0.45rem solid #198754;
    border-radius: 0.5rem;
    padding: 0.9rem;
}

.pack-car-total {
    display: grid;
    gap: 0.25rem;
}

.pack-car-quantity {
    color: #155724;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.15;
}

.pack-car-food {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pack-car-breakdown {
    border-top: 1px solid #edf0f4;
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.7rem;
}

.pack-car-delivery {
    line-height: 1.3;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    header {
        gap: 1rem;
    }

    header h1 {
        font-size: 1.7rem;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    .request-page-header {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .request-page-header > a {
        width: 100%;
    }

    .request-table-view {
        display: none;
    }

    .request-card-list {
        display: grid;
        gap: 0.75rem;
    }

    .request-card {
        background-color: #ffffff;
        border: 1px solid #d9dee7;
        border-radius: 0.5rem;
        padding: 0.85rem;
    }

    .request-card-top {
        align-items: flex-start;
        display: flex;
        gap: 0.75rem;
        justify-content: space-between;
    }

    .request-card-number {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .request-card-feeder {
        font-weight: 600;
        margin-top: 0.45rem;
    }

    .request-card-facts {
        display: grid;
        gap: 0.35rem;
        grid-template-columns: 1fr 1fr;
        margin-top: 0.7rem;
    }

    .request-card-label {
        color: #6c757d;
        display: block;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .request-card-notes {
        border-top: 1px solid #edf0f4;
        margin-top: 0.75rem;
        padding-top: 0.65rem;
        overflow-wrap: anywhere;
    }

    .request-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.8rem;
    }

    .request-card-actions .btn,
    .request-card-actions form {
        flex: 1 1 0;
    }

    .request-card-actions .btn {
        width: 100%;
    }

    .delivery-page-header {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .delivery-page-actions,
    .delivery-page-actions .btn {
        width: 100%;
    }

    .delivery-page-actions .btn {
        flex: 1 1 0;
    }

    .delivery-table-view {
        display: none;
    }

    .delivery-card-list {
        display: grid;
        gap: 0.75rem;
    }

    .delivery-card {
        background-color: #ffffff;
        border: 1px solid #d9dee7;
        border-left: 0.45rem solid #6c757d;
        border-radius: 0.5rem;
        padding: 0.85rem;
    }

    .delivery-card-open {
        border-left-color: #0d6efd;
    }

    .delivery-card-delivered {
        border-left-color: #198754;
    }

    .delivery-card-cancelled {
        border-left-color: #6c757d;
    }

    .delivery-card-top {
        align-items: flex-start;
        display: flex;
        gap: 0.75rem;
        justify-content: space-between;
    }

    .delivery-card-date {
        font-weight: 700;
        line-height: 1.25;
    }

    .delivery-card-needed {
        color: #6c757d;
        font-size: 0.82rem;
        margin-top: 0.15rem;
    }

    .delivery-card-request {
        color: #6c757d;
        font-size: 0.82rem;
        font-weight: 700;
        margin-top: 0.55rem;
        overflow-wrap: anywhere;
    }

    .delivery-card-feeder {
        font-size: 1rem;
        font-weight: 700;
        margin-top: 0.2rem;
    }

    .delivery-card-items {
        border-top: 1px solid #edf0f4;
        display: grid;
        gap: 0.55rem;
        margin-top: 0.75rem;
        padding-top: 0.7rem;
    }

    .delivery-card-item {
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .delivery-card-notes {
        border-top: 1px solid #edf0f4;
        margin-top: 0.75rem;
        padding-top: 0.65rem;
        overflow-wrap: anywhere;
    }

    .delivery-card-actions {
        margin-top: 0.8rem;
    }

    .delivery-card-actions .btn {
        width: 100%;
    }

    .upc-scan-header {
        flex-direction: column;
    }

    .upc-scan-header .btn {
        width: 100%;
    }

    .pack-car-header {
        flex-direction: column;
    }

    .pack-car-header .btn {
        width: 100%;
    }

    .order-header-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .order-header-grid > div:first-child,
    .order-header-grid > div:last-child {
        grid-column: 1 / -1;
    }

    .order-form .table-responsive {
        overflow-x: visible;
    }

    .order-items-header {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .order-items-actions {
        width: 100%;
    }

    .order-items-actions .btn {
        flex: 1 1 0;
    }

    .order-form table,
    .order-form thead,
    .order-form tbody,
    .order-form tr,
    .order-form td {
        display: block;
        width: 100%;
    }

    .order-form thead {
        display: none;
    }

    .order-form .request-item {
        background-color: #ffffff;
        border: 1px solid #d9dee7;
        border-radius: 0.5rem;
        display: grid;
        gap: 0.55rem;
        grid-template-columns: minmax(5rem, 0.8fr) minmax(7rem, 1.2fr);
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    .order-form .request-item td {
        border: 0;
        padding: 0;
    }

    .order-form .request-item td:first-child,
    .order-form .request-item td:nth-child(4),
    .order-form .request-item td:nth-child(5) {
        grid-column: 1 / -1;
    }

    .order-form .request-item td:nth-child(2)::before,
    .order-form .request-item td:nth-child(3)::before,
    .order-form .request-item td:nth-child(4)::before {
        color: #6c757d;
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        margin-bottom: 0.15rem;
        text-transform: uppercase;
    }

    .order-form .request-item td:nth-child(2)::before {
        content: "Qty";
    }

    .order-form .request-item td:nth-child(3)::before {
        content: "Available";
    }

    .order-form .request-item td:nth-child(4)::before {
        content: "Notes";
    }

    .selected-food-display {
        display: block;
        line-height: 1.25;
        margin-top: 0.35rem;
        overflow-wrap: anywhere;
    }

    .order-form .remove-item-button {
        width: 100%;
    }
}
