body.app-dialog-open {
    overflow: hidden;
}

.app-field-invalid {
    outline: 2px solid #df5a2a;
    outline-offset: 1px;
}

.app-field-error {
    --app-field-error-arrow-left: 24px;
    position: fixed;
    z-index: 30000;
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    max-width: min(340px, calc(100vw - 16px));
    min-height: 38px;
    padding: 8px 11px;
    box-sizing: border-box;
    color: #2f2925;
    background: #ffffff;
    border: 1px solid #c9c4bf;
    border-radius: 5px;
    box-shadow: 0 3px 9px rgba(39, 31, 26, 0.22);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}

.app-field-error::before,
.app-field-error::after {
    position: absolute;
    left: var(--app-field-error-arrow-left);
    width: 0;
    height: 0;
    border-style: solid;
    content: "";
    transform: translateX(-50%);
}

.app-field-error[data-placement='below']::before {
    top: -9px;
    border-width: 0 9px 9px;
    border-color: transparent transparent #c9c4bf;
}

.app-field-error[data-placement='below']::after {
    top: -7px;
    border-width: 0 8px 8px;
    border-color: transparent transparent #ffffff;
}

.app-field-error[data-placement='above']::before {
    bottom: -9px;
    border-width: 9px 9px 0;
    border-color: #c9c4bf transparent transparent;
}

.app-field-error[data-placement='above']::after {
    bottom: -7px;
    border-width: 8px 8px 0;
    border-color: #ffffff transparent transparent;
}

.app-field-error-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 23px;
    height: 23px;
    color: #ffffff;
    background: #e85b16;
    border-radius: 3px;
    font-size: 17px;
    font-weight: 850;
    line-height: 1;
}

.app-dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(17, 38, 31, 0.48);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.app-dialog-layer[hidden] {
    display: none;
}

.app-dialog-layer.is-open {
    opacity: 1;
}

.app-dialog {
    position: relative;
    width: min(460px, 100%);
    padding: 25px;
    box-sizing: border-box;
    color: #263b31;
    background: #ffffff;
    border: 1px solid #d9e5df;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(16, 45, 36, 0.24);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.16s ease;
}

.app-dialog-layer.is-open .app-dialog {
    transform: translateY(0) scale(1);
}

.app-dialog[data-type='warning'],
.app-dialog.has-content {
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-dialog-close {
    position: absolute;
    top: 13px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #718078;
    background: #f0f4f2;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.app-dialog-close:hover {
    color: #24543e;
    background: #e5efea;
}

.app-dialog-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-right: 34px;
}

.app-dialog-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #287552;
    background: #eaf6ef;
    border: 1px solid #cde5d7;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 800;
}

.app-dialog[data-type='warning'] .app-dialog-icon {
    color: #9a6800;
    background: #fff5d9;
    border-color: #f0d99c;
}

.app-dialog[data-type='danger'] .app-dialog-icon,
.app-dialog[data-type='error'] .app-dialog-icon {
    color: #ae3e43;
    background: #fff0f1;
    border-color: #efc7ca;
}

.app-dialog-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #258454;
    font-size: max(12px, var(--desktop-min-font-size, 12px));
    font-weight: 800;
    letter-spacing: 0.09em;
}

.app-dialog[data-type='warning'] .app-dialog-eyebrow {
    color: #8d630d;
}

.app-dialog[data-type='danger'] .app-dialog-eyebrow,
.app-dialog[data-type='error'] .app-dialog-eyebrow {
    color: #a33b40;
}

.app-dialog h2 {
    margin: 0;
    color: #20352b;
    font-size: 21px;
    line-height: 1.25;
}

.app-dialog-message {
    margin: 18px 0 0;
    color: #596a62;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.negative-stock-confirmation .search-card {
    margin: 14px 0 0;
    animation: none;
}

.negative-stock-confirmation__stock-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.negative-stock-confirmation__stock-line .search-card__stock {
    align-self: center;
    flex-shrink: 0;
}

.negative-stock-confirmation__label {
    min-width: 0;
    color: #64736c;
    font-size: 12px;
    line-height: 1.35;
}

.app-dialog-select-wrap {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.app-dialog-select-wrap[hidden] {
    display: none;
}

.app-dialog-select-label {
    color: #44574e;
    font-size: 13px;
    font-weight: 700;
}

.app-dialog-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 38px 8px 11px;
    box-sizing: border-box;
    color: #263b31;
    background: #ffffff;
    border: 1px solid #cfdcd5;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
}

.app-dialog-select:focus-visible {
    border-color: #38a56f;
    outline: 3px solid rgba(24, 138, 81, 0.14);
    outline-offset: 1px;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 22px;
}

.app-dialog-button {
    min-width: 104px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.app-dialog-cancel {
    color: #53645c;
    background: #eef3f0;
    border-color: #dbe5e0;
}

.app-dialog-cancel:hover {
    background: #e3ebe7;
}

.app-dialog-confirm {
    color: #ffffff;
    background: #188a51;
    border-color: #188a51;
}

.app-dialog-confirm:hover {
    background: #117442;
    border-color: #117442;
}

.app-dialog-confirm.is-danger {
    background: #c44449;
    border-color: #c44449;
}

.app-dialog-confirm.is-danger:hover {
    background: #a93237;
    border-color: #a93237;
}

.app-dialog-close:focus-visible,
.app-dialog-button:focus-visible {
    outline: 3px solid rgba(24, 138, 81, 0.2);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .app-dialog-layer {
        padding: 14px;
    }

    .app-dialog {
        padding: 21px 18px 18px;
        border-radius: 15px;
    }

    .app-dialog-heading {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
    }

    .app-dialog-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .app-dialog h2 {
        font-size: 19px;
    }

    .app-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .app-dialog-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-dialog-layer,
    .app-dialog {
        transition: none;
    }
}
