:root {
    scrollbar-gutter: stable;
}

.app-shell > div {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.dish-preview-trigger {
    position: relative;
    width: 110px;
    height: 82px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: zoom-in;
}

.dish-preview-trigger .dish-visual {
    width: 100%;
    height: 100%;
}

.dish-preview-trigger { isolation: isolate; }

.dish-photo-open {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: zoom-in;
}

.dish-photo-open:focus-visible {
    outline: 3px solid rgba(40, 101, 235, .28);
    outline-offset: -3px;
}

.retryable-photo {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-load-status {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px;
    border-radius: 7px;
    background: #eef3fb;
    color: #53627e;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
    cursor: default;
}

.photo-retry-button {
    min-height: 32px;
    max-width: 100%;
    padding: 3px 5px;
    border: 1px solid #b9caf0;
    border-radius: 6px;
    background: #fff;
    color: #2457cc;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.photo-retry-button:focus-visible { outline: 2px solid #2457cc; }
.manager-dish-preview .photo-load-message { display: none; }
.manager-dish-preview .photo-retry-button { min-height: 44px; padding: 3px 1px; font-size: 10px; }
.dish-photo-stage > .retryable-photo { min-height: inherit; }
.dish-photo-stage .photo-load-status { font-size: 14px; }
.dish-photo-stage .photo-retry-button { min-height: 44px; padding: 8px 16px; font-size: 14px; }

.dish-preview-trigger:focus-visible {
    outline: 3px solid rgba(40, 101, 235, .28);
    outline-offset: 2px;
}

.sortable-heading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sortable-heading.is-active {
    color: #245fdc;
    font-weight: 700;
}

.sortable-heading:focus-visible {
    outline: 2px solid rgba(40, 101, 235, .3);
    outline-offset: 3px;
}

.employee-mobile-sort {
    display: none;
}

.dish-preview-icon {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(28, 61, 133, .9);
    color: #fff;
    box-shadow: 0 3px 10px rgba(21, 46, 102, .24);
}

.dish-photo-lightbox {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(12, 25, 55, .78);
    backdrop-filter: blur(5px);
}

.dish-photo-card {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 56px);
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(7, 18, 43, .36);
}

.dish-photo-close {
    position: absolute;
    z-index: 1;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(18, 39, 85, .9);
    color: #fff;
    cursor: pointer;
}

.dish-photo-stage {
    min-height: 420px;
    max-height: 68vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f4f7fc;
}

.dish-photo-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(68vh - 64px);
    object-fit: contain;
}

.dish-photo-details {
    padding: 20px 24px 24px;
}

.dish-photo-details span,
.dish-photo-details p {
    color: #74839b;
    font-size: 13px;
}

.dish-photo-details h2 {
    margin: 6px 48px 8px 0;
    color: #15203b;
    font-size: 20px;
    line-height: 1.35;
}

.dish-photo-details p {
    margin: 0;
}

.employee-save-notice {
    position: fixed;
    z-index: 6;
    right: 46px;
    bottom: 104px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 440px;
    padding: 13px 16px;
    border: 1px solid #b8e2c8;
    border-radius: 10px;
    background: #edf9f1;
    color: #187846;
    box-shadow: 0 10px 28px rgba(32, 102, 66, .14);
    font-size: 13px;
}

.employee-save-notice strong {
    margin-right: 4px;
}

.save-button > span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.save-button.is-saved,
.save-button.is-saved:disabled {
    background: #218653;
    box-shadow: 0 10px 22px rgba(33, 134, 83, .2);
    cursor: default;
    opacity: 1;
}

.save-button:disabled:not(.is-saved) {
    cursor: wait;
    opacity: .72;
}

.employee-save-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.draft-button,
.complete-button {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 9px;
    padding: 0 18px;
    font-weight: 650;
}

.draft-button {
    border: 1px solid #b9caf0;
    background: #fff;
    color: #2457cc;
}

.draft-button.is-saved,
.draft-button.is-saved:disabled {
    border-color: #b8e2c8;
    background: #edf9f1;
    color: #187846;
    opacity: 1;
}

.draft-button > span,
.complete-button {
    display: flex;
    align-items: center;
    gap: 9px;
}

.complete-button {
    border: 0;
    background: #2865eb;
    color: #fff;
    box-shadow: 0 10px 22px rgba(40, 101, 235, .22);
}

.complete-button:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

.autosave-status.saved { color: #187846; }
.autosave-status.saving { color: #7b5a13; }
.autosave-status.offline,
.autosave-status.error { color: #ae3636; }

.quantity-control.is-locked {
    background: #f5f7fa;
}

.quantity-control .employee-quantity-input {
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: 0;
    padding: 0 2px;
    background: transparent;
    color: #263552;
    text-align: center;
    font-size: 16px;
    font-weight: 620;
}

.employee-quantity-input:focus-visible {
    outline: 2px solid #2865eb;
    outline-offset: -2px;
}

.employee-quantity-input[aria-invalid="true"] {
    background: #fff0f0;
}

.autosave-status.invalid { color: #ae3636; }

.quantity-control.is-locked button {
    cursor: not-allowed;
    opacity: .45;
}

.completion-dialog {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(12, 25, 55, .7);
    backdrop-filter: blur(4px);
}

.completion-dialog-card {
    width: min(510px, 100%);
    padding: 28px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(7, 18, 43, .32);
    text-align: center;
}

.completion-dialog-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: #eaf1ff;
    color: #2865eb;
}

.completion-dialog-card h2 {
    color: #17233d;
    font-size: 20px;
}

.completion-dialog-card p {
    margin: 12px 0 24px;
    color: #66758e;
    font-size: 14px;
    line-height: 1.55;
}

.completion-dialog-card > div:last-child {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.completion-dialog-card button {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    font-weight: 650;
}

.completion-cancel {
    border: 1px solid #cdd8e9;
    background: #fff;
    color: #42516a;
}

.completion-confirm {
    border: 0;
    background: #2865eb;
    color: #fff;
}

.counting-progress {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 8px;
    background: #eef3fb;
    color: #526887;
    font-size: 13px;
    font-weight: 650;
}

.counting-wait {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #5d6d86;
}

.save-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: save-spin .7s linear infinite;
}

@keyframes save-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
    .dish-preview-trigger {
        width: 84px;
        height: 88px;
        grid-row: 1 / 3;
    }

    .dish-photo-lightbox {
        padding: 12px;
    }

    .dish-photo-card {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }

    .dish-photo-stage {
        min-height: 58vh;
        max-height: 70vh;
        padding: 20px;
    }

    .dish-photo-stage img {
        max-height: calc(70vh - 40px);
    }

    .dish-photo-details {
        padding: 17px 18px 20px;
    }

    .dish-photo-details h2 {
        font-size: 17px;
    }

    .employee-save-notice {
        right: 15px;
        bottom: 142px;
        left: 15px;
        max-width: none;
    }

    .savebar {
        height: auto;
        min-height: 128px;
        padding-top: 12px;
        padding-bottom: 12px;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .savebar > div:first-child {
        display: block;
        font-size: 12px;
        line-height: 1.3;
    }

    .savebar > .employee-save-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .draft-button,
    .complete-button {
        width: 100%;
        height: 44px;
    }

    .completion-dialog {
        padding: 14px;
    }

    .completion-dialog-card {
        padding: 22px 18px 18px;
    }

    .completion-dialog-card > div:last-child {
        display: grid;
    }

    .filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
    }

    .filter-row button {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .employee-mobile-sort {
        display: flex;
        align-items: center;
        gap: 7px;
        overflow-x: auto;
        margin: -8px 0 12px;
        padding-bottom: 4px;
        color: #75849c;
        font-size: 12px;
    }

    .employee-mobile-sort > span,
    .employee-mobile-sort button {
        flex: 0 0 auto;
    }

    .employee-mobile-sort button {
        min-height: 32px;
        padding: 0 9px;
        border: 1px solid #d3deee;
        border-radius: 7px;
        background: #fff;
        color: #53627e;
    }

    .employee-mobile-sort button.is-active {
        border-color: #b9d1ff;
        background: #eaf1ff;
        color: #1f5cdd;
        font-weight: 650;
    }

    .inventory-list {
        margin-bottom: 105px;
    }
}
