.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal-box {
    width: 520px;
    max-width: 95%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
}

.modal-header button {
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.modal-body input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.hasil-cari-produk {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.hasil-produk-item {
    padding: 12px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
}

.hasil-produk-item:hover {
    background: #f5f5f5;
}

.produk-kode {
    font-weight: bold;
}

.produk-nama {
    margin-top: 3px;
}

.produk-info {
    margin-top: 4px;
    font-size: 12px;
    color: #777;
}

.hasil-kosong {
    padding: 15px;
    text-align: center;
    color: #777;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.produk-table-wrapper {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: auto;
    max-height: 350px;
}

.produk-pilih-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.produk-pilih-table th {
    background: #f1f5f9;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-weight: 600;
}

.produk-pilih-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.produk-pilih-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.produk-pilih-table tbody tr:hover {
    background: #eef6ff;
}

.produk-loading {
    text-align: center;
    padding: 25px !important;
    color: #888;
}

.modal-subtitle {
    font-size: 13px;
    color: #78909c;
    margin-top: 3px;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 25px;
    cursor: pointer;
    color: #78909c;
}

/* =====================================================
   MODAL PILIH PRODUK PEMBELIAN
   ===================================================== */

/* =====================================================
   MODAL PILIH PRODUK - FIX POSITION
   ===================================================== */

/* =========================================
   MODAL PILIH PRODUK
   ========================================= */

#modalPilihProduk {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 9999;

    /* Menutup form di belakang */
    background: rgba(0, 0, 0, 0.35);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}


/* BOX MODAL */

#modalPilihProduk .modal-box {
    width: 90%;
    max-width: 900px;

    max-height: 90vh;

    display: flex;
    flex-direction: column;

    position: relative;
    z-index: 10000;

    background: white;
}


/* AREA TABEL */

#modalPilihProduk .produk-table-wrapper {
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: auto;
}


/* HEADER TABEL TETAP TERLIHAT */

#modalPilihProduk .produk-pilih-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* =========================================
   STOCK PAGE
========================================= */

.stock-page {
    background: #f7f8fa;
    padding: 24px 28px;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}


/* =========================================
   HEADER
========================================= */

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #ffffff;

    padding: 18px 20px;
    margin-bottom: 22px;

    border: 1px solid #e1e4e8;
    border-radius: 8px;

    box-sizing: border-box;
}

.stock-title-area h2 {
    margin: 0;

    font-size: 24px;
    font-weight: 600;

    color: #222;
}

.stock-subtitle {
    margin-top: 5px;

    font-size: 13px;
    color: #777;
}


/* =========================================
   ACTION BUTTON
========================================= */

.stock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-actions button {
    height: 36px;

    padding: 0 14px;

    border: 1px solid #d5d8dc;
    border-radius: 6px;

    background: #ffffff;

    color: #333;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition: all 0.15s ease;
}

.stock-actions button:hover {
    background: #f1f3f5;
    border-color: #bfc4c9;
}

.btn-stock-adjust {
    background: #f8f9fa !important;
}

.btn-stock-print {
    background: #ffffff !important;
}

.btn-stock-back {
    background: #ffffff !important;
}


/* =========================================
   SECTION
========================================= */

.stock-section {
    margin-bottom: 24px;
}

.stock-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
}

.stock-section-title {
    font-size: 17px;
    font-weight: 600;

    color: #252525;
}

.stock-section-desc {
    margin-top: 3px;

    font-size: 12px;
    color: #888;
}


/* =========================================
   TABLE CARD
========================================= */

.stock-table-card {
    background: #ffffff;

    border: 1px solid #e1e4e8;
    border-radius: 8px;

    overflow: hidden;
}

.stock-table-wrapper {
    width: 100%;
    overflow-x: auto;
}


/* =========================================
   TABLE
========================================= */

.stock-table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;

    font-size: 13px;
}

.stock-table thead {
    background: #f5f6f7;
}

.stock-table th {
    height: 42px;

    padding: 0 12px;

    border-bottom: 1px solid #dfe2e5;

    color: #555;

    font-size: 12px;
    font-weight: 600;

    text-align: left;

    white-space: nowrap;
}

.stock-table td {
    height: 42px;

    padding: 0 12px;

    border-bottom: 1px solid #eeeeee;

    color: #333;

    vertical-align: middle;
}

.stock-table tbody tr:last-child td {
    border-bottom: none;
}

.stock-table tbody tr {
    transition: background 0.12s ease;
}

.stock-table tbody tr:hover {
    background: #f8fafb;
}


/* =========================================
   COLUMN
========================================= */

.col-no {
    width: 55px;
    text-align: center !important;
}

.col-aksi {
    width: 90px;
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}


/* =========================================
   EMPTY
========================================= */

.stock-empty {
    text-align: center !important;

    color: #999 !important;

    padding: 35px 10px !important;

    font-size: 13px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 800px) {

    .stock-page {
        padding: 15px;
    }

    .stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .stock-actions {
        width: 100%;
        flex-wrap: wrap;
    }

}