/* Kho vật tư — CSS SAO NGUYÊN VĂN từ BMS Xốp Mê Linh frontend/styles.css (DDR-031).
   Lấy trọn 124 khối luật có selector .warehouse-* / .xop-warehouse-*, không sửa nội dung.
   Một số luật của bản rút gọn gắn với body[data-business-profile="XOP_ME_LINH"] — thuộc tính đó
   được đặt trên <body> của Zamio để dùng ĐÚNG biến thể 8 cột, xem blank-shell.html.
   Nguồn có var(--danger) không giá trị dự phòng; khai bù ở cuối tệp bằng token --bms-danger. */
/* Material warehouse */
.warehouse-panel{position:relative;min-width:0}

.warehouse-title{align-items:center;margin-bottom:14px;border-bottom:1px solid var(--line)}

.warehouse-section-tabs{display:flex;gap:4px;overflow:auto}

.warehouse-section-tabs button{padding:11px 16px;border:0;border-bottom:3px solid transparent;color:var(--muted);background:transparent;font-weight:800;white-space:nowrap;cursor:pointer}

.warehouse-section-tabs button.active{color:var(--blue);border-bottom-color:var(--blue)}

.warehouse-section-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin:-2px 0 12px}

.warehouse-metrics{margin-bottom:14px}

.warehouse-metrics .metric{pointer-events:none;user-select:none}

.warehouse-card{border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}

.warehouse-toolbar{display:flex;align-items:end;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);background:var(--surface-soft)}

.warehouse-toolbar .inventory-filters{padding:3px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}

.warehouse-toolbar .inventory-filter{min-height:32px;border:0;border-radius:6px;padding:0 13px}

.warehouse-toolbar .inventory-filter.active{box-shadow:0 3px 8px color-mix(in srgb,var(--blue) 18%,transparent)}

.warehouse-table{min-width:1080px}

.warehouse-fg-table{min-width:1380px}

.warehouse-table td small{display:block;margin-top:3px;color:var(--muted)}

.warehouse-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}

.warehouse-panel>.inventory-drawer{position:absolute;inset:0 0 0 auto;width:min(560px,100%);height:100%;z-index:35}

#warehouseMaterialSection .warehouse-table{width:100%;min-width:1540px;table-layout:fixed}

#warehouseMaterialSection .warehouse-table th,#warehouseMaterialSection .warehouse-table td{overflow-wrap:anywhere}

#warehouseMaterialSection .warehouse-table th:nth-child(1){width:7%}

#warehouseMaterialSection .warehouse-table th:nth-child(2){width:17%}

#warehouseMaterialSection .warehouse-table th:nth-child(3){width:6%}

#warehouseMaterialSection .warehouse-table th:nth-child(4){width:4%}

#warehouseMaterialSection .warehouse-table th:nth-child(5){width:7%}

#warehouseMaterialSection .warehouse-table th:nth-child(6){width:7%}

#warehouseMaterialSection .warehouse-table th:nth-child(7),#warehouseMaterialSection .warehouse-table th:nth-child(8),#warehouseMaterialSection .warehouse-table th:nth-child(9),#warehouseMaterialSection .warehouse-table th:nth-child(10){width:5%}

#warehouseMaterialSection .warehouse-table th:nth-child(11){width:8%}

#warehouseMaterialSection .warehouse-table th:nth-child(12){width:10%}

#warehouseMaterialSection .warehouse-table th:nth-child(13){width:7%}

#warehouseMaterialSection .warehouse-table th:nth-child(14){width:292px}

#warehouseMaterialSection .warehouse-table td:nth-child(2)>*,#warehouseMaterialSection .warehouse-table td:nth-child(5),#warehouseMaterialSection .warehouse-table td:nth-child(13){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}

body[data-business-profile="XOP_ME_LINH"] #warehouseMaterialSection.xop-warehouse-simple .warehouse-table{min-width:880px;table-layout:auto}

body[data-business-profile="XOP_ME_LINH"] #warehouseMaterialSection.xop-warehouse-simple .warehouse-table th:nth-child(n){width:auto}

body[data-business-profile="XOP_ME_LINH"] #warehouseMaterialSection.xop-warehouse-simple .warehouse-table th:first-child{width:25%}

body[data-business-profile="XOP_ME_LINH"] #warehouseMaterialSection.xop-warehouse-simple .warehouse-table th:last-child{width:240px}

body[data-business-profile="XOP_ME_LINH"] #warehouseFinishedSection.xop-warehouse-simple .warehouse-fg-table{min-width:940px}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-simple .warehouse-date-filter,body[data-business-profile="XOP_ME_LINH"] #warehouseFinishedSection.xop-warehouse-simple #warehouseFgCreateBtn[hidden],body[data-business-profile="XOP_ME_LINH"] #warehouseFinishedSection.xop-warehouse-simple #warehouseFgImportBtn[hidden]{display:none!important}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-simple .warehouse-table th{white-space:nowrap}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-simple .warehouse-table td{vertical-align:middle}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-simple .inventory-row-actions{flex-wrap:wrap;gap:5px}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-simple .inventory-row-actions .btn{min-width:0;padding:7px 9px;white-space:nowrap}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-quantity>strong,body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-quantity>small{display:block;white-space:nowrap}

body[data-business-profile="XOP_ME_LINH"] .xop-warehouse-blocked{color:var(--danger)!important;font-weight:700}

.xop-warehouse-form-summary{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}

.xop-warehouse-form-summary span,.xop-warehouse-form-summary small{color:var(--muted);font-size:12px}

.xop-warehouse-form-summary strong{font-size:15px}

.warehouse-toolbar-fields{display:flex;align-items:end;gap:10px}

.warehouse-toolbar-fields>label{display:grid;gap:4px;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}

.warehouse-toolbar-fields select{min-width:150px;min-height:38px;padding:7px 30px 7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink)}

.warehouse-reference-form{display:grid;gap:10px;margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--surface-soft)}

.warehouse-reference-form h4{margin:0;color:var(--ink)}

.warehouse-reference-form>label{display:grid;gap:5px;color:var(--muted);font-size:11px;font-weight:700}

.warehouse-reference-form textarea{width:100%;resize:vertical}

.warehouse-image-preview{display:flex;align-items:center;gap:10px}

.warehouse-image-preview img{width:88px;height:68px;object-fit:cover;border:1px solid var(--line);border-radius:7px;background:var(--surface)}

.warehouse-image-preview span{color:var(--muted);font-size:11px}

.warehouse-product-link{display:inline-flex;align-items:center;gap:4px;color:var(--blue);font-size:12px;font-weight:800;text-decoration:none}

.warehouse-product-link:hover{text-decoration:underline}

.warehouse-material-cell{display:grid;grid-template-columns:minmax(120px,1fr) auto;align-items:start;gap:8px;min-width:240px}

.warehouse-material-reference{display:flex;align-items:flex-start;gap:7px}

.warehouse-material-reference>div{display:grid;gap:3px;max-width:180px}

.warehouse-material-image{display:block;width:76px;height:42px}

.warehouse-material-thumb{width:76px;height:42px;flex:0 0 76px;object-fit:cover;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft)}

.warehouse-material-thumb.placeholder{display:flex;align-items:center;justify-content:center;gap:5px;padding:5px;color:var(--muted);font-size:10px;line-height:1.1;text-align:left}

.warehouse-material-thumb.placeholder[hidden]{display:none}

.warehouse-material-thumb.placeholder svg{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

.warehouse-material-thumb.placeholder small{color:inherit;font-size:9px;font-weight:700}

.warehouse-purchase-note{display:-webkit-box!important;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.35}

.warehouse-purchase-note strong{color:var(--ink)}

.warehouse-import-dialog{width:min(760px,calc(100vw - 28px));max-width:none;max-height:min(90dvh,820px);padding:0;overflow:auto;border:1px solid var(--line);border-radius:14px;color:var(--ink);background:var(--surface)}

.warehouse-import-dialog::backdrop{background:rgba(15,29,46,.5);backdrop-filter:blur(2px)}

.warehouse-import-dialog>header{position:sticky;z-index:2;top:0;display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line);background:var(--surface)}

.warehouse-import-dialog h3{margin:3px 0 0;color:var(--ink-strong)}

.warehouse-import-body{display:grid;gap:14px;padding:18px}

.warehouse-import-dropzone{display:grid;place-items:center;gap:5px;min-height:150px;padding:20px;border:2px dashed #8bb7e6;border-radius:12px;background:var(--surface-soft);text-align:center;cursor:pointer;transition:.18s ease}

.warehouse-import-dropzone:hover,.warehouse-import-dropzone.dragging,.warehouse-import-dropzone:focus-visible{border-color:var(--brand);background:color-mix(in srgb,var(--brand-soft) 70%,var(--surface));outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}

.warehouse-import-dropzone strong{color:var(--brand);font-size:16px}

.warehouse-import-dropzone span,.warehouse-import-dropzone small{color:var(--muted)}

.warehouse-import-file{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}

.warehouse-import-file[hidden],.warehouse-import-preview[hidden]{display:none!important}

.warehouse-import-file strong,.warehouse-import-file small{display:block}

.warehouse-import-file small{margin-top:3px;color:var(--muted)}

.warehouse-import-help{position:relative;padding:13px 160px 13px 15px;border:1px solid var(--line);border-radius:10px}

.warehouse-import-help p{margin:0}

.warehouse-import-help ol{margin:7px 0 0;padding-left:20px;color:var(--muted);line-height:1.55}

.warehouse-import-help .btn{position:absolute;right:13px;top:13px}

.warehouse-import-preview{display:grid;gap:12px}

.warehouse-import-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}

.warehouse-import-stat{padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}

.warehouse-import-stat span,.warehouse-import-stat strong{display:block}

.warehouse-import-stat span{color:var(--muted);font-size:11px}

.warehouse-import-stat strong{margin-top:4px;font-size:18px}

.warehouse-import-messages{max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:9px}

.warehouse-import-message{padding:8px 10px;border-bottom:1px solid var(--line);font-size:12px}

.warehouse-import-message:last-child{border-bottom:0}

.warehouse-import-message.error{color:#a61b1b;background:#fff3f3}

.warehouse-import-message.warning{color:#7a4a00;background:#fff9e9}

.warehouse-import-error{min-height:18px;margin:0;color:#b91c1c;font-weight:700}

.warehouse-import-dialog>footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;padding:13px 18px;border-top:1px solid var(--line);background:var(--surface)}

.warehouse-reserved-value{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap}

.warehouse-reservation-button{display:inline-grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid #b9d5f7;border-radius:7px;color:#0757b8;background:#eff6ff;font-size:14px;line-height:1;cursor:pointer}

.warehouse-reservation-button:hover,.warehouse-reservation-button:focus-visible{border-color:#0757b8;background:#dbeafe;outline:2px solid rgba(7,87,184,.18);outline-offset:1px}

/* Warehouse delete with reservations modal */
.warehouse-delete-reservations-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
  padding: 16px;
}

.warehouse-delete-card {
  background: var(--surface,#fff); border-radius: 10px;
  max-width: 580px; width: 100%;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.warehouse-delete-card header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 0;
}

.warehouse-delete-card header h3 {
  margin: 0; font-size: 17px; color: var(--danger,#dc2626);
}

.warehouse-delete-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; padding: 4px 8px; color: var(--text-muted,#666);
  line-height: 1;
}

.warehouse-delete-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

.warehouse-delete-info {
  width: 100%; border-collapse: collapse;
  margin-bottom: 12px;
}

.warehouse-delete-info td {
  padding: 5px 8px; font-size: 13px;
  vertical-align: top;
}

.warehouse-delete-info td:first-child {
  width: 40%; color: var(--text-muted,#666);
}

.warehouse-delete-projects {
  margin-bottom: 12px;
  font-size: 13px;
}

.warehouse-delete-projects summary {
  cursor: pointer; font-weight: 600;
  padding: 4px 0; color: var(--accent,#1e3a5f);
}

.warehouse-delete-projects ul {
  margin: 6px 0 0 16px; padding: 0;
  list-style: disc;
}

.warehouse-delete-projects li {
  padding: 2px 0; font-size: 12px;
}

.warehouse-delete-reason {
  display: block; margin-top: 12px;
}

.warehouse-delete-reason span {
  display: block; font-weight: 600; font-size: 13px;
  margin-bottom: 4px;
}

.warehouse-delete-reason textarea {
  width: 100%; min-height: 60px;
  padding: 8px 10px; border: 1px solid var(--border,#ccc);
  border-radius: 6px; font-family: inherit; font-size: 13px;
  resize: vertical; box-sizing: border-box;
}

.warehouse-delete-reason textarea:focus {
  outline: 2px solid var(--accent,#1e3a5f); outline-offset: -1px;
}

.warehouse-delete-card footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-light,#eee);
}

.warehouse-card .warehouse-toolbar-fields{margin-left:auto}

.warehouse-card .warehouse-toolbar-fields>label{display:grid;gap:5px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase}

.warehouse-date-filter input,.warehouse-card .inventory-search input{box-sizing:border-box;width:220px;min-width:220px;height:38px;min-height:38px;padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink)}
/* Ba biến của nguồn không có trong cascade Zamio — ánh xạ sang token --bms-* tương đương. */
:root { --accent: var(--bms-primary); --border-light: var(--bms-border); --danger: var(--bms-danger); }
