.admin-page { background: #f3f6fb; }
.admin-header { position: sticky; top: 0; z-index: 120; box-shadow: 0 1px 0 rgba(8,28,73,.08); }
.admin-main { padding: 32px 0 76px; }

.admin-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 20px; padding: 16px 18px; border: 1px solid #eadb8a; border-radius: 14px;
  color: #5e4a00; background: #fff7d7;
}
.admin-notice > div { display: grid; gap: 5px; }
.admin-notice strong { font-size: 14px; }
.admin-notice span { font-size: 12px; line-height: 1.55; }
.admin-save-state { flex: 0 0 auto; padding: 7px 10px; border-radius: 20px; color: #0f6b42; background: #e8f7ef; font-weight: 700; }
.admin-save-state.saving { color: #7a5b00; background: #fff1b8; }
.admin-save-state.error { color: #a0212e; background: #ffe3e7; }

.admin-kpis { display: grid; grid-template-columns: repeat(5,1fr); gap: 13px; margin-bottom: 20px; }
.admin-kpis article { min-height: 126px; padding: 18px; border: 1px solid var(--line-200); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-kpis span { display: block; color: var(--muted-700); font-size: 12px; font-weight: 650; }
.admin-kpis strong { display: block; margin: 5px 0 1px; color: var(--navy-950); font-size: 31px; line-height: 1.15; }
.admin-kpis small { color: var(--muted-500); font-size: 10px; }

.admin-card { overflow: hidden; border: 1px solid var(--line-200); border-radius: 19px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line-200); }
.admin-card-head h1 { margin: 4px 0 2px; color: var(--navy-950); font-size: 27px; line-height: 1.2; }
.admin-card-head p { margin: 0; color: var(--muted-700); font-size: 12px; }
.admin-toolbar { display: grid; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-200); background: #fbfcff; }
.admin-search-row { display: grid; grid-template-columns: minmax(260px,1.8fr) repeat(4,minmax(150px,.8fr)); gap: 9px; }
.admin-search-box { position: relative; }
.admin-search-box > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-500); font-size: 18px; }
.admin-search-box input { padding-left: 38px !important; }
.admin-search-row input, .admin-search-row select, .admin-pagination select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d5deea; border-radius: 10px; color: var(--navy-950); background: #fff; font-size: 12px; outline: none;
}
.admin-search-row input:focus, .admin-search-row select:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(28,67,142,.1); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions .btn { min-height: 40px; font-size: 11px; }

.bulk-toolbar { display: none; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 18px; color: #fff; background: var(--navy-900); }
.bulk-toolbar.open { display: flex; }
.bulk-toolbar strong { font-size: 12px; }
.bulk-toolbar > div { display: flex; flex-wrap: wrap; gap: 7px; }
.bulk-toolbar button { min-height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,.26); border-radius: 8px; color: #fff; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 700; }
.bulk-toolbar button:hover { background: rgba(255,255,255,.16); }

.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-200); text-align: left; vertical-align: middle; font-size: 11px; }
.admin-table th { position: sticky; top: 0; z-index: 2; color: var(--navy-950); background: #f7f9fd; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.admin-table tbody tr:hover { background: #fbfcff; }
.admin-table tbody tr.selected { background: #f1f5ff; }
.check-column { width: 40px; text-align: center !important; }
.check-column input, .row-check { width: 16px; height: 16px; accent-color: var(--navy-800); }
.admin-table img { width: 62px; height: 62px; padding: 3px; object-fit: contain; border: 1px solid #e5eaf1; border-radius: 10px; background: var(--surface-100); }
.admin-product-name { min-width: 270px; display: grid; gap: 3px; }
.admin-product-name strong { color: var(--navy-950); font-size: 12px; line-height: 1.4; }
.admin-product-name small { color: var(--muted-700); font-size: 10px; }
.admin-category-cell { min-width: 185px; display: grid; gap: 2px; }
.admin-category-cell strong { color: var(--navy-950); font-size: 11px; }
.admin-category-cell small { color: var(--muted-700); font-size: 10px; }
.admin-price { color: var(--red-600); font-size: 12px; font-weight: 800; }
.stock-low { color: #b42318; font-weight: 800; }
.status-badge { display: inline-flex; min-width: 78px; justify-content: center; padding: 5px 8px; border-radius: 20px; color: #0f6b42; background: #e8f7ef; font-size: 9px; font-weight: 750; }
.status-badge.warning { color: #7a5b00; background: #fff6cf; }
.status-badge.off { color: #667085; background: #eef1f5; }
.featured-toggle { min-height: 31px; padding: 0 9px; border: 1px solid #d5deea; border-radius: 18px; color: var(--muted-700); background: #fff; font-size: 9px; font-weight: 750; }
.featured-toggle.active { color: #5f4900; border-color: #ead06b; background: #fff4bc; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 194px; }
.admin-row-actions button { min-height: 32px; padding: 0 9px; border: 1px solid #d5deea; border-radius: 8px; color: var(--navy-950); background: #fff; font-size: 9px; font-weight: 750; }
.admin-row-actions button:hover { border-color: var(--navy-700); background: #f4f7fd; }
.admin-row-actions .danger { color: #a0212e; }
.empty-admin { padding: 45px !important; color: var(--muted-700); text-align: center !important; }

.admin-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; border-top: 1px solid var(--line-200); background: #fbfcff; }
.admin-pagination label { display: flex; align-items: center; gap: 8px; color: var(--muted-700); font-size: 11px; }
.admin-pagination select { width: 72px; min-height: 36px; }
.admin-pagination > div { display: flex; align-items: center; gap: 9px; }
.admin-pagination button { min-height: 36px; padding: 0 12px; border: 1px solid #d5deea; border-radius: 9px; color: var(--navy-950); background: #fff; font-size: 10px; font-weight: 750; }
.admin-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.admin-pagination span { min-width: 92px; color: var(--muted-700); font-size: 11px; text-align: center; }

.admin-editor-panel { width: min(900px,100%); padding: 28px; }
.editor-head h2 { margin: 6px 0 4px; color: var(--navy-950); font-size: 30px; }
.editor-head p { margin: 0 0 19px; color: var(--muted-700); font-size: 12px; }
.image-uploader { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; margin-bottom: 18px; padding: 15px; border: 1.5px dashed #c8d3e4; border-radius: 15px; background: #f9fbff; transition: border-color .18s ease, background .18s ease; }
.image-uploader.dragover { border-color: var(--navy-700); background: #eef4ff; }
.editor-preview { width: 160px; height: 160px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-200); border-radius: 14px; background: #fff; }
.editor-preview img { width: 100%; height: 100%; padding: 6px; object-fit: contain; }
.image-uploader-copy { display: grid; gap: 6px; }
.image-uploader-copy strong { color: var(--navy-950); font-size: 14px; }
.image-uploader-copy span { color: var(--navy-700); font-size: 11px; font-weight: 650; word-break: break-word; }
.image-uploader-copy small { max-width: 560px; color: var(--muted-700); font-size: 10px; line-height: 1.55; }
.image-uploader-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.image-uploader-actions .btn { min-height: 39px; font-size: 10px; }
.gallery-uploader { display:grid; gap:13px; margin-bottom:18px; padding:16px; border:1px solid #d8e2ef; border-radius:15px; background:linear-gradient(135deg,#fff,#f6f9ff); transition:border-color .18s ease,background .18s ease; }
.gallery-uploader.dragover { border-color:var(--navy-700); background:#eef4ff; }
.gallery-uploader-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.gallery-uploader-head>div { display:grid; gap:4px; }
.gallery-uploader-head strong { color:var(--navy-950); font-size:14px; }
.gallery-uploader-head small { color:var(--muted-700); font-size:10px; line-height:1.5; }
.gallery-uploader-head>span { flex:0 0 auto; padding:5px 9px; border:1px solid #c9d9ec; border-radius:20px; color:#315184; background:#fff; font-size:10px; font-weight:800; }
.gallery-editor-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; min-height:110px; }
.gallery-editor-empty { grid-column:1/-1; min-height:110px; display:grid; place-items:center; padding:18px; border:1px dashed #c8d3e4; border-radius:12px; color:var(--muted-700); background:rgba(255,255,255,.72); font-size:10px; text-align:center; }
.gallery-editor-item { position:relative; aspect-ratio:1/1; display:grid; place-items:center; overflow:hidden; border:1px solid #dde5f0; border-radius:12px; background:#fff; box-shadow:0 3px 10px rgba(7,23,62,.05); }
.gallery-editor-item img { width:100%; height:100%; object-fit:contain; }
.gallery-editor-item span { position:absolute; left:6px; bottom:6px; padding:3px 6px; border-radius:8px; color:#fff; background:rgba(7,23,62,.78); font-size:8px; font-weight:800; backdrop-filter:blur(5px); }
.gallery-editor-remove { position:absolute; top:5px; right:5px; width:27px; height:27px; display:grid; place-items:center; padding:0; border:1px solid rgba(255,255,255,.75); border-radius:8px; color:#fff; background:rgba(155,31,48,.88); box-shadow:0 4px 12px rgba(7,23,62,.14); font-size:16px; line-height:1; cursor:pointer; }
.gallery-editor-remove:hover { background:#a0212e; }
.gallery-editor-remove:focus-visible { outline:3px solid rgba(37,139,235,.3); outline-offset:2px; }
.gallery-uploader-actions { display:flex; flex-wrap:wrap; gap:8px; }
.gallery-uploader-actions .btn { min-height:39px; font-size:10px; }
.editor-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.editor-grid label { display: grid; gap: 6px; color: var(--navy-950); font-size: 11px; font-weight: 750; }
.editor-grid label em { color: var(--red-600); font-style: normal; }
.editor-grid label.wide { grid-column: 1 / -1; }
.editor-grid input, .editor-grid select, .editor-grid textarea { width: 100%; padding: 11px 12px; border: 1px solid #d5deea; border-radius: 10px; color: var(--ink-950); outline: 0; background: #fff; font-size: 12px; }
.editor-grid input, .editor-grid select { min-height: 44px; }
.editor-grid textarea { resize: vertical; line-height: 1.55; }
.editor-grid input:focus, .editor-grid select:focus, .editor-grid textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(28,67,142,.1); }
.optional-fields { margin-top: 15px; border: 1px solid var(--line-200); border-radius: 12px; background: #fbfcff; }
.optional-fields summary { padding: 13px 15px; color: var(--navy-950); cursor: pointer; font-size: 11px; font-weight: 800; }
.optional-fields summary span { color: var(--muted-700); font-weight: 500; }
.optional-grid { padding: 0 15px 15px; }
.editor-actions { position: sticky; bottom: -28px; display: flex; justify-content: end; gap: 9px; margin: 20px -28px -28px; padding: 15px 28px; border-top: 1px solid var(--line-200); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }

@media(max-width:1180px){
  .admin-kpis{grid-template-columns:repeat(3,1fr)}
  .admin-search-row{grid-template-columns:1.5fr repeat(2,1fr)}
}
@media(max-width:820px){
  .admin-notice{align-items:flex-start;flex-direction:column}
  .admin-card-head{align-items:flex-start;flex-direction:column}
  .admin-search-row{grid-template-columns:1fr 1fr}
  .admin-search-box{grid-column:1/-1}
  .bulk-toolbar{align-items:flex-start;flex-direction:column}
}
@media(max-width:650px){
  .admin-main{padding-top:20px}
  .admin-kpis{grid-template-columns:1fr 1fr}
  .admin-kpis article{min-height:110px;padding:14px}
  .admin-kpis strong{font-size:27px}
  .admin-search-row{grid-template-columns:1fr}
  .admin-search-box{grid-column:auto}
  .admin-actions{display:grid;grid-template-columns:1fr 1fr}
  .admin-actions .btn{width:100%}
  .admin-pagination{align-items:flex-start;flex-direction:column}
  .image-uploader{grid-template-columns:1fr}
  .gallery-uploader-head{align-items:flex-start;flex-direction:column}
  .gallery-editor-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .editor-preview{width:140px;height:140px}
  .editor-grid{grid-template-columns:1fr}
  .editor-grid label.wide{grid-column:auto}
  .admin-editor-panel{padding:20px}
  .editor-actions{bottom:-20px;margin:18px -20px -20px;padding:13px 20px}
}


/* Data center and Excel import */
.data-center { display: grid; grid-template-columns: minmax(0,1.35fr) auto; gap: 28px; align-items: center; margin-bottom: 20px; padding: 24px 26px; overflow: hidden; border: 1px solid #d9e2ef; border-radius: 19px; background: radial-gradient(circle at 92% 10%,rgba(255,213,26,.35),transparent 24%),linear-gradient(120deg,#f1f5ff,#fff 65%); box-shadow: var(--shadow-sm); }
.data-center h2 { margin: 5px 0 7px; color: var(--navy-950); font-size: 25px; line-height: 1.2; }
.data-center p { max-width: 760px; margin: 0; color: var(--muted-700); font-size: 12px; line-height: 1.65; }
.data-rules { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.data-rules span { color: #315184; font-size: 10px; font-weight: 700; }
.data-center-actions { min-width: 230px; display: grid; gap: 9px; }
.data-center-actions .btn { width: 100%; min-height: 43px; font-size: 11px; }

.excel-import-panel { width: min(1040px,100%); padding: 28px; }
.import-mode { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 15px; padding: 13px 15px; border: 1px solid var(--line-200); border-radius: 12px; background: #f8faff; }
.import-mode label { display: flex; align-items: center; gap: 8px; color: var(--navy-950); font-size: 11px; font-weight: 700; }
.import-mode input { width: 16px; height: 16px; accent-color: var(--navy-800); }
.import-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.import-summary article { padding: 13px 15px; border: 1px solid var(--line-200); border-radius: 12px; background: #fff; }
.import-summary span { display: block; color: var(--muted-700); font-size: 10px; }
.import-summary strong { color: var(--navy-950); font-size: 25px; }
.import-warning { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #f0cb6b; border-radius: 10px; color: #6d5200; background: #fff7d7; font-size: 10px; line-height: 1.55; }
.import-preview-wrap { max-height: 390px; overflow: auto; border: 1px solid var(--line-200); border-radius: 12px; }
.import-preview-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.import-preview-table th,.import-preview-table td { padding: 10px 11px; border-bottom: 1px solid var(--line-200); text-align: left; vertical-align: top; font-size: 10px; }
.import-preview-table th { position: sticky; top: 0; z-index: 2; color: var(--navy-950); background: #f4f7fc; font-weight: 800; }
.import-result { display: inline-flex; padding: 4px 7px; border-radius: 20px; color: #0f6b42; background: #e8f7ef; font-weight: 800; white-space: nowrap; }
.import-result.new { color: #315184; background: #eaf1ff; }
.import-result.error { color: #a0212e; background: #ffe9ec; }
.import-actions { bottom: -28px; }
.data-quality-filter { outline: 3px solid rgba(255,213,26,.45); }

@media(max-width:820px){
  .data-center{grid-template-columns:1fr}.data-center-actions{min-width:0;grid-template-columns:1fr 1fr}.data-center-actions .btn:last-of-type{grid-column:1/-1}
}
@media(max-width:600px){
  .data-center{padding:19px}.data-center-actions{grid-template-columns:1fr}.data-center-actions .btn:last-of-type{grid-column:auto}.import-summary{grid-template-columns:1fr}.excel-import-panel{padding:20px}
}

/* Excel import reliability patch V7.1 */
.excel-dropzone {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border: 1.5px dashed #9eb1cb;
  border-radius: 13px;
  color: var(--navy-950);
  background: rgba(255,255,255,.75);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.excel-dropzone:hover,.excel-dropzone:focus-visible,.excel-dropzone.dragover {
  border-color: var(--navy-800);
  background: #fffbea;
  transform: translateY(-1px);
  outline: none;
}
.excel-dropzone strong { font-size: 11px; }
.excel-dropzone span { color: var(--muted-700); font-size: 9.5px; line-height: 1.45; }
.excel-live-status {
  min-height: 35px;
  padding: 9px 11px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  color: #315184;
  background: #f7f9fd;
  font-size: 10px;
  line-height: 1.45;
}
.excel-live-status.reading { color: #735600; border-color: #efd170; background: #fff8dc; }
.excel-live-status.success { color: #08633d; border-color: #a8dbc1; background: #ebf8f1; }
.excel-live-status.error { color: #9f2130; border-color: #f0b7bf; background: #fff0f2; }
.import-summary { grid-template-columns: repeat(4,1fr); }
.import-result.unchanged { color: #59677c; background: #eef1f5; }

@media(max-width:900px){
  .import-summary{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:600px){
  .import-summary{grid-template-columns:1fr 1fr}
}


/* V9.7.1 FIX — gộp tên trường và dấu * thành một dòng */
.editor-grid label>.field-label{display:inline-flex!important;align-items:baseline!important;gap:3px!important;width:max-content!important;max-width:100%!important;white-space:nowrap!important;color:var(--navy-950)!important;line-height:1.35!important}
.editor-grid .field-label>.required-mark{display:inline!important;position:static!important;width:auto!important;margin:0!important;padding:0!important;color:var(--red-600)!important;font-style:normal!important;line-height:1!important}


/* V9.6.9 — cập nhật ảnh sản phẩm hàng loạt */
.image-center {
  display:grid; grid-template-columns:minmax(0,1.45fr) minmax(260px,.55fr); gap:26px; align-items:center;
  margin-bottom:20px; padding:24px 26px; border:1px solid #d5e1ef; border-radius:19px;
  background:radial-gradient(circle at 90% 8%,rgba(23,76,158,.11),transparent 27%),linear-gradient(120deg,#ffffff,#f3f7ff 72%);
  box-shadow:var(--shadow-sm);
}
.image-center h2{margin:5px 0 7px;color:var(--navy-950);font-size:25px;line-height:1.2}
.image-center p{max-width:790px;margin:0;color:var(--muted-700);font-size:12px;line-height:1.65}
.image-rules{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:12px}
.image-rules span{color:#315184;font-size:10px;font-weight:750}
.image-center-actions{display:grid;gap:9px}
.image-center-actions .btn{width:100%;min-height:43px;font-size:11px}
.image-center-actions small{color:var(--muted-700);font-size:9.5px;line-height:1.5;text-align:center}

.bulk-image-panel{width:min(1100px,100%);padding:28px}
.bulk-image-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.bulk-image-head .editor-head{margin:0}
.bulk-match-rule{min-width:275px;display:grid;gap:6px;color:var(--navy-950);font-size:10px;font-weight:800}
.bulk-match-rule select{width:100%;min-height:42px;padding:0 11px;border:1px solid #d5deea;border-radius:10px;background:#fff;color:var(--navy-950);font-size:11px}
.bulk-image-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:17px 0 13px}
.bulk-image-summary article{padding:13px 15px;border:1px solid var(--line-200);border-radius:12px;background:#fff}
.bulk-image-summary span{display:block;color:var(--muted-700);font-size:10px}
.bulk-image-summary strong{display:block;margin-top:2px;color:var(--navy-950);font-size:25px}
.bulk-image-note{margin-bottom:12px;padding:10px 12px;border:1px solid #d8e3f2;border-radius:10px;color:#315184;background:#f6f9ff;font-size:10px;line-height:1.55}
.bulk-image-preview-wrap{max-height:430px;overflow:auto;border:1px solid var(--line-200);border-radius:12px;background:#fff}
.bulk-image-table{width:100%;min-width:850px;border-collapse:collapse}
.bulk-image-table th,.bulk-image-table td{padding:9px 10px;border-bottom:1px solid var(--line-200);text-align:left;vertical-align:middle;font-size:10px}
.bulk-image-table th{position:sticky;top:0;z-index:2;color:var(--navy-950);background:#f4f7fc;font-weight:800}
.bulk-image-thumb{width:52px;height:52px;display:block;object-fit:contain;border:1px solid #e3e9f2;border-radius:9px;background:#fff}
.bulk-file-name{max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--navy-950);font-weight:750}
.bulk-product-match{display:grid;gap:2px;min-width:250px}
.bulk-product-match strong{color:var(--navy-950);font-size:10.5px}
.bulk-product-match small{color:var(--muted-700);font-size:9px}
.bulk-match-method{display:inline-flex;padding:4px 7px;border-radius:20px;color:#315184;background:#eaf1ff;font-weight:800;white-space:nowrap}
.bulk-image-status{display:inline-flex;padding:4px 7px;border-radius:20px;font-weight:800;white-space:nowrap}
.bulk-image-status.matched{color:#0f6b42;background:#e8f7ef}
.bulk-image-status.duplicate{color:#7a5b00;background:#fff3c5}
.bulk-image-status.missing{color:#a0212e;background:#ffe9ec}
.bulk-image-status.error{color:#a0212e;background:#ffe9ec}
.bulk-upload-progress{margin-top:13px;padding:12px 13px;border:1px solid #d8e3f2;border-radius:11px;background:#f8faff}
.bulk-upload-progress>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--navy-950);font-size:10px}
.bulk-upload-track{height:8px;margin-top:8px;overflow:hidden;border-radius:20px;background:#e5ebf4}
.bulk-upload-track i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#174c9e,#2f72cf);transition:width .2s ease}

@media(max-width:900px){
  .image-center{grid-template-columns:1fr}.image-center-actions{grid-template-columns:1fr 1fr}.image-center-actions small{grid-column:1/-1}
  .bulk-image-head{flex-direction:column}.bulk-match-rule{min-width:0;width:100%}.bulk-image-summary{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
  .image-center{padding:19px}.image-center-actions{grid-template-columns:1fr}.image-center-actions small{grid-column:auto}
  .bulk-image-panel{padding:20px}.bulk-image-summary{grid-template-columns:1fr 1fr}.bulk-image-summary strong{font-size:22px}
}


/* V9.7.8 — ảnh sản phẩm trong quản trị */
.admin-table img,.editor-preview img,.bulk-image-thumb{object-fit:contain!important;object-position:center!important;padding:0!important;background:#fff!important;}
.editor-preview{overflow:hidden;background:#fff;}

/* V9.7.8.26 - product variants */
.variant-editor{margin:18px 0;padding:16px;border:1px solid #dbe5ef;border-radius:16px;background:#f9fbfd}
.variant-editor-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.variant-editor-head div{display:grid;gap:4px}.variant-editor-head small{color:#64748b}
.variant-table-wrap{overflow:auto}.variant-table{width:100%;border-collapse:collapse;min-width:980px}.variant-table th{font-size:12px;text-align:left;color:#64748b;padding:7px}.variant-table td{padding:5px}.variant-table input,.variant-table select{width:100%;min-width:92px;padding:9px 10px;border:1px solid #cbd5e1;border-radius:9px;background:#fff}.variant-table td:first-child input{min-width:180px}.variant-remove{width:34px;height:34px;border:0;border-radius:9px;background:#fee2e2;color:#991b1b;font-size:20px;cursor:pointer}.variant-empty-note{margin:8px 2px 0;color:#64748b;font-size:13px}
@media(max-width:720px){.variant-editor-head{align-items:flex-start;flex-direction:column}.variant-editor-head .btn{width:100%}}

/* V9.7.8.40.3 password visibility */
.admin-password-wrap{position:relative}.admin-password-wrap input{padding-right:64px!important}.admin-password-eye{position:absolute;right:7px;top:50%;transform:translateY(-50%);height:32px;padding:0 10px;border:0;border-radius:8px;background:#eef3fa;color:#174c9e;font-weight:700;cursor:pointer}


/* V9.7.8.40.3 — admin UI polish */
:root{--admin-radius:5px}
/* All admin card/popup surfaces */
.admin-card,.admin-notice,.data-center,.image-center,.excel-import-panel,.bulk-image-panel,.modal-panel,.admin-editor-panel,.admin-password-card,.editor-preview,[class~="card"]{border-radius:var(--admin-radius)!important}
/* compact session controls */
.admin-session-user{display:inline-flex;align-items:center;min-height:34px;padding:0 10px;border:1px solid #d9e3ef;border-radius:5px;background:#f7f9fc;color:#53657c;font-size:10px;font-weight:800}
.admin-session-action{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border:1px solid #d1dce9;border-radius:5px;background:#fff;color:#173b75;font:800 10px var(--font);cursor:pointer;transition:.16s ease}
.admin-session-action:hover{border-color:#174c9e;background:#f3f7fd;transform:translateY(-1px)}
.admin-session-action>span:first-child{font-size:12px;line-height:1}
.admin-session-logout{color:#9d2835;border-color:#ead0d4;background:#fffafa}
.admin-session-logout:hover{border-color:#c93645;background:#fff0f2}
/* change password modal */
.admin-password-modal{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:18px;background:rgba(5,18,44,.55);backdrop-filter:blur(5px)}
.admin-password-card{position:relative;width:min(440px,100%);padding:24px;border:1px solid #dce5f1;background:#fff;box-shadow:0 24px 70px rgba(6,23,58,.2)}
.admin-password-card h2{margin:0 0 5px;color:var(--navy-950);font-size:20px}.admin-password-card>p{margin:0 0 17px;color:#69778a;font-size:11px}
.admin-password-card form{display:grid;gap:13px}.admin-password-card label{display:grid;gap:6px;color:#33465f;font-size:11px;font-weight:800}.admin-password-card input{width:100%;min-height:44px;padding:0 12px;border:1px solid #cfd9e6;border-radius:5px;outline:none}.admin-password-card input:focus{border-color:#174c9e;box-shadow:0 0 0 3px rgba(23,76,158,.08)}
.admin-password-close{position:absolute;right:10px;top:10px;width:32px;height:32px;border:0;border-radius:5px;background:#f1f4f8;color:#506079;font-size:20px;cursor:pointer}.admin-password-message{min-height:17px;color:#a0212e;font-size:10px}.admin-password-card .btn{min-height:42px;border-radius:5px}
.admin-password-eye{border-radius:5px!important}
/* Variant editor: cards instead of a wide rough table */
.variant-editor{margin:16px 0;padding:15px;border:1px solid #d9e3ef;border-radius:5px!important;background:#f7f9fc}
.variant-editor-head{margin-bottom:11px;padding-bottom:11px;border-bottom:1px solid #e2e8f0}.variant-editor-head strong{color:var(--navy-950);font-size:13px}.variant-editor-head small{max-width:690px;color:#758296;font-size:10px;line-height:1.45}.variant-editor-head .btn{min-height:36px;padding:0 12px;border-radius:5px;font-size:10px}
.variant-table-wrap{overflow:visible}.variant-table{min-width:0;border-collapse:separate;border-spacing:0}.variant-table thead{display:none}.variant-table tbody{display:grid;gap:9px}.variant-table tr{display:grid;grid-template-columns:minmax(180px,1.7fr) repeat(3,minmax(105px,.8fr)) minmax(110px,.85fr) minmax(90px,.65fr) minmax(120px,.8fr) 38px;gap:8px;align-items:end;padding:10px;border:1px solid #dce5ef;border-radius:5px;background:#fff;box-shadow:0 3px 10px rgba(11,31,58,.035)}
.variant-table td{display:grid;gap:4px;padding:0!important}.variant-table td::before{content:attr(data-label);color:#718096;font-size:9px;font-weight:800;line-height:1.2}.variant-table input,.variant-table select{min-width:0!important;min-height:38px;padding:0 9px!important;border:1px solid #ced9e6!important;border-radius:5px!important;background:#fff;font-size:10px;outline:none}.variant-table input:focus,.variant-table select:focus{border-color:#174c9e!important;box-shadow:0 0 0 2px rgba(23,76,158,.08)}
.variant-remove-cell{display:flex!important;align-items:flex-end;justify-content:center}.variant-remove-cell::before{display:none}.variant-remove{width:34px;height:38px;border-radius:5px!important;background:#fff0f2;color:#a0212e;font-size:18px}.variant-remove:hover{background:#ffe3e7}.variant-empty-note{margin:10px 0 0;padding:9px 10px;border:1px dashed #cfd9e6;border-radius:5px;color:#718096;background:#fff;font-size:10px}
@media(max-width:1100px){.variant-table tr{grid-template-columns:repeat(4,minmax(0,1fr))}.variant-remove-cell{align-items:end}}
@media(max-width:720px){.variant-table tr{grid-template-columns:1fr 1fr}.variant-remove-cell{justify-content:flex-start}.variant-remove{width:100%}}
@media(max-width:460px){.variant-table tr{grid-template-columns:1fr}}

/* V9.7.8.40.3 universal radius */
[class*="-card"],[class~="card"],.modal-panel{border-radius:5px!important}


/* V9.7.8.40.3 — touchup */
:root{--admin-radius:5px}
.admin-product-name small,.optional-fields summary span,.switch-row small,.settings-section label small,.notification-card span{font-weight:600!important}
.variant-editor,.variant-table tr,.variant-table input,.variant-table select,.variant-remove,.admin-password-eye,.admin-session-user,.admin-session-action,.admin-card,.admin-notice,.data-center,.image-center,.excel-import-panel,.bulk-image-panel,.modal-panel,.admin-editor-panel,.admin-password-card,.editor-preview,[class~="card"]{border-radius:5px!important}


/* V9.7.8.40.3 — full 5px radius audit */
.btn,a.btn,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,textarea,
.admin-session-user,.admin-session-action,.admin-password-eye,.admin-password-close,
.variant-editor,.variant-table tr,.variant-table input,.variant-table select,.variant-remove,
.order-card,.order-detail-section,.order-update-box,.settings-section,.manual-items-section,.manual-note,
.payment-proof-admin,.payment-settings-grid,.payment-preview,.payment-proof-viewer-panel,.payment-proof-viewer-body,
.modal-panel,.admin-card,.admin-notice,.data-center,.image-center,.excel-import-panel,.bulk-image-panel,.admin-editor-panel,.admin-password-card,
.settings-password-eye,.settings-password-wrap input{
  border-radius:5px!important;
}
.optional-fields summary span,.admin-product-name small,.switch-row small,.settings-section label small,.order-search-box input::placeholder{font-weight:600!important}


/* V9.7.8.40.3 — admin readability + variant layout fix */
.admin-page,.orders-admin-page{font-weight:600}
.admin-page p,.admin-page small,.admin-page span,.admin-page label,.admin-page td,.admin-page input,.admin-page select,.admin-page textarea,
.orders-admin-page p,.orders-admin-page small,.orders-admin-page span,.orders-admin-page label,.orders-admin-page td,.orders-admin-page input,.orders-admin-page select,.orders-admin-page textarea{font-weight:600!important}
.admin-page input::placeholder,.admin-page textarea::placeholder,.orders-admin-page input::placeholder,.orders-admin-page textarea::placeholder{font-weight:600!important;opacity:.82}
.admin-page strong,.admin-page h1,.admin-page h2,.admin-page h3,.admin-page th,.orders-admin-page strong,.orders-admin-page h1,.orders-admin-page h2,.orders-admin-page h3,.orders-admin-page th{font-weight:800!important}
/* Two-row variant card on desktop: prevents the status field from overflowing */
.variant-table-wrap{width:100%;max-width:100%;overflow:visible!important}
.variant-table{width:100%!important;min-width:0!important;table-layout:fixed}
.variant-table tbody{width:100%}
.variant-table tr{width:100%;max-width:100%;grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:end}
.variant-table td{min-width:0!important;max-width:100%}
.variant-table input,.variant-table select{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
.variant-remove-cell{align-items:end!important;justify-content:flex-start!important}
.variant-remove{width:100%!important;max-width:110px}
.variant-editor,.gallery-uploader,.gallery-editor-empty,.gallery-editor-item,.optional-fields,
.variant-table tr,.variant-table input,.variant-table select,.variant-remove,.btn,button,input,select,textarea{border-radius:5px!important}
@media(max-width:720px){.variant-table tr{grid-template-columns:repeat(2,minmax(0,1fr))!important}.variant-remove{max-width:none}}
@media(max-width:460px){.variant-table tr{grid-template-columns:1fr!important}}

.field-help{display:block;margin-top:2px;color:#738198;font-size:9px;font-weight:600;line-height:1.4}.editor-grid input[readonly]{background:#f2f5f9;color:#53657c;cursor:not-allowed}

/* V9.7.8.40.3 stock cell */
.admin-stock-cell{display:grid;gap:4px;justify-items:start}.admin-stock-cell>strong{font-size:12px;color:#07173e}.admin-stock-state{display:inline-flex;padding:4px 6px;border-radius:5px;font-size:8px;font-weight:850;white-space:nowrap}.admin-stock-state.ok{background:#eaf8f0;color:#17623e}.admin-stock-state.low{background:#fff7d6;color:#7a5a00}.admin-stock-state.out{background:#fff0f2;color:#a0212e}.admin-stock-state.untracked{background:#f0f3f7;color:#65758a}
\n\n/* V9.7.8.40.3 — product list image matches inventory */\n#adminRows td>img{width:54px!important;height:54px!important;padding:0!important;object-fit:contain!important;object-position:center!important;border:1px solid #e1e8f1!important;border-radius:5px!important;background:#fff!important}\n

/* V9.7.8.40.3 — product table image matches inventory */
.admin-product-image-cell{width:78px;min-width:78px;text-align:center!important}
.admin-table .admin-product-thumb{display:block;width:54px!important;height:54px!important;margin:0 auto;padding:0!important;object-fit:contain!important;object-position:center!important;border:1px solid #e1e8f1!important;border-radius:5px!important;background:#fff!important;box-shadow:none!important}


/* V9.7.8.40.3 — product image column final fix */
#adminRows .admin-product-image-cell{width:74px!important;min-width:74px!important;max-width:74px!important;padding-left:10px!important;padding-right:10px!important;text-align:center!important}
#adminRows .admin-product-thumb{display:block!important;width:54px!important;min-width:54px!important;max-width:54px!important;height:54px!important;min-height:54px!important;max-height:54px!important;margin:0 auto!important;padding:0!important;object-fit:contain!important;object-position:center!important;border:1px solid #e1e8f1!important;border-radius:5px!important;background:#fff!important;box-shadow:none!important}

/* =========================================================
   V9.7.8.40.3 — ADMIN MOBILE RESPONSIVE
   ========================================================= */
@media(max-width:820px){
  .admin-main{padding:14px 0 42px}
  .admin-header .simple-header-inner{align-items:flex-start;flex-direction:column;padding:8px 0}
  .admin-header .simple-nav{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .admin-header .simple-nav a,.admin-header .simple-nav button{width:100%;justify-content:center;min-height:38px}
  .admin-notice,.admin-card,.data-center,.image-center{padding:15px!important}
  .admin-kpis{gap:8px}
  .admin-kpis article{min-width:0}
  .admin-card-head{gap:10px}
  .admin-card-head h1,.admin-card-head h2{font-size:22px!important}
  .admin-toolbar{gap:9px}
  .admin-search-row{grid-template-columns:1fr!important}
  .admin-search-box{grid-column:auto!important;width:100%}
  .admin-search-box input{width:100%}
  .admin-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;width:100%}
  .admin-actions .btn{width:100%;padding:0 8px;font-size:10px}
  .admin-pagination{gap:8px;padding:12px 0;align-items:stretch!important;flex-direction:column!important}
  .admin-pagination>div{width:100%;display:grid;grid-template-columns:1fr auto 1fr;gap:6px;align-items:center}
  .admin-pagination button{width:100%;min-height:38px}
  .admin-pagination label{justify-content:space-between}
  .admin-editor-panel,.excel-import-panel,.bulk-image-panel{width:100%!important;padding:14px!important}
  .editor-head{padding-right:32px}
  .editor-head h2{font-size:22px}
  .image-uploader{grid-template-columns:1fr!important}
  .image-uploader-actions,.gallery-uploader-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .editor-preview{width:120px;height:120px;margin:auto}
  .gallery-editor-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .editor-grid,.optional-grid{grid-template-columns:1fr!important;gap:10px}
  .editor-grid label.wide,.optional-grid label.wide{grid-column:auto!important}
  .optional-fields summary{padding:11px}
  .editor-actions{position:sticky;bottom:0;margin:14px -14px -14px!important;padding:10px 14px!important;display:grid;grid-template-columns:1fr 1fr;z-index:10}
  .variant-editor{padding:10px!important}
  .variant-editor-head{align-items:stretch!important;flex-direction:column!important}
  .variant-editor-head .btn{width:100%}
  .variant-table tbody{gap:8px}
  .variant-table tr{grid-template-columns:1fr 1fr!important;padding:9px!important;gap:7px!important}
  .variant-remove-cell{grid-column:1/-1;justify-content:stretch!important}
  .variant-remove{width:100%!important;max-width:none!important}
  .data-center-actions,.image-center-actions{grid-template-columns:1fr!important;min-width:0!important;width:100%}
}

@media(max-width:650px){
  .admin-kpis{grid-template-columns:1fr 1fr!important}
  .admin-kpis article{min-height:88px!important;padding:11px!important}
  .admin-kpis span{font-size:10px}
  .admin-kpis strong{font-size:23px!important}
  .admin-table-wrap{overflow:visible;border:0!important;background:transparent!important}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table){display:block;width:100%;min-width:0!important}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table) thead{display:none}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table) tbody{display:grid;gap:9px}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table) tr{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:11px;border:1px solid #dce5ef;border-radius:5px;background:#fff;box-shadow:0 4px 12px rgba(11,31,58,.04)}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table) td{display:grid;grid-template-columns:92px minmax(0,1fr);align-items:center;gap:8px;padding:5px 0!important;border:0!important;min-width:0!important;font-size:11px}
  .admin-table:not(.variant-table):not(.import-preview-table):not(.bulk-image-table) td::before{content:attr(data-label);color:#6b7a90;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.02em}
  .admin-table .check-column{grid-column:1/-1;grid-template-columns:92px 1fr!important}
  .admin-table .admin-product-image-cell{grid-column:1/-1}
  .admin-table .admin-product-image-cell .admin-product-thumb{width:54px!important;height:54px!important;max-width:none!important}
  .admin-table td[data-label="Sản phẩm"],.admin-table td[data-label="Thương hiệu / danh mục"],.admin-table td[data-label="Thao tác"]{grid-column:1/-1}
  .admin-product-name{min-width:0!important}
  .admin-row-actions{display:grid!important;grid-template-columns:repeat(3,1fr);gap:5px;width:100%}
  .admin-row-actions button{width:100%;min-height:36px}
  .featured-toggle,.status-badge{justify-self:start}
  .admin-actions{grid-template-columns:1fr}
  .gallery-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .variant-table tr{grid-template-columns:1fr!important}
  .image-uploader-actions,.gallery-uploader-actions,.editor-actions{grid-template-columns:1fr!important}
  .import-summary{grid-template-columns:1fr!important}
  .import-preview-wrap,.bulk-image-table-wrap{overflow:auto}
}

/* =========================================================
   V9.7.8.41.13 — Admin mobile cleanup (single final override)
   ========================================================= */
@media (max-width:760px){
  .admin-page{font-size:12px}
  .admin-main{padding:10px 0 24px!important}
  .admin-main>.container{width:100%!important;padding-inline:8px!important}

  /* Header admin gọn, menu cuộn ngang */
  .admin-header{position:sticky;top:0;z-index:210;background:rgba(255,255,255,.97);backdrop-filter:blur(10px)}
  .admin-header .simple-header-inner{display:grid!important;grid-template-columns:1fr;gap:7px!important;padding:7px 8px!important}
  .admin-header .brand{min-width:0!important;gap:8px!important}
  .admin-header .brand img{width:40px!important;height:40px!important}
  .admin-header .brand-copy strong{font-size:13px!important;line-height:1.15!important}
  .admin-header .brand-copy span{font-size:9px!important;line-height:1.25!important}
  .admin-header .simple-nav{display:flex!important;gap:6px!important;width:100%!important;overflow-x:auto!important;padding:0 0 2px!important;scrollbar-width:none!important;white-space:nowrap!important}
  .admin-header .simple-nav::-webkit-scrollbar{display:none!important}
  .admin-header .simple-nav a{flex:0 0 auto!important;min-height:34px!important;padding:0 10px!important;border:1px solid #dce5ef!important;border-radius:5px!important;background:#fff!important;font-size:10px!important;font-weight:750!important;display:inline-flex!important;align-items:center!important}

  /* Notice + KPI */
  .admin-notice{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:11px 12px!important;margin-bottom:10px!important}
  .admin-notice strong{font-size:11px!important}
  .admin-notice span,.admin-notice p{font-size:9px!important;line-height:1.45!important}
  .admin-kpis{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;margin-bottom:10px!important}
  .admin-kpis article{min-height:78px!important;padding:10px!important;border-radius:5px!important}
  .admin-kpis span{font-size:9px!important}
  .admin-kpis strong{font-size:21px!important;line-height:1.1!important}
  .admin-kpis small{font-size:8px!important;line-height:1.25!important}

  /* Card/head chung */
  .admin-card{padding:12px!important;margin-bottom:10px!important;border-radius:5px!important}
  .admin-card-head{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;margin-bottom:10px!important}
  .admin-card-head h1,.admin-card-head h2{font-size:19px!important;line-height:1.25!important;margin-block:2px 4px!important}
  .admin-card-head p{font-size:10px!important;line-height:1.4!important}
  .admin-card-head>.btn{width:100%!important;min-height:40px!important}

  /* Bộ lọc sản phẩm */
  .admin-toolbar{padding:0!important;margin-bottom:10px!important}
  .admin-search-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important}
  .admin-search-row .admin-search-box{grid-column:1/-1!important}
  .admin-search-row input,.admin-search-row select{min-height:40px!important;font-size:11px!important}
  .admin-search-box{min-height:40px!important}
  .admin-search-box input{min-height:40px!important;font-size:11px!important;padding-left:34px!important}
  .admin-search-box>span{font-size:14px!important}

  /* Bảng sản phẩm -> card mobile gọn */
  .admin-table-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  .admin-table{display:block!important;width:100%!important;min-width:0!important}
  .admin-table thead{display:none!important}
  .admin-table tbody{display:grid!important;gap:8px!important}
  .admin-table tbody>tr{position:relative!important;display:grid!important;grid-template-columns:60px minmax(0,1fr)!important;gap:6px 9px!important;padding:10px!important;border:1px solid #dde6f0!important;border-radius:5px!important;background:#fff!important;box-shadow:0 3px 10px rgba(11,31,58,.035)!important}
  .admin-table td{display:block!important;min-width:0!important;padding:0!important;border:0!important;font-size:10px!important}
  .admin-table td::before{content:attr(data-label);display:block;margin-bottom:3px;color:#7a889c;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.02em}
  .admin-table .check-column{position:absolute!important;top:8px!important;right:8px!important;width:auto!important;z-index:2}
  .admin-table .check-column::before{display:none!important}
  .admin-table .check-column input{width:17px!important;height:17px!important}
  .admin-table .admin-product-image-cell{grid-column:1!important;grid-row:1!important;align-self:start!important}
  .admin-table .admin-product-image-cell::before{display:none!important}
  .admin-product-thumb{width:56px!important;height:56px!important;max-width:none!important;border:1px solid #e1e8f1!important;border-radius:5px!important;background:#fff!important;object-fit:contain!important}
  .admin-table td[data-label="Sản phẩm"]{grid-column:2!important;grid-row:1!important;padding-right:26px!important}
  .admin-table td[data-label="Sản phẩm"]::before{display:none!important}
  .admin-product-name strong{font-size:11px!important;line-height:1.35!important}
  .admin-product-name small{font-size:9px!important;line-height:1.35!important}
  .admin-table td[data-label="Thương hiệu / danh mục"]{grid-column:1/-1!important}
  .admin-table td[data-label="Giá bán"],.admin-table td[data-label="Tồn kho"],.admin-table td[data-label="Trạng thái"],.admin-table td[data-label="Nổi bật"]{grid-column:auto!important}
  .admin-table td[data-label="Thao tác"]{grid-column:1/-1!important;margin-top:2px!important;padding-top:7px!important;border-top:1px solid #edf1f6!important}
  .admin-row-actions{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:6px!important}
  .admin-row-actions button{width:100%!important;min-height:34px!important;padding:0 5px!important;font-size:9px!important}
  .featured-toggle{min-height:31px!important;font-size:9px!important;padding:0 8px!important}
  .admin-price{font-size:12px!important}
  .status-badge,.admin-stock-state{font-size:8px!important}

  /* Bulk + phân trang */
  .bulk-toolbar{position:fixed!important;left:8px!important;right:8px!important;bottom:8px!important;z-index:260!important;display:none!important;gap:7px!important;padding:9px!important;border:1px solid #d7e1ed!important;border-radius:5px!important;background:rgba(255,255,255,.98)!important;box-shadow:0 12px 28px rgba(8,28,73,.18)!important}
  .bulk-toolbar[aria-hidden="false"]{display:grid!important}
  .bulk-toolbar>strong{font-size:10px!important}
  .bulk-toolbar>div{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:5px!important}
  .bulk-toolbar button{min-height:34px!important;font-size:9px!important;padding:0 6px!important}
  .admin-pagination{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;align-items:stretch!important;padding-top:10px!important}
  .admin-pagination>label{font-size:9px!important}
  .admin-pagination>div{display:grid!important;grid-template-columns:1fr auto 1fr!important;gap:6px!important;width:100%!important}
  .admin-pagination button{width:100%!important;min-height:36px!important;font-size:10px!important}
  .admin-pagination span{display:flex!important;align-items:center!important;justify-content:center!important;min-width:76px!important;font-size:9px!important}

  /* Modal/editor gần full màn hình */
  .modal{padding:8px!important}
  .modal-panel,.admin-editor-panel{width:calc(100vw - 16px)!important;max-width:none!important;max-height:calc(100dvh - 16px)!important;margin:auto!important;padding:14px!important;border-radius:5px!important;overflow:auto!important}
  .modal-close{top:8px!important;right:8px!important;width:34px!important;height:34px!important}
  .editor-head h2{font-size:20px!important}
  .editor-grid{grid-template-columns:1fr!important;gap:9px!important}
  .editor-grid .wide{grid-column:auto!important}
  .image-uploader{grid-template-columns:1fr!important;padding:10px!important}
  .editor-preview{width:100%!important;max-width:170px!important;margin:auto!important}
  .image-uploader-actions,.gallery-uploader-actions{display:grid!important;grid-template-columns:1fr!important;gap:6px!important}
  .variant-table-wrap{overflow:auto!important;-webkit-overflow-scrolling:touch!important}
}

@media (max-width:430px){
  .admin-search-row{grid-template-columns:1fr!important}
  .admin-search-row .admin-search-box{grid-column:auto!important}
  .admin-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .admin-row-actions{grid-template-columns:1fr 1fr!important}
  .bulk-toolbar>div{grid-template-columns:1fr 1fr!important}
}


/* =========================================================
   V9.7.8.41.14 — Compact mobile cards/forms + bulk bar fix
   ========================================================= */
@media (max-width:760px){
  /* Product cards: denser information without reducing readability */
  .admin-table tbody{gap:7px!important}
  .admin-table tbody>tr{
    grid-template-columns:52px minmax(0,1fr)!important;
    gap:5px 8px!important;
    padding:9px!important;
  }
  .admin-product-thumb{width:50px!important;height:50px!important}
  .admin-product-name strong{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important;font-size:11px!important;line-height:1.3!important}
  .admin-product-name small{display:block!important;margin-top:2px!important;font-size:8.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .admin-table td[data-label="Thương hiệu / danh mục"]{grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;padding-top:4px!important}
  .admin-table td[data-label="Thương hiệu / danh mục"]::before{grid-column:1/-1!important;margin-bottom:0!important}
  .admin-category-cell{display:contents!important}
  .admin-category-cell strong,.admin-category-cell small{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:9px!important}
  .admin-table td[data-label="Giá bán"],.admin-table td[data-label="Tồn kho"]{padding-top:3px!important}
  .admin-table td[data-label="Trạng thái"],.admin-table td[data-label="Nổi bật"]{padding-top:2px!important}
  .admin-table td[data-label="Thao tác"]{margin-top:0!important;padding-top:6px!important}
  .admin-row-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
  .admin-row-actions button{min-height:32px!important;font-size:9px!important}

  /* Product editor: 2-column compact fields on mobile */
  .admin-editor-panel{padding:12px!important}
  .editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .editor-grid>label{min-width:0!important;gap:4px!important}
  .editor-grid .wide{grid-column:1/-1!important}
  .editor-grid label:has(textarea){grid-column:1/-1!important}
  .editor-grid input,.editor-grid select,.editor-grid textarea{
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    padding:7px 9px!important;
    font-size:11px!important;
  }
  .editor-grid textarea{min-height:84px!important;resize:vertical!important}
  .field-label,.editor-grid>label>span:first-child{font-size:9px!important;line-height:1.2!important}
  .field-help{font-size:8px!important;line-height:1.25!important;margin-top:2px!important}

  /* Upload blocks are kept full width but tightened */
  .image-uploader,.gallery-uploader{padding:9px!important;margin-bottom:10px!important}
  .image-uploader{grid-template-columns:82px minmax(0,1fr)!important;gap:9px!important;align-items:center!important}
  .editor-preview{width:82px!important;height:82px!important;max-width:none!important;margin:0!important}
  .image-uploader-copy{min-width:0!important}
  .image-uploader-copy strong{font-size:11px!important}
  .image-uploader-copy span,.image-uploader-copy small{font-size:8.5px!important;line-height:1.35!important}
  .image-uploader-actions,.gallery-uploader-actions{display:flex!important;flex-wrap:wrap!important;gap:5px!important}
  .image-uploader-actions .btn,.gallery-uploader-actions .btn{flex:1 1 120px!important;min-height:34px!important;padding:0 7px!important;font-size:9px!important}

  /* Variant editor: compact two-column cards, delete button in header */
  .variant-editor{padding:9px!important;margin:11px 0!important}
  .variant-editor-head{position:relative!important;display:grid!important;grid-template-columns:1fr auto!important;align-items:start!important;gap:7px!important;padding-bottom:8px!important;margin-bottom:8px!important}
  .variant-editor-head>div{min-width:0!important}
  .variant-editor-head strong{font-size:11px!important}
  .variant-editor-head small{font-size:8.5px!important;line-height:1.35!important}
  .variant-editor-head .btn{width:auto!important;min-height:34px!important;padding:0 9px!important;font-size:9px!important;white-space:nowrap!important}
  .variant-table-wrap{overflow:visible!important}
  .variant-table,.variant-table tbody{display:block!important;width:100%!important}
  .variant-table tbody{display:grid!important;gap:7px!important}
  .variant-table tr{
    position:relative!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
    padding:34px 8px 8px!important;
    border:1px solid #dce5ef!important;
    background:#fff!important;
  }
  .variant-table tr::before{
    content:"Lựa chọn " attr(data-variant-number)!important;
    position:absolute!important;
    left:9px!important;
    top:9px!important;
    color:#52647d!important;
    font-size:9px!important;
    font-weight:800!important;
    letter-spacing:.02em!important;
    text-transform:uppercase!important;
  }
  .variant-table td{display:grid!important;gap:3px!important;min-width:0!important;padding:0!important}
  .variant-table td::before{font-size:8px!important;margin:0!important}
  .variant-table input,.variant-table select{width:100%!important;min-height:36px!important;padding:0 8px!important;font-size:10px!important}
  .variant-remove-cell{
    position:absolute!important;
    top:5px!important;
    right:5px!important;
    display:block!important;
    width:auto!important;
    z-index:2!important;
  }
  .variant-remove-cell::before{display:none!important}
  .variant-remove{
    width:28px!important;
    height:28px!important;
    min-height:28px!important;
    padding:0!important;
    border:1px solid #f0cbd0!important;
    background:#fff6f7!important;
    color:#a0212e!important;
    font-size:16px!important;
  }

  /* Optional block + save/cancel */
  .optional-fields{margin-top:9px!important}
  .optional-fields summary{padding:9px 10px!important;font-size:9px!important}
  .editor-actions{
    grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)!important;
    gap:6px!important;
    margin:10px -12px -12px!important;
    padding:9px 12px!important;
  }
  .editor-actions .btn{min-height:38px!important;font-size:10px!important}
  .editor-actions .btn-primary{order:2!important}
  .editor-actions .btn-secondary{order:1!important}

  /* FIX: selecting products must not create a large white panel at bottom. */
  .bulk-toolbar[aria-hidden="false"],.bulk-toolbar.open{
    display:flex!important;
    align-items:center!important;
    left:8px!important;
    right:8px!important;
    bottom:8px!important;
    min-height:48px!important;
    max-height:58px!important;
    gap:8px!important;
    padding:7px 8px!important;
    overflow:hidden!important;
  }
  .bulk-toolbar>strong{
    flex:0 0 auto!important;
    max-width:92px!important;
    font-size:9px!important;
    line-height:1.25!important;
  }
  .bulk-toolbar>div{
    display:flex!important;
    flex:1 1 auto!important;
    gap:5px!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding-bottom:1px!important;
    scrollbar-width:none!important;
    white-space:nowrap!important;
  }
  .bulk-toolbar>div::-webkit-scrollbar{display:none!important}
  .bulk-toolbar button{
    flex:0 0 auto!important;
    width:auto!important;
    min-height:32px!important;
    padding:0 9px!important;
    font-size:9px!important;
    white-space:nowrap!important;
  }
}

@media (max-width:390px){
  .editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .image-uploader{grid-template-columns:68px minmax(0,1fr)!important}
  .editor-preview{width:68px!important;height:68px!important}
  .variant-table tr{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .bulk-toolbar>strong{max-width:72px!important;font-size:8px!important}
}
