#create-vo {
    width: min(900px, calc(100vw - 32px)) !important;
    max-width: 900px !important;
    height: min(680px, calc(100dvh - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    margin: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: #fff !important;
}

/* Same interaction pattern as Hỗ trợ / Khấu trừ:
   fixed header + scrollable body + fixed footer.
   Use div:nth-of-type so hidden CSRF inputs never shift the selectors. */
#create-vo > form {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#create-vo > form > div:first-of-type {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    padding: 14px 20px !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

#create-vo > form > div:first-of-type h2 {
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1.2 !important;
}

#create-vo > form > div:first-of-type p {
    margin-top: 4px !important;
    font-size: 12px !important;
    line-height: 18px !important;
}

#create-vo > form > div:nth-of-type(2) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    padding: 14px 20px 18px !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#create-vo > form > div:nth-of-type(2)::-webkit-scrollbar {
    width: 8px;
}

#create-vo > form > div:nth-of-type(2)::-webkit-scrollbar-track {
    background: transparent;
}

#create-vo > form > div:nth-of-type(2)::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 2px solid #fff;
    border-radius: 999px;
}

#create-vo > form > div:nth-of-type(2)::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#create-vo > form > div:nth-of-type(2) > .grid {
    row-gap: 12px !important;
    column-gap: 16px !important;
}

#create-vo > form > div:last-of-type {
    position: relative !important;
    z-index: 20 !important;
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    background: rgba(248, 250, 252, 0.98) !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.05) !important;
}

#create-vo [data-vo-form-section] {
    padding-top: 0 !important;
    min-height: 16px !important;
}

#create-vo .triton-field {
    min-height: 42px !important;
}

#create-vo textarea.triton-field {
    min-height: 64px !important;
    max-height: 96px !important;
}

.vo-effect-field {
    display: block;
}

.vo-field-help {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 10px;
    line-height: 15px;
}

.vo-money-shell {
    position: relative;
    margin-top: 8px;
}

.vo-money-control {
    width: 100%;
    padding-right: 64px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.vo-money-unit {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 7px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    pointer-events: none;
}

.vo-money-shell[data-effect="increase"] .vo-money-control:focus {
    border-color: #86efac !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08) !important;
}

.vo-money-shell[data-effect="decrease"] .vo-money-control:focus {
    border-color: #fca5a5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

.vo-money-help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    min-height: 18px;
}

.vo-money-preview {
    min-width: 0;
    color: #94a3b8;
    font-size: 10px;
    line-height: 15px;
}

.vo-copy-money {
    flex: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.vo-copy-money:hover {
    text-decoration: underline;
}

.vo-value-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.vo-value-summary > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.vo-summary-kicker {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vo-summary-increase,
.vo-summary-decrease {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.vo-summary-increase { color: #047857; }
.vo-summary-decrease { color: #b91c1c; }

.vo-summary-variance {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-align: right;
}

.vo-approval-summary {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.vo-approval-summary[data-effect="decrease"] {
    background: #fef2f2;
    color: #b91c1c;
}

.vo-effect-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #ecfdf5;
    color: #047857;
    font-size: 10px;
    font-weight: 900;
}

.vo-effect-badge[data-effect="decrease"] {
    background: #fef2f2;
    color: #b91c1c;
}

@media (max-height: 760px) {
    #create-vo {
        height: calc(100dvh - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
    }

    #create-vo > form > div:first-of-type {
        padding: 10px 16px !important;
    }

    #create-vo > form > div:first-of-type p {
        display: none !important;
    }

    #create-vo > form > div:nth-of-type(2) {
        padding: 10px 16px 14px !important;
    }

    #create-vo > form > div:nth-of-type(2) > .grid {
        row-gap: 9px !important;
    }

    #create-vo > form > div:last-of-type {
        padding: 8px 14px !important;
    }
}

@media (max-width: 767px) {
    #create-vo {
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 16px !important;
    }

    .vo-value-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .vo-summary-variance {
        text-align: left;
    }
}
