    .x-dialog-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .7);
        z-index: 9998;
    }

    .x-dialog {
        font-family: "LINE Seed Sans", system-ui, -apple-system, sans-serif;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(.95);
        background: rgba(24, 24, 27, .95);
        color: white;
        padding: 24px;
        border-radius: 16px;
        width: 100%;
        max-width: 420px;
        z-index: 9999;
        opacity: 0;
        transition: opacity .2s ease, transform .2s ease;
    }

    .x-dialog2 {
        font-family: "LINE Seed Sans", system-ui, -apple-system, sans-serif;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(.95);
        background: rgba(24, 24, 27, .95);
        color: white;
        padding: 24px;
        border-radius: 16px;
        width: 100%;
        max-width: 900px;
        z-index: 9999;
        opacity: 0;
        transition: opacity .2s ease, transform .2s ease;
    }

    .x-dialog h2 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .x-dialog p {
        font-size: 14px;
        opacity: .85;
        line-height: 1.6;
    }

    .x-dialog2 h2 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .x-dialog2 p {
        font-size: 14px;
        opacity: .85;
        line-height: 1.6;
    }

    .x-dialog-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 20px;
    }

    /* base */
    .btn {
        font-family: "LINE Seed Sans", sans-serif;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 10px;
        cursor: pointer;
        transition: .15s ease;
        border: none;
    }

    /* cancel */
    .btn-ghost {
        background: transparent;
        color: #e5e7eb;
    }

    .btn-ghost:hover {
        background: rgba(255, 255, 255, .08);
    }

    /* confirm */
    .btn-primary {
        background: linear-gradient(135deg, #10b981, #059669);
        color: #fff;
        font-weight: 700;
        box-shadow: 0 8px 20px rgba(16, 185, 129, .35);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 28px rgba(16, 185, 129, .45);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(16, 185, 129, .35);
    }

    .dialog-close {
        position: absolute;
        top: 12px;
        right: 12px;
        background: transparent;
        border: none;
        color: #fff;
        opacity: .6;
        font-size: 16px;
        cursor: pointer;
        transition: .15s;
    }

    .dialog-close:hover {
        opacity: 1;
        transform: rotate(90deg);
    }


    .x-dialog.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .x-dialog2.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .x-dialog-hidden {
        display: none !important;
    }

    .ab-modal-overlay {
        transition: opacity .2s ease;
    }

    .ab-modal-hidden {
        opacity: 0;
    }

    .btn-delete {
        padding: 6px 12px;
        border: 1px solid rgba(239, 68, 68, 0.4);
        color: #dc2626;
        /* แดงชัด */
        background-color: #fff;
        border-radius: 8px;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        opacity: 1 !important;
    }

    .btn-delete:hover {
        background-color: rgba(239, 68, 68, 0.08);
    }

    td .btn-delete {
        padding: 6px 12px;
        border: 1px solid rgba(239, 68, 68, 0.4);
        color: #dc2626;
        /* แดงชัด */
        background-color: #fff;
        border-radius: 8px;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        opacity: 1 !important;
    }

    td .btn-delete:hover {
        background-color: rgba(239, 68, 68, 0.08);
    }

    .btn-edit {
        padding: 6px 12px;
        border: 1px solid rgba(255, 181, 0, 0.4);
        color: #ff9700;
        /* แดงชัด */
        background-color: #fff;
        border-radius: 8px;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        opacity: 1 !important;
    }

    .btn-edit:hover {
        background-color: rgba(239, 175, 68, 0.08);
    }

    td .btn-edit {
        padding: 6px 12px;
        border: 1px solid rgba(255, 181, 0, 0.4);
        color: #ff9700;
        /* แดงชัด */
        background-color: #fff;
        border-radius: 8px;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        opacity: 1 !important;
    }

    td .btn-edit:hover {
        background-color: rgba(239, 175, 68, 0.08);
    }


    .add-stock-form {
        display: flex;
        flex-direction: column;
    }

    .add-stock-input {
        margin-bottom: 8px;
        /* ← ถ้าอยาก 4px เปลี่ยนตรงนี้ */
        padding: 10px 14px;
        border-radius: 10px;
        border: none;
        outline: none;
        color: #000 !important;
        background-color: #fff;
        font-size: 14px;
    }

    #new-category-box input,
    #new-category-box textarea {
        width: 100%;
    }


    /* placeholder */
    .add-stock-input::placeholder {
        color: #555;
    }

    /* select option */
    .add-stock-input option {
        color: #000;
        background-color: #fff;
    }

    /* ตอน focus */
    .add-stock-input:focus {
        color: #000;
        outline: none;
    }

    .search-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .preview-20 {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .preview-stock {
        width: auto;
        height: auto;
        min-width: 300px;

        max-width: 380px;
        /* จำกัดความกว้าง */
        max-height: 300px;
        /* จำกัดความสูง */
        object-fit: cover;
        /* ครอปให้สวย */
    }


    @media (max-width: 768px) {
        td .btn-edit {
            -webkit-appearance: none;
            appearance: none;

            padding: 6px 12px;
            border: 1.5px solid rgba(255, 181, 0, 0.6);

            background-color: #fff !important;
            color: #ff9700 !important;
            -webkit-text-fill-color: #ff9700;

            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;

            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        td .btn-edit {
            background-color: rgba(239, 175, 68, 0.08);
        }

        td .btn-delete {
            -webkit-appearance: none;
            appearance: none;

            padding: 6px 12px;
            border: 1.5px solid rgba(239, 68, 68, 0.4);

            background-color: #fff !important;
            color: #dc2626 !important;
            -webkit-text-fill-color: #dc2626;

            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;

            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        td .btn-delete {
            background-color: rgba(239, 68, 68, 0.08);
        }
    }


    .underline-table tbody tr {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .underline-table tbody tr:last-child {
        border-bottom: none;
    }


    /* Custom scrollbar */
    .pickr .pcr-button {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Toggle Switch */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    /* Tab Styles */
    .tab-btn {
        transition: all 0.2s ease;
    }

    .tab-btn.active {
        border-bottom-color: var(--main-color);
        color: var(--main-color);
        background-color: color-mix(in srgb, var(--main-color) 5%, transparent);
    }

    .tab-content {
        animation: fadeIn 0.3s ease;
    }

    .tab-content.hidden {
        display: none;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Transaction Table */
    #transaction-table tbody tr {
        transition: background-color 0.2s ease;
    }

    #transaction-table tbody tr:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }

    /* Product Image in Table */
    .product-img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        object-fit: cover;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }