:root {
  --pos-ui-bg: #f3f6fa;
  --pos-ui-surface: #ffffff;
  --pos-ui-surface-soft: #f8fafc;
  --pos-ui-border: #b8c5d6;
  --pos-ui-border-strong: #8fa3ba;
  --pos-ui-text: #172033;
  --pos-ui-muted: #64748b;
  --pos-ui-primary: #2563eb;
  --pos-ui-primary-dark: #1d4ed8;
  --pos-ui-danger: #be123c;
  --pos-ui-success: #047857;
  --pos-ui-warning: #b45309;
  --pos-ui-radius: 10px;
  --pos-ui-control-height: 36px;
  --pos-ui-grid-font-size: 13px;
  --pos-ui-font-family: "Manrope", sans-serif;
}

body.pos-ui-v2 {
  color: var(--pos-ui-text);
  background: var(--pos-ui-bg) !important;
  font-family: var(--pos-ui-font-family);
  font-size: 15px;
}

body.pos-ui-v2 button,
body.pos-ui-v2 input,
body.pos-ui-v2 select,
body.pos-ui-v2 textarea {
  font-family: var(--pos-ui-font-family);
}

body.pos-ui-v2 .pos-page-shell,
body.pos-ui-v2 main[class*="pos-"] {
  width: 100%;
  max-width: none;
  padding: 8px 10px;
}

body.pos-ui-v2 .pos-page-shell {
  min-height: 100%;
}

body.pos-ui-v2 .pos-page-topbar,
body.pos-ui-v2 .pos-standard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  margin: -8px -10px 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--pos-ui-border);
  background: var(--pos-ui-surface-soft);
}

body.pos-ui-v2 .pos-page-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

body.pos-ui-v2 .pos-page-topbar-actions:empty {
  display: none;
}

body.pos-ui-v2 .pos-page-title,
body.pos-ui-v2 .pos-standard-title {
  color: var(--pos-ui-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

body.pos-ui-v2 .pos-page-card,
body.pos-ui-v2 .pos-standard-card,
body.pos-ui-v2 section.rounded-xl,
body.pos-ui-v2 main > section {
  border-color: var(--pos-ui-border) !important;
  border-radius: var(--pos-ui-radius);
  background: var(--pos-ui-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.pos-ui-v2 .pos-page-card {
  padding: 10px;
}

body.pos-ui-v2 .pos-page-shell > .bg-white.rounded-xl,
body.pos-ui-v2 .pos-page-shell > form.bg-white.rounded-xl {
  border: 1px solid var(--pos-ui-border) !important;
  border-radius: var(--pos-ui-radius) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

body.pos-ui-v2 .pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--pos-ui-control-height);
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

body.pos-ui-v2 .pos-btn-primary {
  border-color: var(--pos-ui-primary);
  color: #fff;
  background: var(--pos-ui-primary);
}

body.pos-ui-v2 .pos-btn-primary:hover {
  border-color: var(--pos-ui-primary-dark);
  background: var(--pos-ui-primary-dark);
}

body.pos-ui-v2 .pos-btn-secondary,
body.pos-ui-v2 .pos-btn-outline {
  border-color: var(--pos-ui-primary);
  color: var(--pos-ui-primary);
  background: #fff;
}

body.pos-ui-v2 .pos-btn-secondary:hover,
body.pos-ui-v2 .pos-btn-outline:hover {
  background: #eff6ff;
}

body.pos-ui-v2 .pos-btn-danger {
  border-color: #e11d48;
  color: #fff;
  background: #e11d48;
}

body.pos-ui-v2 .pos-btn-danger:hover {
  border-color: #be123c;
  background: #be123c;
}

body.pos-ui-v2 .pos-btn-sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
}

body.pos-ui-v2 .pos-page-topbar-actions .pos-btn {
  min-height: var(--pos-ui-control-height);
  padding: 6px 13px;
  font-size: 13px;
}

body.pos-ui-v2 .pos-control {
  width: 100%;
  min-height: var(--pos-ui-control-height);
  padding: 6px 10px;
  border: 1px solid var(--pos-ui-border);
  border-radius: 8px;
  color: var(--pos-ui-text);
  background: #fff;
  font-size: 14px;
}

body.pos-ui-v2 textarea.pos-control {
  min-height: 72px;
}

body.pos-ui-v2 .pos-page-card :where(input[type="text"], input[type="search"], input[type="date"], input[type="email"], input[type="number"], input[type="tel"], select, textarea):not(.pos-control):not(.pos-filter-input):not(.pos-column-filter):not(.column-filter) {
  min-height: var(--pos-ui-control-height);
  border-color: var(--pos-ui-border) !important;
  border-radius: 8px !important;
  background: #fff;
}

body.pos-ui-v2 .pos-page-card > :is(h2, h3),
body.pos-ui-v2 .pos-section-head :is(h2, h3, h4, h5) {
  color: var(--pos-ui-text);
  font-weight: 700;
}

body.pos-ui-v2 .pos-page-card + .pos-page-card {
  margin-top: 8px;
}

/* Compatibility surface for legacy functional dialogs. The business markup
   stays intact while every page gets the same radius, border and action bar. */
body.pos-ui-v2 [id$="-modal"] > .relative.bg-white,
body.pos-ui-v2 [id$="Modal"] > .relative.bg-white,
body.pos-ui-v2 [role="dialog"].bg-white {
  border: 1px solid var(--pos-ui-border) !important;
  border-radius: 12px !important;
  background: var(--pos-ui-surface) !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2) !important;
}

body.pos-ui-v2 [id$="-modal"] > .relative.bg-white > :first-child,
body.pos-ui-v2 [id$="Modal"] > .relative.bg-white > :first-child {
  border-color: var(--pos-ui-border) !important;
}

body.pos-ui-v2 [id$="-modal"] .pos-modal-actions,
body.pos-ui-v2 [id$="Modal"] .pos-modal-actions {
  border-top: 1px solid var(--pos-ui-border);
  background: var(--pos-ui-surface-soft);
}

body.pos-ui-v2 :is(.tgs-detail-modal-card, .lookup-detail-modal__panel, .quy-modal > .bg-white, .shop-theme-confirm__box) {
  border: 1px solid var(--pos-ui-border) !important;
  border-radius: 12px !important;
  background: var(--pos-ui-surface) !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2) !important;
}

/* Page-specific widgets keep their information architecture, but inherit one
   surface language instead of introducing another theme per function. */
body.pos-ui-v2 :is(.dashboard-card, .training-sidebar, .training-content, .lesson-card, .quy-card, .lookup-profile) {
  border: 1px solid var(--pos-ui-border) !important;
  border-radius: var(--pos-ui-radius) !important;
  background: var(--pos-ui-surface) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

body.pos-ui-v2 .training-sidebar-header {
  border-bottom: 1px solid var(--pos-ui-border);
  border-radius: var(--pos-ui-radius) var(--pos-ui-radius) 0 0;
  color: var(--pos-ui-text);
  background: var(--pos-ui-surface-soft) !important;
}

body.pos-ui-v2 .training-tab-item .tab-trigger.active {
  border-left-color: var(--pos-ui-primary);
  color: var(--pos-ui-primary);
  background: #eff6ff;
}

body.pos-ui-v2 .training-tab-item .tab-trigger.active .tab-icon,
body.pos-ui-v2 .lesson-number {
  color: #fff;
  background: var(--pos-ui-primary) !important;
}

body.pos-ui-v2 .quy-hero {
  border-radius: var(--pos-ui-radius);
  background: var(--pos-ui-primary) !important;
}

body.pos-ui-v2 :is(.lookup-detail-modal__header, .lookup-detail-modal__footer) {
  border-color: var(--pos-ui-border) !important;
  background: var(--pos-ui-surface-soft) !important;
}

body.pos-ui-v2 .pos-text-muted {
  color: var(--pos-ui-muted);
}
body.pos-ui-v2 .pos-text-danger {
  color: var(--pos-ui-danger);
}
body.pos-ui-v2 .pos-text-success {
  color: var(--pos-ui-success);
}

body.pos-ui-v2 .pos-module-app {
  width: 100%;
}

body.pos-ui-v2 .pos-module-app > .pos-page-topbar {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--pos-ui-border);
  border-radius: var(--pos-ui-radius);
}

body.pos-ui-v2 .pos-tabs {
  display: flex;
  width: 100%;
  gap: 4px;
  margin-bottom: 8px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--pos-ui-border);
  border-radius: var(--pos-ui-radius);
  background: var(--pos-ui-surface);
}

body.pos-ui-v2 .pos-tab {
  display: inline-flex;
  min-height: var(--pos-ui-control-height);
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--pos-ui-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

body.pos-ui-v2 .pos-tab:hover {
  color: var(--pos-ui-primary);
  background: #eff6ff;
}

body.pos-ui-v2 .pos-tab.active {
  border-color: var(--pos-ui-primary);
  color: #fff;
  background: var(--pos-ui-primary);
}

body.pos-ui-v2 .pos-panel {
  display: none;
  width: 100%;
}
body.pos-ui-v2 .pos-panel.active {
  display: block;
}
body.pos-ui-v2 .pos-panel.hidden:not(.active) {
  display: none;
}

body.pos-ui-v2 .pos-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pos-ui-border);
}

body.pos-ui-v2 .pos-section-head h5,
body.pos-ui-v2 .pos-section-head p {
  margin: 0;
}

body.pos-ui-v2 .pos-section-head p {
  margin-top: 3px;
  color: var(--pos-ui-muted);
  font-size: 13px;
}

body.pos-ui-v2 .pos-filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(170px, 1fr);
  gap: 8px;
  width: min(100%, 680px);
}

body.pos-ui-v2 .pos-record-list {
  display: grid;
  gap: 8px;
  min-height: 90px;
}

body.pos-ui-v2 .pos-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--pos-ui-border);
  border-radius: 8px;
  background: var(--pos-ui-surface);
  cursor: pointer;
}

body.pos-ui-v2 .pos-record-card:hover {
  border-color: var(--pos-ui-border-strong);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.1);
}

body.pos-ui-v2 .pos-record-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--pos-ui-text);
  font-weight: 700;
}

body.pos-ui-v2 .pos-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.pos-ui-v2 .pos-actions,
body.pos-ui-v2 .pos-form-actions,
body.pos-ui-v2 .pos-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.pos-ui-v2 .pos-checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

body.pos-ui-v2 .pos-toast.show {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: block !important;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--pos-ui-success);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 14px;
}

body.pos-ui-v2 .pos-toast:not(.show) {
  display: none;
}

body.pos-ui-v2 .pos-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

body.pos-ui-v2 .pos-modal.hidden {
  display: none;
}

body.pos-ui-v2 .pos-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

body.pos-ui-v2 .pos-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: 90vh;
  padding: 14px;
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

body.pos-ui-v2 .pos-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pos-ui-border);
}

body.pos-ui-v2 input:not([type="checkbox"]):not([type="radio"]),
body.pos-ui-v2 select,
body.pos-ui-v2 textarea,
body.pos-ui-v2 .pos-filter-input {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--pos-ui-border) !important;
  color: var(--pos-ui-text);
  background: #fff;
  font-size: 14px;
}

body.pos-ui-v2 .pos-filter-input {
  width: 100%;
  margin: 0;
  padding: 0 10px;
  border-radius: 8px;
}

body.pos-ui-v2 .pos-filter-label {
  display: block;
  min-width: 0;
}

body.pos-ui-v2 .pos-filter-label-text {
  display: block;
  margin-bottom: 4px;
  color: var(--pos-ui-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.pos-ui-v2 input:not([type="checkbox"]):not([type="radio"]),
body.pos-ui-v2 select,
body.pos-ui-v2 .pos-filter-input {
  min-height: var(--pos-ui-control-height);
}

body.pos-ui-v2 input:focus,
body.pos-ui-v2 select:focus,
body.pos-ui-v2 textarea:focus {
  border-color: var(--pos-ui-primary) !important;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

body.pos-ui-v2 .pos-filter-grid,
body.pos-ui-v2 [class*="filter-grid"] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

@media (max-width: 767px) {
  body.pos-ui-v2 .pos-filter-grid,
  body.pos-ui-v2 [class*="filter-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  body.pos-ui-v2 .pos-filter-grid.has-extra {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

body.pos-ui-v2 .pos-page-card:has(.pos-filter-grid),
body.pos-ui-v2 section:has([class*="filter-grid"]),
body.pos-ui-v2 .pos-filter-panel {
  padding: 8px !important;
}

body.pos-ui-v2 .pos-filter-panel label {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

body.pos-ui-v2 .pos-group-filter {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

body.pos-ui-v2 .pos-group-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.pos-ui-v2 .pos-group-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--pos-ui-border);
  border-radius: 999px;
  background: var(--pos-ui-surface);
  color: var(--pos-ui-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

body.pos-ui-v2 .pos-group-filter-chip:hover {
  border-color: var(--pos-ui-primary);
  color: var(--pos-ui-primary);
}

body.pos-ui-v2 .pos-group-filter-chip.active {
  border-color: var(--pos-ui-primary);
  background: var(--pos-ui-primary);
  color: #fff;
}

body.pos-ui-v2 .pos-group-filter-count {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  text-align: center;
  font-size: 11px;
}

body.pos-ui-v2 .pos-group-filter-chip.active .pos-group-filter-count {
  background: rgb(255 255 255 / 22%);
  color: #fff;
}

body.pos-ui-v2 .pos-ui-normalized > .pos-standard-topbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -8px -10px 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--pos-ui-border);
  background: var(--pos-ui-surface-soft);
}

body.pos-ui-v2 .pos-standard-card {
  padding: 8px !important;
  border: 1px solid var(--pos-ui-border) !important;
  border-radius: var(--pos-ui-radius) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

body.pos-ui-v2 .pos-smart-grid-wrap {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 190px);
  overflow: auto !important;
  border: 1px solid var(--pos-ui-border);
  border-radius: var(--pos-ui-radius);
  background: var(--pos-ui-surface);
  scrollbar-color: #94a3b8 #eef2f7;
  scrollbar-width: thin;
}

body.pos-ui-v2 .pos-smart-grid-wrap.is-compact {
  max-height: 360px;
}

body.pos-ui-v2 table.pos-smart-grid {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--pos-ui-text);
  font-size: var(--pos-ui-grid-font-size) !important;
  line-height: 1.25;
}

body.pos-ui-v2 table.pos-smart-grid th,
body.pos-ui-v2 table.pos-smart-grid td {
  height: 30px;
  max-width: 0;
  padding: 2px 8px !important;
  overflow: hidden;
  border-right: 1px solid var(--pos-ui-border);
  border-bottom: 1px solid var(--pos-ui-border);
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.pos-ui-v2 table.pos-smart-grid th:last-child,
body.pos-ui-v2 table.pos-smart-grid td:last-child {
  border-right: 0;
}

body.pos-ui-v2 table.pos-smart-grid thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #172033;
  background: #eaf0f7 !important;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

body.pos-ui-v2 table.pos-smart-grid thead tr.pos-smart-grid-filter-row th,
body.pos-ui-v2 table.pos-smart-grid thead tr[class*="filter-row"] th {
  top: 30px;
  z-index: 4;
  height: 32px;
  padding: 3px 5px !important;
  background: #f8fafc !important;
  cursor: default;
}

body.pos-ui-v2 table.pos-smart-grid .pos-smart-grid-filter {
  width: 100%;
  min-width: 0;
  height: 25px !important;
  min-height: 25px !important;
  padding: 2px 6px !important;
  border: 1px solid #bdc9d8 !important;
  border-radius: 5px;
  font-size: 12px !important;
  font-weight: 400;
}

body.pos-ui-v2 table.pos-smart-grid tbody tr:nth-child(even) td {
  background: #f8fafc;
}

body.pos-ui-v2 table.pos-smart-grid tbody tr:hover td {
  background: #eff6ff;
}

body.pos-ui-v2 table.pos-smart-grid tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  height: 31px;
  color: #172033;
  background: #eaf0f7 !important;
  font-weight: 700;
  box-shadow: 0 -1px 0 var(--pos-ui-border-strong);
}

body.pos-ui-v2 table.pos-smart-grid th[aria-sort="ascending"]::after,
body.pos-ui-v2 table.pos-smart-grid th[aria-sort="descending"]::after {
  display: inline-block;
  margin-left: 5px;
  color: var(--pos-ui-primary);
  font-size: 10px;
}

body.pos-ui-v2 table.pos-smart-grid th[aria-sort="ascending"]::after {
  content: "▲";
}

body.pos-ui-v2 table.pos-smart-grid th[aria-sort="descending"]::after {
  content: "▼";
}

body.pos-ui-v2 .pos-grid-stt {
  width: 54px;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

body.pos-ui-v2 .pos-grid-number,
body.pos-ui-v2 .pos-grid-money {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

body.pos-ui-v2 .pos-grid-empty,
body.pos-ui-v2 .pos-grid-feedback {
  padding: 20px 10px !important;
  color: var(--pos-ui-muted);
  text-align: center !important;
}

body.pos-ui-v2 .pos-grid-reset-btn {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--pos-ui-border-strong);
  border-radius: 8px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}

body.pos-ui-v2 .pos-grid-reset-btn:hover {
  border-color: var(--pos-ui-primary);
  color: var(--pos-ui-primary);
  background: #eff6ff;
}

body.pos-ui-v2 .pos-page-topbar-actions .pos-table-tools {
  padding: 0;
}

.pos-excel-export-btn {
  --pos-excel-export-progress: 0%;
  position: relative;
  isolation: isolate;
  min-width: 128px;
  overflow: hidden;
}

.pos-excel-export-btn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: var(--pos-excel-export-progress);
  background: linear-gradient(90deg, #0f766e 0%, #16a34a 100%);
  opacity: 0;
  transition:
    width 0.2s ease,
    opacity 0.16s ease,
    background 0.16s ease;
}

.pos-excel-export-btn.is-exporting::before,
.pos-excel-export-btn.is-export-complete::before,
.pos-excel-export-btn.is-export-error::before {
  opacity: 1;
}

.pos-excel-export-btn.is-export-error::before {
  background: #dc2626;
}

.pos-excel-export-btn .pos-excel-export-label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pos-excel-export-btn:disabled {
  cursor: wait;
  opacity: 1 !important;
}

body.pos-ui-v2 table.pos-smart-grid td > .rounded-full,
body.pos-ui-v2 table.pos-smart-grid td > span[class*="bg-"] {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
}

body.pos-ui-v2 .pos-form-section {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--pos-ui-border);
  border-radius: var(--pos-ui-radius);
  background: var(--pos-ui-surface);
}

body.pos-ui-v2 .pos-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid var(--pos-ui-border);
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(5px);
}

body.pos-ui-v2 [class*="modal"] > [class*="rounded"],
body.pos-ui-v2 [role="dialog"] {
  border: 1px solid var(--pos-ui-border);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.28);
}

@media (max-width: 767px) {
  body.pos-ui-v2 .pos-page-shell,
  body.pos-ui-v2 main[class*="pos-"] {
    padding: 6px;
  }

  body.pos-ui-v2 .pos-page-topbar,
  body.pos-ui-v2 .pos-standard-topbar {
    margin: -6px -6px 6px;
    padding: 6px;
  }

  body.pos-ui-v2 .pos-page-topbar-actions {
    gap: 5px;
    overflow-x: auto;
  }

  body.pos-ui-v2 .pos-smart-grid-wrap {
    max-height: calc(100vh - 170px);
  }
}

/* Report-specific column defaults live here so reports share one visual system. */
.pos-stock-report {
  --pos-stock-col-stt: 48px;
  --pos-stock-col-sku: 108px;
  --pos-stock-col-name: 180px;
  --pos-stock-col-alias: 150px;
  --pos-stock-col-qty: 88px;
  --pos-stock-col-price: 104px;
  --pos-stock-col-amount: 118px;
  --pos-stock-col-in_transit: 96px;
  --pos-stock-col-max: 78px;
  --pos-stock-col-need: 100px;
  --pos-stock-col-unit: 58px;
}

.pos-stock-table-wrap {
  min-height: 300px;
}

.pos-stock-report .stock-negative {
  color: var(--pos-ui-danger);
}

.pos-bctk-report {
  --pos-bctk-col-stt: 48px;
  --pos-bctk-col-default: 112px;
  --pos-bctk-col-pbh: 118px;
  --pos-bctk-col-ngay: 138px;
  --pos-bctk-col-sku: 98px;
  --pos-bctk-col-ten: 180px;
  --pos-bctk-col-qty: 64px;
  --pos-bctk-col-dvt: 58px;
  --pos-bctk-col-nhom: 140px;
  --pos-bctk-col-ly_do: 72px;
  --pos-bctk-col-tra_lai: 68px;
  --pos-bctk-col-kh_ten: 150px;
  --pos-bctk-col-kh_dt: 108px;
  --pos-bctk-col-kh_dchi: 170px;
  --pos-bctk-col-kh_ns: 92px;
  --pos-bctk-col-ghi_chu: 150px;
  --pos-bctk-col-nv_ten: 130px;
  --pos-bctk-col-nv_ma: 76px;
  --pos-bctk-col-httt: 104px;
  --pos-bctk-col-kenh: 90px;
  --pos-bctk-col-so_lo: 100px;
  --pos-bctk-col-exp: 92px;
}

/*
 * BẢNG BÁO CÁO KHÔNG ĐƯỢC GIÃN CỘT ĐỀU.
 *
 * Bảng kiểu `width:100%` + auto-layout sẽ đẩy phần thừa vào TỪNG cột một, nên
 * cột nào cũng nở ra dù chỉ chứa một con số nhỏ (STT, ĐVT, SL cần nhập…) — nhìn
 * bảng rời rạc, và Excel xuất theo bề rộng thật của cột nên cũng rộng lem nhem.
 *
 * Cách xử lý giống màn Đơn hàng: cột số/ngắn giữ nguyên bề rộng px đã khai ở
 * trên, phần dư dồn hết vào cột CHỮ dài (tên hàng / tên khách). Cột nào không
 * có width auto mà vẫn bị giãn là do auto-layout — nên ép table-layout fixed.
 */
.pos-stock-report #pos-stock-table,
.pos-bctk-report #pos-bctk-table {
  table-layout: fixed;
  width: 100%;
}

/* Cột chữ dài (tên hàng/tên khách) nhận TOÀN BỘ phần dư. width:auto phải thắng
   width var đang khai inline trên <col> nên cần !important. Cột số/ngắn không
   liệt kê ở đây sẽ giữ nguyên px khai phía trên — không bị giãn đều nữa. */
.pos-stock-report #pos-stock-table col[data-stock-key="name"],
.pos-bctk-report #pos-bctk-table col[data-bctk-key="ten"],
.pos-bctk-report #pos-bctk-table col[data-bctk-key="kh_ten"] {
  width: auto !important;
  min-width: 160px;
}

.pos-report-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.pos-report-filter-grid .pos-report-filter-search {
  grid-column: span 3;
}

.pos-report-filter-grid.has-kind .pos-report-filter-search {
  grid-column: span 2;
}

.pos-report-filter-grid.is-search-only .pos-report-filter-search {
  grid-column: span 5;
}

.pos-report-filter-card {
  margin-bottom: 8px;
}

.pos-bctk-table-wrap {
  min-height: 260px;
}

.pos-bctk-report .pos-bctk-stt {
  color: #475569;
}

@media (max-width: 760px) {
  .pos-report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-report-filter-grid .pos-report-filter-search,
  .pos-report-filter-grid.has-kind .pos-report-filter-search,
  .pos-report-filter-grid.is-search-only .pos-report-filter-search,
  .pos-report-filter-grid > .pos-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body.pos-ui-v2 .pos-section-head {
    display: grid;
    align-items: stretch;
  }

  body.pos-ui-v2 .pos-filter-row {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.pos-ui-v2 .pos-form-grid {
    grid-template-columns: 1fr;
  }

  body.pos-ui-v2 .pos-module-app > .pos-page-topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
.pos-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 6px 8px;
    color: var(--pos-ui-muted, #64748b);
    font-size: 13px;
}

.pos-pagination__controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos-pagination__button {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--pos-ui-border, #b8c5d6);
    border-radius: 7px;
    background: #fff;
    color: var(--pos-ui-text, #172033);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.pos-pagination__button:hover:not(:disabled):not(.is-active) {
    background: var(--pos-ui-surface-soft, #f8fafc);
}

.pos-pagination__button.is-active {
    border-color: var(--pos-ui-primary, #2563eb);
    background: var(--pos-ui-primary, #2563eb);
    color: #fff;
}

.pos-pagination__button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pos-pagination__gap {
    padding: 0 2px;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .pos-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}
