/* UI dialogs (js/ui-dialogs.js): styled confirm / alert modal + flash-message fade-out.
   Self-contained (no Bootstrap needed) so it looks the same on every portal, the POS and the login pages. */

.uid-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;   /* above Bootstrap drawers (1045) and modals (1055) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    transition: opacity .16s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.uid-overlay.is-open {
    opacity: 1;
}
/* a dialog that is closing (fading out) can no longer be clicked */
.uid-overlay:not(.is-open) {
    pointer-events: none;
}

.uid-box {
    width: 100%;
    max-width: 400px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: #fff;
    color: #1f2937;
    border-radius: 18px;
    padding: 26px 24px 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    transform: translateY(8px) scale(.97);
    transition: transform .16s ease;
}
.uid-overlay.is-open .uid-box {
    transform: none;
}

.uid-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.uid-primary .uid-icon {
    background: #f6e7e7;
    color: #7b1113;
}
.uid-danger .uid-icon {
    background: #fdecea;
    color: #c0392b;
}
.uid-warning .uid-icon {
    background: #fff4e0;
    color: #b7791f;
}

.uid-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}
.uid-message {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: #4b5563;
    white-space: pre-line;   /* keeps the line breaks some messages use */
    overflow-wrap: anywhere;
}

.uid-actions {
    display: flex;
    gap: 10px;
}
.uid-btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
}
.uid-btn:active {
    transform: scale(.97);
}
.uid-btn:focus-visible {
    outline: 3px solid rgba(123, 17, 19, .35);
    outline-offset: 2px;
}
.uid-btn-cancel {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.uid-btn-cancel:hover {
    background: #f3f4f6;
}
.uid-btn-ok {
    background: #7b1113;
    color: #fff;
}
.uid-danger .uid-btn-ok {
    background: #c0392b;
}
.uid-warning .uid-btn-ok {
    background: #b7791f;
}
.uid-btn-ok:hover {
    filter: brightness(1.08);
}

/* Flash messages fading out after 5 seconds */
.uid-flash-out {
    opacity: 0 !important;
    transform: translateY(-4px);
    transition: opacity .45s ease, transform .45s ease;
}

@media (prefers-reduced-motion: reduce) {
    .uid-overlay,
    .uid-box,
    .uid-flash-out {
        transition: none;
    }
}

/* X added to drawers / pop-ups that have none of their own (js/ui-dialogs.js) */
.offcanvas > .uid-auto-x,
.modal-content > .uid-auto-x {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 1060;
    width: 1.1rem;
    height: 1.1rem;
    padding: .55rem;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    opacity: 1;
}
.offcanvas > .uid-auto-x[hidden],
.modal-content > .uid-auto-x[hidden] { display: none; }
