/* ================================================= */
/* DONXUAT BAR – donxuat.css                          */
/* ================================================= */

/* ================================================= */
/* ĐƠN XUẤT BAR (sticky top)                          */
/* ================================================= */

#donxuat-bar {
  position: sticky;
  top: 0;
  z-index: 100;

  min-height: var(--dx-min);
  max-height: var(--dx-min);
  height: auto;

  display: flex;
  flex-direction: column;

  padding: 12px;
  background: #ffffff;
  overflow: hidden;
}

/* Fade đáy đơn xuất */
#donxuat-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(30, 136, 229, 0) 0%,
    rgba(30, 136, 229, 0.35) 50%,
    rgba(30, 136, 229, 0.65) 100%
  );
}

/* ================================================= */
/* LAYOUT 7 / 3                                      */
/* ================================================= */

#donxuat-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 12px;
}

/* ================================================= */
/* LEFT – TABLE ĐƠN XUẤT                              */
/* ================================================= */

#donxuat-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

#donxuat-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Table */
#donxuat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
  background: #ffffff;
}

#donxuat-table th,
#donxuat-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#donxuat-table thead th {
  background: #fafafa;
  font-weight: 700;
}

/* trạng thái */
#donxuat-table tr.selected {
  background-color: #ffe8a3;
}

#donxuat-table tr.sl-editing {
  background: #eef6ff;
}

#donxuat-table td.dx-sl.sl-editing {
  background: #dbeafe;
  font-weight: 600;
}

/* ================================================= */
/* RIGHT – HEADER / TOOL                              */
/* ================================================= */

#donxuat-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

#donxuat-right * {
  min-width: 0;
}

/* ================================================= */
/* HEADER FIELDS                                     */
/* ================================================= */

#donxuat-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dx-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dx-field {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f5f5;
}

.dx-field label {
  flex: 0 0 auto;
  font-size: 14px;
  color: #666;
}

.dx-field span,
.dx-field input {
  flex: 1;
  width: 100%;
  text-align: center;

  font-size: 22px;
  font-weight: 700;
}

.dx-field input {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 6px;
}

.dx-field.total {
  background: #e3f2fd;
}

/* ================================================= */
/* TRẠNG THÁI MỞ / ĐÓNG                              */
/* ================================================= */

body.dx-open #donxuat-bar {
  max-height: var(--dx-max);
}

/* ================================================= */
/* 打码 – CONTROLS                                   */
/* ================================================= */

.bm-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#bm-filter,
#bm-select {
  height: 38px;
  padding: 6px 10px;

  font-size: 18px;
  font-weight: 600;

  border-radius: 8px;
  border: 1px solid #cfd4dc;
  background: #fafafa;
  outline: none;
}

#bm-filter:focus,
#bm-select:focus {
  border-color: #1e88e5;
  background: #ffffff;
}

/* ================================================= */
/* ACTION BUTTONS (打码)                              */
/* ================================================= */

.bm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bm-actions button {
  height: 40px;
  font-size: 15px;
  font-weight: 700;

  border-radius: 10px;
  border: none;
  cursor: pointer;

  transition: background 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}

/* Ghi chú */
#btn-writeghichu {
  background: #1e88e5;
  color: #ffffff;
}

#btn-writeghichu:hover {
  background: #1565c0;
}

#btn-writeghichu:active {
  transform: scale(0.97);
}

/* Xóa */
#btn-xoa1dong {
  background: #f5f5f5;
  color: #c62828;
  border: 1px solid #e0e0e0;
}

#btn-xoa1dong:hover {
  background: #fdecea;
}

#btn-xoa1dong:active {
  background: #f8d7da;
  transform: scale(0.97);
}
