/* Nidhi custom dialogs + toasts (teal theme) */

.nidhi-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(380px, calc(100vw - 1.5rem));
    pointer-events: none;
}

.nidhi-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: #fff;
    color: #0f3d45;
    box-shadow: 0 10px 30px rgba(15, 61, 69, 0.18);
    border-left: 4px solid #176876;
    font-size: 0.875rem;
    line-height: 1.35;
    animation: nidhi-toast-in 0.22s ease-out;
}

.nidhi-toast.is-leaving {
    animation: nidhi-toast-out 0.2s ease-in forwards;
}

.nidhi-toast--success { border-left-color: #22c03c; }
.nidhi-toast--error,
.nidhi-toast--danger { border-left-color: #e34a42; }
.nidhi-toast--warning { border-left-color: #ff9900; }
.nidhi-toast--info,
.nidhi-toast--primary { border-left-color: #176876; }

.nidhi-toast__icon {
    flex: 0 0 auto;
    width: 1.25rem;
    text-align: center;
    margin-top: 0.1rem;
    color: #176876;
}

.nidhi-toast--success .nidhi-toast__icon { color: #22c03c; }
.nidhi-toast--error .nidhi-toast__icon,
.nidhi-toast--danger .nidhi-toast__icon { color: #e34a42; }
.nidhi-toast--warning .nidhi-toast__icon { color: #ff9900; }

.nidhi-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.nidhi-toast__close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.nidhi-toast__close:hover { color: #0f3d45; }

@keyframes nidhi-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes nidhi-toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

.nidhi-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 20010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 61, 69, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.nidhi-dialog-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.nidhi-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(15, 61, 69, 0.28);
    overflow: hidden;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.18s ease;
}

.nidhi-dialog-overlay.is-open .nidhi-dialog {
    transform: translateY(0) scale(1);
}

.nidhi-dialog__header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    background: #176876;
    color: #fff;
}

.nidhi-dialog__header--danger { background: #c0392b; }
.nidhi-dialog__header--warning { background: #c47a00; }
.nidhi-dialog__header--success { background: #1aa332; }

.nidhi-dialog__glyph {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.85rem;
    font-weight: 700;
}

.nidhi-dialog__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.nidhi-dialog__body {
    padding: 1rem 1.05rem 0.35rem;
    color: #1a202c;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.nidhi-dialog__input {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 0.65rem;
    border: 1.5px solid #9ecfd6;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0f3d45;
    outline: none;
}

.nidhi-dialog__input:focus {
    border-color: #176876;
    box-shadow: 0 0 0 3px rgba(23, 104, 118, 0.15);
}

.nidhi-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
}

.nidhi-dialog__btn {
    min-width: 84px;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nidhi-dialog__btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.nidhi-dialog__btn--ghost:hover {
    background: #e2e8f0;
}

.nidhi-dialog__btn--primary {
    background: #176876;
    color: #fff;
}

.nidhi-dialog__btn--primary:hover {
    background: #145a66;
}

.nidhi-dialog__btn--danger {
    background: #e34a42;
    color: #fff;
}

.nidhi-dialog__btn--danger:hover {
    background: #c0392b;
}

@media (max-width: 575.98px) {
    .nidhi-toast-host {
        left: 0.75rem;
        right: 0.75rem;
        max-width: none;
    }

    .nidhi-dialog__actions {
        flex-direction: column-reverse;
    }

    .nidhi-dialog__btn {
        width: 100%;
    }
}
