/* ============================================================================
   NHẬP EXCEL — hộp chọn tệp · chọn sheet · dòng tiêu đề · ghép cột · xem trước (web/nhap-xuat.js)
   Tiền tố nx-. Dùng biến màu, bo góc, cỡ chữ của app.css để cùng mật độ với các màn khác.
   ========================================================================== */
/* .che là lưới cột "auto": cột nở theo bề rộng tối đa của nội dung (dòng mô tả dài, hàng chip sheet) nên hộp
   width:100% bị tính theo cột đã nở — rộng 750px trên màn 375px. Ghim cột bằng đúng bề ngang màn hình. */
.che.nx-che { grid-template-columns: minmax(0, 1fr); }
/* rộng như .hop.rong; bước chọn tệp chỉ cao vừa nội dung, bước ghép cột giữ cao cố định của .rong để bảng xem trước
   đổi số cột / số dòng không làm cả hộp co giãn theo */
.hop.rong.nx-hop.nx-buoc1 { height: auto; }
.nx-hop .hop-dau { padding: 12px 16px; }
.nx-hop .hop-than { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; line-height: 1.45; }
.nx-hop .hop-chan { padding: 10px 16px; align-items: center; gap: 8px; }
.nx-mo-ta { margin: 0; font-size: 12.5px; color: var(--nhat); }
.nx-hop .canh-bao { margin: 0; padding: 7px 12px; }

/* bước 1: ô thả tệp */
.nx-tha { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; text-align: center;
  border: 1.5px dashed var(--vien-2); border-radius: var(--bo); background: var(--mat-2); transition: border-color .12s, background .12s; }
.nx-tha b { font-size: 14px; color: var(--chu); }
.nx-tha .nut { margin: 2px 0 4px; }
.nx-bieu { width: 46px; height: 46px; margin-bottom: 4px; border-radius: 12px; display: grid; place-items: center; background: var(--chinh-nhat); color: var(--chinh); }
.nx-keo .nx-tha { border-color: var(--chinh); background: var(--chinh-nhat); }
.nx-keo .nx-khung { border-color: var(--chinh); }
.nx-dang { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 46px 16px; color: var(--nhat); text-align: center; }
.nx-dang b { color: var(--chu); word-break: break-all; }

/* bước 2: tệp + sheet */
.nx-tep { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nx-tep > .ic { color: var(--xanh); }
.nx-tep b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-tep .nut { margin-left: auto; flex: none; }
.nx-ds-trang { display: flex; flex-wrap: wrap; gap: 6px; }
.nx-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 10px; border: 1px solid var(--vien-2); border-radius: 999px;
  background: var(--mat); font: inherit; font-size: 12.5px; color: var(--chu-2); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.nx-chip:hover { border-color: #9fb0c6; }
.nx-chip:focus-visible { outline: 3px solid rgba(37,99,235,.3); outline-offset: 1px; }
.nx-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nx-chip .nx-dem { flex: none; color: var(--nhat); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nx-chip .nhan { flex: none; padding: 0 6px; font-size: 11px; line-height: 16px; }
.nx-chip.on { border-color: var(--chinh); background: var(--chinh-nhat); color: var(--chinh); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.nx-chip.on .nx-dem { color: var(--chinh); }
.nx-chip:disabled { opacity: .5; cursor: not-allowed; }

/* dòng tiêu đề + ghép cột */
.nx-khung { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--vien); border-radius: var(--bo); background: var(--mat-2); }
.nx-td { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.nx-td > label { font-size: 12.5px; font-weight: 600; color: var(--chu); }
.nx-td .nx-goi-y { font-size: 12px; }
.nx-so { display: inline-flex; align-items: center; }
.nx-so .nut { border-radius: 0; font-size: 15px; }
.nx-so .nut:first-child { border-radius: var(--bo-nho) 0 0 var(--bo-nho); }
.nx-so .nut:last-child { border-radius: 0 var(--bo-nho) var(--bo-nho) 0; }
.nx-so input { width: 52px; height: 26px; margin: 0 -1px; padding: 0 4px; border: 1px solid var(--vien-2); background: var(--mat); text-align: center;
  font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.nx-so input::-webkit-outer-spin-button, .nx-so input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nx-so input:focus { position: relative; z-index: 1; outline: none; border-color: var(--chinh); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.nx-lien { border: 0; padding: 0; background: none; font: inherit; color: var(--chinh); cursor: pointer; }
.nx-lien:hover { text-decoration: underline; }
.nx-ghep { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px 12px; }
.nx-o { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nx-o > span { font-size: 11.5px; font-weight: 500; color: var(--nhat); }
.nx-o > span i { font-style: normal; font-weight: 700; color: var(--do); }
.nx-o select { width: 100%; min-width: 0; height: 30px; padding: 3px 8px; border: 1px solid var(--vien-2); border-radius: var(--bo-nho); background: var(--mat); color: var(--mo); }
.nx-o.co select { color: var(--chu); }
.nx-o select option { color: var(--chu); }
.nx-o select:focus { outline: none; border-color: var(--chinh); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.nx-o.thieu > span { color: var(--do); }
.nx-o.thieu select { border-color: #f1a7a3; background: var(--do-nhat); color: var(--do); }

/* xem trước */
.nx-xem { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nx-xem-dau { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.nx-xem-dau > b { font-size: 13px; color: var(--chu); }
.nx-x1000 { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border: 1px solid #f3d9a4; border-radius: var(--bo-nho);
  background: var(--vang-nhat); color: #7c4a03; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.nx-x1000 input { width: 15px; height: 15px; margin: 0; accent-color: var(--vang); cursor: pointer; }
.nx-cuon { border: 1px solid var(--vien); border-radius: var(--bo-nho); background: var(--mat); }
.nx-bang th, .nx-bang td { padding: 4px 10px; white-space: nowrap; }
.nx-bang td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.nx-bang th .nx-cot { margin-left: 2px; font-weight: 500; color: var(--mo); }
.nx-bang td.nx-r { color: var(--nhat); font-size: 12px; font-variant-numeric: tabular-nums; }
.nx-bang td.nx-r .nhan { margin-left: 4px; padding: 0 7px; font-size: 11px; line-height: 17px; }
.nx-bang tr.nx-bo td { color: var(--mo); background: var(--mat-2); }
.nx-bang tr.nx-bo:hover { background: transparent; }
.nx-bang td.nx-loi { background: var(--do-nhat); color: var(--do); font-weight: 500; }
.nx-bang td.nx-nghi { background: var(--vang-nhat); color: var(--vang); font-weight: 600; }
.nx-trong { padding: 18px 12px; text-align: center; color: var(--nhat); border: 1px dashed var(--vien-2); border-radius: var(--bo-nho); }

/* chân hộp: tóm tắt + nút */
.nx-tom { flex: 1 1 280px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--nhat); }
.nx-tom b { color: var(--chu); font-variant-numeric: tabular-nums; }
.nx-tom .nx-do { color: var(--do); font-weight: 500; }
.nx-tom .nx-cham { color: var(--mo); }

@media (max-width: 560px) {
  .che.nx-che { padding: 8px; }
  .hop.rong.nx-hop { height: calc(100vh - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .hop.rong.nx-hop.nx-buoc1 { height: auto; }
  .nx-hop .hop-dau, .nx-hop .hop-than, .nx-hop .hop-chan { padding-left: 12px; padding-right: 12px; }
  .nx-tom { flex-basis: 100%; }
  .nx-hop .hop-chan .nut { flex: 1 1 0; justify-content: center; }
  .nx-ghep { grid-template-columns: 1fr; }
  .nx-x1000 { margin-left: 0; }
  .nx-chip b { max-width: 160px; }
}
