:root {
  --primary: #0088ff;
  --primary-dark: #0072db;
  --sidebar-bg: #182537;
  --sidebar-hover: #22344c;
  --border: #ebedf0;
  --bg: #f9f9f9;
  --text: #0f1824;
  --muted: #46515f;
  --muted-2: #8c96a3;
  --green: #00a854;
  --orange: #f5a623;
  --red: #e74c3c;
  --blue: #0088ff;
  --gray: #97a0ac;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Material Icons */
.material-icons { font-size: 20px; line-height: 1; vertical-align: middle; user-select: none; }
.card-ic { font-size: 20px; color: var(--muted-2); vertical-align: middle; margin-right: 2px; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: #c5ccd6;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-size: 22px;
  font-weight: 800;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar .logo { color: #fff; }
.sidebar .logo-2 { color: var(--primary); }

.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; }

.sidebar nav a.nav-item {
  color: #c5ccd6;
  padding: 10px 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 11px;
  border-left: 3px solid transparent;
}
.sidebar nav a.nav-item .ic { font-size: 20px; width: 22px; text-align: center; }
.sidebar nav a.nav-item .lbl { flex: 1; }
.sidebar nav a.nav-item .caret { font-size: 18px; color: #7b8595; }
.sidebar nav a.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar nav a.nav-item.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}
/* Menu con */
.sidebar .submenu { background: rgba(0, 0, 0, 0.22); padding: 2px 0 6px; }
.sidebar .submenu a {
  display: block;
  color: #aeb6c2;
  padding: 8px 18px 8px 49px;
  font-size: 13.5px;
  font-weight: 500;
}
.sidebar .submenu a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .submenu a.active { color: #fff; font-weight: 600; }
.sidebar .submenu a.active::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-left: -14px; margin-right: 8px; vertical-align: middle;
}
.sidebar .nav-sep {
  font-size: 11px;
  font-weight: 700;
  color: #5b6470;
  padding: 16px 20px 6px;
  letter-spacing: 0.5px;
}

/* ---------- Content ---------- */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .topbar-title { font-size: 18px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.topbar .search { flex: 1; }
.topbar .search input { width: 100%; max-width: 460px; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; color: inherit; padding: 4px 8px; border-radius: 8px; }
.topbar .user-chip:hover { background: #f4f6f8; }
.topbar .search { position: relative; }
.topbar .search .search-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 20px; }
.topbar .search input {
  width: 420px;
  max-width: 50vw;
  border: 1px solid var(--border);
  background: #f6f7f9;
  border-radius: 6px;
  padding: 8px 12px 8px 36px;
  font-size: 14px;
}
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .bell { font-size: 22px; cursor: pointer; color: var(--muted); }
.topbar .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #ffe0a3; color: #8a6d00;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.topbar .uname { font-weight: 600; }
.topbar .logout-link { color: var(--muted); font-size: 13px; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border); }
.topbar .logout-link:hover { color: var(--red); }

.page { padding: 22px 24px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 20px; font-weight: 600; }
.page-actions { display: flex; gap: 10px; }

/* Thanh công cụ trang: tabs (trái) + nút hành động (phải) cùng 1 hàng */
.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-toolbar.with-tabs { border-bottom: 1px solid var(--border); }
.page-toolbar.with-tabs .tabs { border-bottom: none; margin-bottom: 0; }
.page-toolbar .pt-right { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; flex-shrink: 0; }
.page-toolbar.right-only { justify-content: flex-end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; font-weight: 500; font-size: 14px;
  border: 1px solid #d6dae0; background: #fff; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f4f6f8; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- Cards / KPI ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 24, 36, 0.04);
}
.card-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.card-value { font-size: 26px; font-weight: 800; }
.card-value.green { color: var(--green); }
.card-value.blue { color: var(--primary); }

/* ---------- Panel ---------- */
.panel {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 24, 36, 0.04);
}
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between;
}
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

/* ---------- Table ---------- */
.toolbar {
  display: flex; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; align-items: center;
}
.toolbar input[type="text"], .toolbar select {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 14px;
}
.toolbar input[type="text"] { min-width: 260px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: middle;
}
table.data thead th {
  background: #f4f6f8; color: var(--text); font-weight: 550; font-size: 14px;
  white-space: nowrap;
}
table.data tbody tr:hover { background: #f7f8fa; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data .muted { color: var(--muted); font-size: 13px; }
.link-strong { font-weight: 600; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 4px;
  font-size: 12.5px; font-weight: 500; line-height: 1.6;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.badge.green { background: #e8f7ef; color: #0a8d4e; }
.badge.orange { background: #fef1dc; color: #c07d0a; }
.badge.red { background: #fdeceb; color: #d93b30; }
.badge.blue { background: #e3f1ff; color: #0072db; }
.badge.gray { background: #eff1f4; color: #6b7686; }

/* ---------- Empty state (giống Sapo) ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted-2); }
.empty .big {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #e6f1ff 0%, #f3f8ff 70%);
  display: flex; align-items: center; justify-content: center; font-size: 42px;
}
.empty .big .material-icons { font-size: 46px; color: var(--primary); }
.thumb .material-icons { font-size: 22px; color: #b5bcc6; }
.b-ic .material-icons { font-size: 20px; color: var(--primary); }
.card-value .material-icons { font-size: 24px; }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 16px; font-weight: 600; }
.empty p { color: var(--muted-2); max-width: 420px; margin: 0 auto; }
.empty .empty-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { margin-bottom: 16px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.form-row .req { color: var(--red); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a {
  padding: 10px 16px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  background: #eef0f3; display: inline-flex; align-items: center; justify-content: center;
  color: #b5bcc6; font-size: 18px;
}

.flash {
  background: #e3f7ec; color: var(--green); border: 1px solid #b6e7c9;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600;
}

/* ---------- Toggle switch (giống Sapo) ---------- */
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.switch-row .switch-label { font-weight: 500; }
.switch-row .switch-sub { color: var(--muted); font-size: 12px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #c3cad4;
  border-radius: 22px; transition: 0.2s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Ô upload ảnh */
.upload-box {
  border: 1.5px dashed #c3cad4; border-radius: 10px; padding: 30px 16px;
  text-align: center; color: var(--muted);
}
.upload-box .plus { font-size: 22px; color: var(--primary); }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 30px; }
.input-suffix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Toolbar giả lập editor */
.fake-editor { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fake-editor .ed-toolbar {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 8px 10px; background: #f8f9fb; border-bottom: 1px solid var(--border);
  color: #515a66; font-size: 13px;
}
.fake-editor .ed-toolbar span { padding: 2px 6px; border-radius: 4px; cursor: default; }
.fake-editor textarea { width: 100%; border: none; padding: 12px; min-height: 150px; resize: vertical; font-family: inherit; font-size: 14px; }
.fake-editor .ed-foot { text-align: right; padding: 4px 10px; color: var(--muted); font-size: 12px; }

.subpanel-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Lưới ảnh sản phẩm */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.img-thumb {
  position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  aspect-ratio: 1/1; background: #f4f6f8; display: block;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb .img-remove {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(231,60,48,.92); color: #fff;
  font-size: 11px; text-align: center; padding: 3px; cursor: pointer;
}
.img-thumb .img-remove input { margin-right: 3px; }

/* Gallery ở trang chi tiết */
.gallery-main { width: 100%; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; aspect-ratio: 1/1; background: #f4f6f8; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: #c2c9d2; font-size: 48px; }

/* ---------- Rich text editor ---------- */
.rte { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rte-toolbar { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; padding: 6px 8px; background: #f8f9fb; border-bottom: 1px solid var(--border); }
.rte-toolbar button, .rte-toolbar select { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 5px 9px; cursor: pointer; font-size: 14px; color: #46515f; min-width: 30px; }
.rte-toolbar button:hover, .rte-toolbar select:hover { background: #e7ebf0; }
.rte-toolbar input[type=color] { width: 28px; height: 26px; border: none; background: none; cursor: pointer; padding: 0; }
.rte-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rte-body { min-height: 160px; padding: 12px 14px; font-size: 14px; outline: none; }
.rte-body:empty::before { content: attr(data-ph); color: #aab2bd; }
.rte-body p { margin: 0 0 8px; }

/* ---------- Bảng biến thể ---------- */
.variant-table { width: 100%; border-collapse: collapse; }
.variant-table th, .variant-table td { border: 1px solid var(--border); padding: 8px; font-size: 13px; vertical-align: middle; }
.variant-table th { background: #f4f6f8; font-weight: 550; text-align: left; white-space: nowrap; }
.variant-table td input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font-size: 13px; }
.variant-table .vname { font-weight: 600; white-space: nowrap; }
.variant-img { width: 44px; height: 44px; border-radius: 6px; border: 1px dashed #c3cad4; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; background: #f7f8fa; position: relative; }
.variant-img img { width: 100%; height: 100%; object-fit: cover; }
.variant-img .vi-plus { color: #aab2bd; font-size: 18px; }

/* ---------- SEO preview ---------- */
.seo-preview { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; background: #fff; margin-top: 14px; }
.seo-preview .seo-url { color: #5f6b7a; font-size: 13px; }
.seo-preview .seo-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin: 2px 0; }
.seo-preview .seo-desc { color: #4d5156; font-size: 13px; }

/* ---------- Settings layout ---------- */
.settings-wrap { display: grid; grid-template-columns: 248px 1fr; gap: 20px; align-items: start; }
.settings-nav { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px; position: sticky; top: 70px; box-shadow: 0 1px 2px rgba(15,24,36,.04); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: var(--text); font-weight: 500; font-size: 13.5px; }
.settings-nav a .ic { width: 20px; text-align: center; font-size: 19px; }
.settings-nav a:hover { background: #f4f6f8; }
.settings-nav a.active { background: #e3f1ff; color: var(--primary); }
.set-overview-bar { height: 8px; background: #e7ebf0; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.set-overview-bar > div { height: 100%; background: var(--primary); }
.set-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); }
.set-row b { color: var(--text); }
.info-box { background: #eaf4ff; border: 1px solid #c5e1ff; color: #1a4e7a; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.radio-card.sel, .radio-card:hover { border-color: var(--primary); background: #f5faff; }
.radio-card input { margin-top: 3px; }
.branch-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.branch-item .b-ic { width: 38px; height: 38px; border-radius: 8px; background: #eef3f9; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* Khối sản phẩm nhập/xuất (gộp nhiều biến thể) */
.prod-block { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.prod-block .pb-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #f8f9fb; border-bottom: 1px solid var(--border); }
.prod-block .pb-head .prod-sel { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.prod-block .pb-variants { padding: 4px 12px; }
.vtbl { width: 100%; border-collapse: collapse; }
.vtbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px 6px; }
.vtbl th.num, .vtbl td.num { text-align: right; }
.vtbl td { padding: 6px 8px; border-top: 1px solid #f0f2f5; font-size: 13.5px; }
.vtbl .qin, .pb-variants .qin { width: 90px; border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; text-align: right; font-size: 13.5px; }
.pb-variants .vline { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px; }

.logo-preview { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--border); background: #f4f6f8;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview .material-icons { color: #c2c9d2; font-size: 30px; }
.topbar .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Chip biến thể + modal */
.vchips { display: flex; flex-wrap: wrap; gap: 6px; cursor: pointer; }
.vchip { background: #eef2f7; border-radius: 4px; padding: 2px 8px; font-size: 12.5px; }
.vchip b { color: var(--primary); }
.modal-mask { position: fixed; inset: 0; background: rgba(15,24,36,.45); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; width: 460px; max-width: 92vw; max-height: 82vh; overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.modal-box .m-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-box .m-head .close { cursor: pointer; color: var(--muted); }
.modal-box .m-body { padding: 4px 0; }

/* ---------- POS ---------- */
.pos-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pos-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.pos-card:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(0,136,255,.14); }
.pos-card .pc-img { height: 108px; background: #f4f6f8; display: flex; align-items: center; justify-content: center; }
.pos-card .pc-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-card .pc-img .material-icons { color: #c2c9d2; font-size: 34px; }
.pos-card .pc-body { padding: 8px 10px; }
.pos-card .pc-name { font-weight: 600; font-size: 13.5px; line-height: 1.35; height: 37px; overflow: hidden; }
.pos-card .pc-price { color: var(--primary); font-weight: 700; margin-top: 4px; }
.pos-card .pc-stock { color: var(--muted-2); font-size: 12px; }
.pos-cart { background: #fff; border: 1px solid var(--border); border-radius: 10px; position: sticky; top: 70px; display: flex; flex-direction: column; max-height: calc(100vh - 90px); }
.pos-cart .pc-head { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.pos-cart .pc-lines { flex: 1; overflow-y: auto; padding: 6px 0; min-height: 120px; }
.pos-line { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid #f0f2f5; }
.pos-line .pl-name { flex: 1; font-size: 13.5px; }
.pos-line .pl-name small { color: var(--muted-2); display: block; }
.pos-qty { display: flex; align-items: center; gap: 4px; }
.pos-qty button { width: 26px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; }
.pos-qty input { width: 40px; text-align: center; border: 1px solid var(--border); border-radius: 6px; padding: 4px; }
.pos-cart .pc-foot { border-top: 1px solid var(--border); padding: 14px 16px; }
.pos-cart .pc-foot .row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pos-cart .pc-total { font-size: 20px; font-weight: 800; color: var(--green); }
.pos-empty { text-align: center; color: var(--muted-2); padding: 40px 10px; }

/* POS full-screen layout (giống Sapo POS) */
.pos-body { background: #eef1f5; }
.pos-topbar { height: 56px; background: var(--primary); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; position: sticky; top: 0; z-index: 30; }
.pos-topbar .pos-brand { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pos-topbar .pos-brand .b2 { color: #ffe08a; }
.pos-topbar .pos-brand .sep { opacity: .5; font-weight: 400; }
.pos-topbar .pos-search { flex: 1; max-width: 560px; display: flex; align-items: center; background: #fff; border-radius: 8px; padding: 0 12px; height: 38px; }
.pos-topbar .pos-search .material-icons { color: var(--muted-2); font-size: 20px; }
.pos-topbar .pos-search input { border: none; outline: none; flex: 1; padding: 0 8px; font-size: 14px; }
.pos-topbar .pos-tab { background: rgba(255,255,255,.18); border-radius: 8px 8px 0 0; padding: 8px 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; align-self: flex-end; height: 40px; }
.pos-topbar .pos-tb-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.pos-topbar .pos-tb-right .b-info { text-align: right; line-height: 1.2; }
.pos-topbar .pos-tb-right .b-info small { display: block; opacity: .8; font-size: 11px; }
.pos-topbar .back-crm { color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.pos-topbar .back-crm:hover { background: rgba(255,255,255,.15); }
.pos-topbar .pos-user { display: flex; align-items: center; gap: 8px; }
.pos-topbar .pos-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: #ffe0a3; color: #8a6d00; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; overflow: hidden; }
.pos-topbar .pos-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.pos-topbar .pos-tabs { display: flex; align-items: flex-end; gap: 4px; align-self: flex-end; height: 46px; }
.pos-topbar .pos-tab { background: rgba(255,255,255,.16); color: #fff; border-radius: 8px 8px 0 0; padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pos-topbar .pos-tab.active { background: #eef1f5; color: var(--primary); }
.pos-topbar .pos-tab .tn { background: var(--primary); color: #fff; border-radius: 20px; padding: 0 6px; font-size: 11px; }
.pos-topbar .pos-tab.active .tn { background: var(--primary); color: #fff; }
.pos-topbar .pos-tab .x { opacity: .7; font-size: 15px; }
.pos-topbar .pos-tab .x:hover { opacity: 1; }
.pos-topbar .pos-tab.add { background: rgba(255,255,255,.16); font-size: 18px; padding: 7px 12px; }

/* Rail chức năng trái (giống Sapo POS) */
.pos-shell { display: flex; min-height: calc(100vh - 56px); }
.pos-rail { width: 62px; background: var(--sidebar-bg); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 4px; position: sticky; top: 56px; height: calc(100vh - 56px); }
.pos-rail a { width: 46px; height: 46px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9aa6b5; font-size: 9px; gap: 2px; text-align: center; line-height: 1; }
.pos-rail a .material-icons { font-size: 22px; }
.pos-rail a:hover { background: var(--sidebar-hover); color: #fff; }
.pos-rail a.active { background: var(--primary); color: #fff; }
.pos-rail .sep { flex: 1; }
.pos-main { flex: 1; padding: 14px 16px; min-width: 0; }

/* Phân trang POS */
.pos-pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.pos-pager button { min-width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; }
.pos-pager button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pos-pager button:disabled { opacity: .5; cursor: default; }
.pos-cart .pc-total-block { padding: 12px 16px; border-top: 1px solid var(--border); }
.pos-cart .pc-total-block .row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.pos-cart .pc-total-block .grand { font-size: 15px; } .pos-cart .pc-total-block .grand b:last-child { font-size: 22px; color: var(--primary); }

/* Payment modal */
.pay-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-method { flex: 1; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; font-weight: 600; }
.pay-method.sel { border-color: var(--primary); background: #f5faff; color: var(--primary); }
.pay-method .material-icons { display: block; margin: 0 auto 4px; }
.qr-box { text-align: center; padding: 10px; }
.qr-box img { width: 240px; height: 240px; border: 1px solid var(--border); border-radius: 8px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pay-row input { width: 160px; text-align: right; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 15px; }
.change-amt { color: var(--green); font-weight: 700; font-size: 18px; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.quick-cash button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.quick-cash button:hover { border-color: var(--primary); color: var(--primary); }
