.app-dialog-lock {
    overflow: hidden;
}

.app-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.app-dialog-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.app-dialog-box {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.16s ease;
}

.app-dialog-overlay.is-visible .app-dialog-box {
    transform: translateY(0) scale(1);
}

.app-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px 10px;
}

.app-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #0146ff;
    background: rgba(1, 70, 255, 0.09);
    flex: 0 0 auto;
}

.app-dialog-icon.warning {
    color: #b45309;
    background: #fef3c7;
}

.app-dialog-icon.danger,
.app-dialog-icon.error {
    color: #dc2626;
    background: #fee2e2;
}

.app-dialog-icon.success {
    color: #059669;
    background: #d1fae5;
}

.app-dialog-title {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.app-dialog-body {
    padding: 8px 24px 18px;
}

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

.app-dialog-input {
    width: 100%;
    margin-top: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 11px 12px;
    color: #111827;
    font-size: 14px;
    outline: none;
}

.app-dialog-input:focus {
    border-color: #0146ff;
    box-shadow: 0 0 0 3px rgba(1, 70, 255, 0.1);
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 24px;
}

.app-dialog-button {
    min-width: 92px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.12s ease;
}

.app-dialog-button:active {
    transform: translateY(1px);
}

.app-dialog-button.primary {
    color: #ffffff;
    background: #0146ff;
}

.app-dialog-button.primary:hover,
.app-dialog-button.primary:focus {
    background: #0039cc;
}

.app-dialog-button.danger {
    color: #ffffff;
    background: #dc2626;
}

.app-dialog-button.danger:hover,
.app-dialog-button.danger:focus {
    background: #b91c1c;
}

.app-dialog-button.secondary {
    color: #374151;
    background: #f3f4f6;
}

.app-dialog-button.secondary:hover,
.app-dialog-button.secondary:focus {
    background: #e5e7eb;
}

.app-toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 2147483100;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0146ff;
    border-radius: 10px;
    padding: 12px;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.success {
    border-left-color: #059669;
}

.app-toast.warning {
    border-left-color: #d97706;
}

.app-toast.error,
.app-toast.danger {
    border-left-color: #dc2626;
}

.app-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #0146ff;
    background: rgba(1, 70, 255, 0.09);
}

.app-toast.success .app-toast-icon {
    color: #059669;
    background: #d1fae5;
}

.app-toast.warning .app-toast-icon {
    color: #b45309;
    background: #fef3c7;
}

.app-toast.error .app-toast-icon,
.app-toast.danger .app-toast-icon {
    color: #dc2626;
    background: #fee2e2;
}

.app-toast-message {
    padding-top: 5px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.app-toast-close {
    border: 0;
    color: #6b7280;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 575px) {
    .app-dialog-overlay {
        align-items: flex-end;
        padding: 12px;
    }

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

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

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

    .app-toast-container {
        top: 12px;
        right: 14px;
        width: calc(100vw - 28px);
    }
}
