﻿.vb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 40, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: vb-modal-bg-in 0.25s ease forwards;
}

    .vb-modal-backdrop.active {
        display: flex;
    }

@keyframes vb-modal-bg-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.vb-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 0 1px rgba(26, 75, 130, 0.08), 0 24px 64px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(26, 75, 130, 0.14);
    animation: vb-modal-in 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

@keyframes vb-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar nhỏ gọn */
.vb-modal::-webkit-scrollbar {
    width: 4px;
}

.vb-modal::-webkit-scrollbar-track {
    background: transparent;
}

.vb-modal::-webkit-scrollbar-thumb {
    background: #c3d9f5;
    border-radius: 99px;
}

.vb-modal-header {
    position: relative;
    background: #e6f0fb;
    border-bottom: 1px solid #cfe0f5;
    padding: 18px 22px 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 20px 20px 0 0;
}

    .vb-modal-header::before {
        content: '';
        position: absolute;
        top: -40px;
        right: -30px;
        width: 110px;
        height: 110px;
        background: rgba(47, 107, 178, 0.07);
        border-radius: 50%;
        pointer-events: none;
    }

    .vb-modal-header::after {
        content: '';
        position: absolute;
        bottom: -25px;
        left: 16px;
        width: 75px;
        height: 75px;
        background: rgba(96, 165, 250, 0.06);
        border-radius: 50%;
        pointer-events: none;
    }

.vb-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563b0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(37, 99, 176, 0.35);
}

    .vb-modal-icon i {
        color: white;
        font-size: 16px;
    }

.vb-modal-header-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

    .vb-modal-header-text h5 {
        color: #0c2d5e;
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 2px;
        letter-spacing: 0.01em;
    }

    .vb-modal-header-text small {
        color: #6b8ab5;
        font-size: 12px;
    }

.vb-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(37, 99, 176, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563b0;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

    .vb-modal-close:hover {
        background: #fee2e2;
        color: #e05555;
    }

.vb-modal-body {
    padding: 22px 22px 4px;
}

.vb-modal-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    margin-top: 6px;
}

.vb-modal-section-dot {
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #1a4b82, #60a5fa);
    border-radius: 99px;
    flex-shrink: 0;
}

.vb-modal-section span {
    font-size: 12px;
    font-weight: 700;
    color: #1a4b82;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vb-modal-row {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

    .vb-modal-row.two-col {
        grid-template-columns: 1fr 1fr;
    }

.vb-modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

    .vb-modal-field label .req {
        color: #e05555;
        margin-left: 2px;
    }

.vb-modal-field input {
    width: 100%;
    height: 38px;
    border: 1px solid #dde5f0;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    color: #1a2f4a;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f8fafd;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

    .vb-modal-field input:focus {
        border-color: #2563b0;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(37, 99, 176, 0.1);
    }

    .vb-modal-field input.vb-error {
        border-color: #f87171;
        background: #fff8f8;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
    }

    .vb-modal-field input:disabled {
        background: #f1f5f9;
        color: #94a3b8;
        cursor: not-allowed;
    }

.vb-modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 15%, #e2e8f0 85%, transparent);
    margin: 18px 0 16px;
}

.vb-modal-footer {
    padding: 16px 22px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    align-items: center;
}

.vb-modal-btn-cancel {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 18px;
    height: 38px;
    line-height: 38px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

    .vb-modal-btn-cancel:hover {
        background: #e8edf5;
        border-color: #cbd5e1;
    }

.vb-modal-btn-save {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #1a4b82 0%, #2563b0 100%);
    border: none;
    border-radius: 10px;
    padding: 0 24px;
    height: 38px;
    line-height: 38px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 176, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

    .vb-modal-btn-save:hover {
        background: linear-gradient(135deg, #163d6b 0%, #1a4b82 100%);
        box-shadow: 0 6px 20px rgba(37, 99, 176, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
        transform: translateY(-1px);
    }

    .vb-modal-btn-save:active {
        transform: translateY(0) scale(0.98);
    }

    .vb-modal-btn-save:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none !important;
    }

/* Toast nhỏ trong modal */
.vb-modal-toast {
    margin: 0 22px 14px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    display: none;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

    .vb-modal-toast.success {
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
        color: #15803d;
    }

    .vb-modal-toast.error {
        background: #fff8f8;
        border: 1px solid #fecaca;
        color: #dc2626;
    }

    .vb-modal-toast.show {
        display: flex;
    }

@media (max-width: 540px) {
    .vb-modal-row.two-col {
        grid-template-columns: 1fr;
    }

    .vb-modal {
        border-radius: 16px;
    }
}

.vb-field-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 13px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b; /* ← viền trái đậm hơn cho rõ */
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.6;
    font-family: 'Segoe UI', system-ui, sans-serif;
    grid-column: 1 / -1; /* ← span toàn bộ cột nếu đang trong grid */
    width: 100%;
    box-sizing: border-box;
}

    .vb-field-note i {
        color: #f59e0b;
        font-size: 13px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .vb-field-note strong {
        color: #78350f;
        font-weight: 600;
    }