
/* =========================================================
   BARANG MASUK & BARANG KELUAR
   PREFIX: bkm-
========================================================= */

/* =========================
   1. MODAL LAYOUT
========================= */

.bkm-dialog {
  width: calc(100% - 32px);
  max-width: 720px;
  max-height: calc(100vh - 48px);
}

.bkm-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bkm-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bkm-section + .bkm-section {
  padding-top: 20px;
  border-top: 1px solid #e9edf2;
}

/* =========================
   2. SECTION HEADING
========================= */

.bkm-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bkm-section-heading h4 {
  margin: 0;
  color: #172b4d;
  font-size: 15px;
  font-weight: 700;
}

.bkm-section-heading p {
  margin: 4px 0 0;
  color: #8491a5;
  font-size: 12px;
  line-height: 1.5;
}

/* =========================
   3. TRANSACTION FORM
========================= */

.bkm-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bkm-full {
  grid-column: 1 / -1;
}

/* =========================
   4. ITEM LIST
========================= */

.bkm-items-heading {
  align-items: center;
}

.bkm-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bkm-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* =========================
   5. ITEM CARD
========================= */

.bkm-item-card {
  padding: 16px;
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  background: #fff;
}

.bkm-item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bkm-item-number {
  font-size: 13px;
  font-weight: 700;
  color: #344563;
}

.bkm-remove-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #fff1f0;
  color: #dc3545;
  cursor: pointer;
}

.bkm-remove-item:hover {
  background: #ffe1df;
}

.bkm-item-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bkm-item-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* =========================
   6. SEARCH BARANG
========================= */

.bkm-search-wrapper,
.bkm-batch-wrapper {
  position: relative;
  width: 100%;
}

.bkm-item-search,
.bkm-batch-search {
  width: 100%;
  padding-right: 38px;
  cursor: text;
}

.bkm-item-results,
.bkm-batch-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1100;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(23, 43, 77, 0.12);
}

.bkm-item-option,
.bkm-batch-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.bkm-item-option:hover,
.bkm-batch-option:hover {
  background: #f1f5f9;
}

.bkm-option-sku {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.bkm-option-name {
  color: #172b4d;
  font-size: 13px;
  font-weight: 600;
}

.bkm-no-result {
  padding: 16px 12px;
  color: #8491a5;
  font-size: 12px;
  text-align: center;
}

/* =========================
   7. SELECTED ITEM & BATCH
========================= */

.bkm-selected-item {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.bkm-batch-option span {
  color: #172b4d;
  font-size: 13px;
  font-weight: 600;
}

.bkm-batch-option small {
  color: #8491a5;
  font-size: 11px;
}

/* =========================
   8. SORT SELECT (BARANG, BARANG MASUK, BARANG KELUAR)
========================= */

#sortBarang,
#sortBarangMasuk,
#sortBarangKeluar {
  min-width: 120px;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#sortBarang:focus,
#sortBarangMasuk:focus,
#sortBarangKeluar:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#sortBarang option,
#sortBarangMasuk option,
#sortBarangKeluar option {
  background: var(--bg-card);
  color: var(--text-main);
}