:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e8dfd6;
  --text: #211d18;
  --muted: #7e756c;
  --brand: #d9571c;
  --brand-dark: #c94b14;
  --success: #2f9e5c;
  --danger: #d1453b;
  --warn: #c98a1a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
}

nav.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav.topbar .brand {
  font-size: 21px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0;
}

nav.topbar .brand span {
  color: var(--text);
  font-weight: 400;
  font-size: 13px;
  margin-left: 8px;
}

nav.topbar .links {
  display: flex;
  gap: 22px;
  align-items: center;
}

nav.topbar .links a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

nav.topbar .links a.active {
  color: var(--brand-dark);
}

nav.topbar .cart-pill {
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px;
}

h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px;
}

p.lead {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14.5px;
}

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(30, 20, 10, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card .emoji {
  font-size: 40px;
}

.product-card .name {
  font-weight: 600;
  font-size: 14.5px;
}

.product-card .price {
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 15px;
}

.product-card button {
  margin-top: 6px;
}

button {
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.12s;
}

button:hover {
  filter: brightness(1.06);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

button.ghost {
  background: transparent;
  color: var(--brand-dark);
  padding: 6px 10px;
  font-size: 13px;
}

button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.button-link.secondary-link {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(30, 20, 10, 0.04);
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 5px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 56px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.cart-row:last-child {
  border-bottom: none;
}

.cart-row .qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-row .qty-controls button {
  padding: 3px 9px;
  font-size: 13px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  font-weight: 800;
  font-size: 16px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.pending,
.badge.PENDING_DISPATCH {
  background: #fdecd2;
  color: var(--warn);
}

.badge.dispatching,
.badge.DISPATCHING {
  background: #fdecd2;
  color: var(--warn);
}

.badge.dispatched,
.badge.DISPATCHED {
  background: #dcefe0;
  color: var(--success);
}

.badge.completed {
  background: #d7ecff;
  color: #2166b0;
}

.badge.cancelled,
.badge.CANCELLED,
.badge.failed,
.badge.FAILED {
  background: #fadbd8;
  color: var(--danger);
}

.order-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--surface);
}

.order-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-item .title {
  font-weight: 700;
  font-size: 14.5px;
}

.order-item .meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.order-item .history {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.order-item .history span {
  display: inline-block;
  margin-right: 10px;
}

.cancel-reason {
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  background: #fdecea;
  border: 1px solid #f5c6c1;
  color: var(--danger);
  font-size: 12.5px;
}

.order-item .items {
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #faf7f0;
}

.order-item .items-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.order-item .items-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
}

.order-item .items-row+.items-row {
  border-top: 1px dashed var(--border);
}

.order-item .items-row .name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-item .items-row .qty {
  color: var(--muted);
  white-space: nowrap;
}

.order-item .items-row .line-total {
  white-space: nowrap;
  font-weight: 600;
}

.delivery-route {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.delivery-route[hidden] {
  display: none;
}

.route-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.route-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-copy strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 650;
}

.route-map {
  width: 100%;
  height: 250px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f1ece3;
}

.route-loading,
.route-error {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.route-error {
  color: var(--danger);
  background: #fff8f7;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  max-width: 360px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.err {
  background: var(--danger);
}

.toast.ok {
  background: var(--success);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 6px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

code.inline {
  background: #f1ece3;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

.pos-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #fffdfb 0%, #fbfaf7 100%);
}

.pos-page nav.topbar {
  min-height: 86px;
  padding: 0 38px;
  box-shadow: 0 1px 0 rgba(44, 31, 21, 0.08);
}

.pos-page nav.topbar .brand {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--brand-dark);
  font-size: 26px;
  letter-spacing: 0;
}

.pos-page nav.topbar .brand span {
  color: #2b2520;
  margin-left: 0;
}

.pos-page nav.topbar .links {
  gap: 26px;
  margin-left: auto;
  margin-right: auto;
}

.pos-page nav.topbar .links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  min-height: 86px;
  border-radius: 0;
  padding: 0 2px;
  color: #2b2520;
  white-space: nowrap;
}

.pos-page nav.topbar .links a.active {
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
}

.pos-page nav.topbar .links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.pos-page nav.topbar .links a span {
  font-size: 16px;
  line-height: 1;
}

.pos-page nav.topbar .links .cart-pill {
  display: none;
}

.pos-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  color: #2b2520;
  font-size: 13px;
  white-space: nowrap;
}

.pos-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-right: 1px solid var(--border);
  color: var(--muted);
}

.pos-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 37%, #ffffff 0 15%, transparent 16%),
    radial-gradient(circle at 50% 88%, #ffffff 0 28%, transparent 29%),
    linear-gradient(135deg, #eee9e4, #d9d3cc);
}

.pos-main {
  max-width: 1500px;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 520px;
  gap: 28px;
  align-items: start;
  padding: 34px 38px 44px;
}

.pos-products-panel,
.pos-ticket-panel {
  min-width: 0;
}

.pos-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 164px);
}

.pos-search-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 18px;
  margin-bottom: 26px;
}

.pos-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pos-search-box span {
  color: var(--muted);
  font-size: 18px;
}

.pos-search-box input {
  border: 0;
  padding: 0;
  background: transparent;
  outline: 0;
  font-size: 16px;
}

.pos-scan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 800;
}

.pos-category-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.pos-category {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 92px;
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(44, 31, 21, 0.04);
}

.pos-category.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.pos-product-tile {
  min-height: 252px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(44, 31, 21, 0.04);
}

.pos-product-tile:hover {
  filter: none;
  border-color: rgba(217, 98, 43, .55);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(44, 31, 21, 0.09);
}

.pos-product-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 118px;
  margin-bottom: 10px;
}

.pos-product-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fbfbfb, #eee9e3);
  box-shadow: 0 18px 34px rgba(44, 31, 21, 0.08);
  font-size: 62px;
  line-height: 1;
}

.pos-product-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.pos-product-tile strong {
  color: var(--brand-dark);
  font-size: 17px;
  margin-top: auto;
}

.pos-product-tile small {
  display: none;
}

.pos-empty-products {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.pos-ticket-panel {
  position: sticky;
  top: 112px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0;
  box-shadow: 0 12px 32px rgba(44, 31, 21, 0.05);
  overflow: hidden;
}

.pos-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 28px 26px;
  border-bottom: 1px solid var(--border);
}

.pos-ticket-head h2 {
  margin: 0;
  font-size: 22px;
}

.pos-ticket-columns {
  display: none;
}

.pos-ticket-items {
  min-height: 330px;
  max-height: 370px;
  overflow: auto;
  padding: 16px 26px;
}

.pos-ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 82px 28px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1ebe5;
}

.pos-ticket-row:last-child {
  border-bottom: none;
}

.pos-ticket-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-ticket-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.pos-ticket-info span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.pos-ticket-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  background: #f8f5f0;
  font-size: 24px;
}

.pos-ticket-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  justify-self: end;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pos-ticket-controls button {
  width: 28px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 18px;
  font-weight: 500;
}

.pos-ticket-controls span {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.pos-ticket-row>b {
  justify-self: end;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.pos-remove-line {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-self: end;
  color: var(--brand);
  background: #fff6f1;
  border-color: #f2d5c7;
}

.pos-ticket-empty {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.pos-ticket-empty span {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
  border-radius: 28px;
  background: #f3e3d8;
  color: #a98b7a;
  font-size: 46px;
}

.pos-ticket-empty strong {
  color: var(--text);
  font-size: 17px;
}

.pos-ticket-empty p {
  margin: 6px 0 0;
}

.pos-ticket-summary {
  padding: 22px 26px 8px;
  border-top: 1px solid var(--border);
}

.pos-ticket-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--text);
}

.pos-ticket-summary b {
  font-size: 15px;
}

.pos-ticket-summary .grand-total {
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid #f1ebe5;
  font-weight: 800;
}

.pos-ticket-summary strong {
  color: var(--brand-dark);
  font-size: 26px;
}

.pos-customer-form {
  padding-top: 0;
}

.pos-customer-form textarea {
  min-height: 46px;
}

.pos-subpanel {
  margin: 12px 26px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.pos-subpanel summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
  list-style: none;
}

.pos-subpanel summary::-webkit-details-marker {
  display: none;
}

.pos-subpanel summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.pos-subpanel[open] summary::after {
  content: "−";
}

.pos-subpanel[open] .pos-form-grid {
  margin-top: 14px;
}

.pos-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-page label {
  margin-top: 8px;
}

.pos-page input,
.pos-page textarea {
  border-radius: 8px;
  min-height: 38px;
}

.pos-pay-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: calc(100% - 52px);
  min-height: 62px;
  margin: 24px 26px 26px;
  padding: 0 22px;
  border-radius: 10px;
  background: linear-gradient(180deg, #e76120, #d95017);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(217, 87, 28, 0.22);
}

.pos-pay-button::after {
  content: attr(data-total);
}

.pos-shortcuts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  padding-top: 34px;
  min-width: 0;
}

.pos-shortcuts button {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 8px 14px;
  border-radius: 10px;
  text-align: left;
  overflow: hidden;
}

.pos-shortcuts button>span {
  grid-row: 1 / 3;
  font-size: 20px;
}

.pos-shortcuts b {
  font-size: 12px;
}

.pos-shortcuts small {
  color: var(--text);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-shortcuts .accent {
  color: var(--brand);
  background: #fff7f2;
  border-color: #f0d0c0;
}

@media (max-width: 720px) {
  nav.topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  nav.topbar .links {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  main {
    padding: 20px;
  }

  .cart-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .row2,
  .route-copy {
    grid-template-columns: 1fr;
  }

  .pos-page nav.topbar {
    padding: 12px 18px;
  }

  .pos-page nav.topbar .links a {
    min-height: 34px;
    padding: 0 9px;
  }

  .pos-page nav.topbar .links .cart-pill {
    position: static;
  }

  .pos-user {
    display: none;
  }

  .pos-main {
    grid-template-columns: 1fr;
    padding: 18px 14px 80px;
  }

  .pos-ticket-panel {
    position: static;
  }

  .pos-search-row,
  .pos-form-grid {
    grid-template-columns: 1fr;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .pos-product-tile {
    min-height: 206px;
    padding: 12px;
  }

  .pos-product-visual {
    min-height: 88px;
  }

  .pos-product-emoji {
    width: 70px;
    height: 70px;
    font-size: 42px;
  }

  .pos-ticket-columns {
    display: none;
  }

  .pos-ticket-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pos-ticket-controls {
    justify-self: end;
    min-width: 104px;
  }

  .pos-ticket-row>b {
    grid-column: 1 / 2;
    justify-self: start;
  }

  .pos-remove-line {
    grid-column: 2 / 3;
  }

  .pos-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .pos-page nav.topbar {
    flex-wrap: wrap;
    padding: 12px 22px;
  }

  .pos-page nav.topbar .links {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .pos-page nav.topbar .links .cart-pill {
    position: static;
  }

  .pos-main {
    grid-template-columns: 1fr;
  }

  .pos-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-ticket-panel {
    position: static;
  }
}

@media (min-width: 981px) and (max-width: 1240px) {
  .pos-main {
    grid-template-columns: minmax(520px, 1fr) minmax(440px, 520px);
  }

  .pos-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cgv-pos-page {
  background: #f4f4f2;
}

.cgv-pos-page .cgv-pos-nav {
  border-bottom: 1px solid #d5d0c3;
  box-shadow: none;
}

.cgv-pos-main {
  display: grid;
  grid-template-columns: minmax(860px, 1fr) 330px;
  gap: 0;
  /* ĐÃ ĐỔI TỪ 10px SANG 0 */
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 10px;
}

.cgv-register {
  min-width: 0;
  min-height: 0;
}

.cgv-screen {
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) auto auto;
  height: calc(100vh - 20px);
  min-height: calc(100vh - 20px);
  overflow: hidden;
  border: 2px solid #8e9bbb;
  border-right: none;
  /* ĐÃ THÊM: Xóa viền bên phải */
  background:
    repeating-linear-gradient(45deg, rgba(122, 115, 85, 0.06) 0 1px, transparent 1px 5px),
    #f0eedf;
  box-shadow: none;
  /* ĐÃ SỬA: Xóa bóng đổ chia cắt */
}

.cgv-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 34px;
  border-bottom: 2px solid #bcb9a7;
}

.cgv-tab {
  border: 0;
  border-right: 2px solid #8f8c80;
  border-radius: 0;
  background: #eee9d5;
  color: #568ee8;
  font-weight: 800;
  padding: 0;
}

.cgv-tab.active {
  background: #f5f2df;
  color: #3b79dc;
}

.cgv-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 0;
  padding: 14px 8px 8px 8px;
  /* ĐÃ SỬA: Thêm padding top vì đã bỏ search bar */
}

.cgv-left-lane,
.cgv-product-area,
.cgv-order-area {
  border: 2px solid #c5c0ad;
  background: rgba(246, 243, 223, 0.72);
  min-width: 0;
}

.cgv-left-lane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  overflow: hidden;
}

.cgv-lane-spacer,
.cgv-lane-gap {
  display: none;
}

.cgv-left-lane .cgv-sale-tile {
  flex: 1 1 0;
  min-height: 142px;
}

.cgv-product-area {
  margin-left: 8px;
  padding: 7px;
  overflow: hidden;
}

.cgv-search {
  display: grid;
  grid-template-columns: 150px 1fr 70px;
  gap: 6px;
  align-items: center;
  height: 42px;
  margin-bottom: 6px;
  padding: 5px;
  border: 2px solid #c5c0ad;
  background: #eee9d5;
}

.cgv-search span {
  color: #9b988a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.cgv-search input {
  height: 30px;
  min-height: 30px;
  border-radius: 0;
  border: 1px solid #9b988a;
  background: #fffef4;
  font-size: 13px;
}

.cgv-search button,
.cgv-order-title button,
.cgv-upsell-actions button,
.cgv-qty button,
.cgv-action-strip button,
.cgv-category-strip button {
  border-radius: 0;
  border: 2px outset #eee9d5;
  background: #eee9d5;
  color: #1f1d19;
  box-shadow: none;
}

.cgv-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cgv-sale-tile {
  display: grid;
  place-items: center;
  min-height: clamp(130px, 15vh, 170px);
  border: 2px outset #f0eeee;
  border-radius: 0;
  background:
    repeating-linear-gradient(160deg, rgba(255, 255, 185, 0.3) 0 1px, transparent 1px 6px),
    #f064df;
  color: #222;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  padding: 10px;
}

.cgv-sale-tile.warning {
  background:
    repeating-linear-gradient(160deg, rgba(255, 221, 90, 0.28) 0 1px, transparent 1px 6px),
    #ff696d;
}

.cgv-sale-tile.pink {
  background:
    repeating-linear-gradient(160deg, rgba(255, 255, 185, 0.3) 0 1px, transparent 1px 6px),
    #ef65df;
}

.cgv-sale-tile:hover,
.cgv-category-strip button:hover,
.cgv-action-strip button:hover {
  filter: brightness(1.04);
}

.cgv-sale-tile small {
  display: block;
  margin-top: 3px;
  color: #24211d;
  font-size: 12px;
}

.cgv-item-icon {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(28px, 3.2vh, 40px);
  line-height: 1;
}

.cgv-order-area {
  position: relative;
  margin-left: 8px;
  padding: 7px;
  border-color: #e00;
}

.cgv-order-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 6px;
  border-bottom: 2px solid #c5c0ad;
}

.cgv-order-title strong {
  font-size: 15px;
}

.cgv-ticket-items {
  height: calc(100vh - 260px);
  min-height: 0;
  overflow: auto;
  padding: 8px 0;
}

.cgv-empty,
.cgv-empty-order {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: #777261;
  font-size: 13px;
  font-weight: 700;
}

.cgv-ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  padding: 7px;
  border: 1px solid #c8c3af;
  background: #fffde9;
  color: #111;
  font-size: 12px;
}

.cgv-ticket-row+.cgv-ticket-row {
  margin-top: 5px;
}

.cgv-ticket-row strong,
.cgv-ticket-row span {
  display: block;
  overflow-wrap: anywhere;
}

.cgv-ticket-row b {
  white-space: nowrap;
}

.cgv-qty {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 28px 34px 28px 28px;
  width: 118px;
  margin-left: auto;
}

.cgv-qty button {
  height: 24px;
  padding: 0;
  font-size: 13px;
}

.cgv-qty span {
  display: grid;
  place-items: center;
  border-top: 1px solid #999;
  border-bottom: 1px solid #999;
  background: #fff;
  font-weight: 800;
}

.cgv-upsell {
  position: absolute;
  left: 46px;
  right: 46px;
  top: 225px;
  border: 3px solid #1d55d5;
  background: #fefefe;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.24);
}

.cgv-window-bar {
  height: 26px;
  padding: 3px 7px;
  background: linear-gradient(180deg, #2d8df7, #0d4fc7);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.cgv-upsell-body {
  padding: 8px;
  min-height: 146px;
}

.cgv-upsell-body button {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  padding: 6px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #fff9b8;
  color: #111;
  text-align: left;
}

.cgv-upsell-body button+button {
  margin-top: 6px;
}

.cgv-upsell-body small {
  grid-column: 1 / -1;
  color: #333;
}

.cgv-upsell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px;
  border-top: 2px solid #d4d0be;
}

.cgv-category-strip {
  display: grid;
  grid-template-columns: 86px repeat(4, 1fr) 86px;
  gap: 0;
  border-top: 2px solid #bcb9a7;
}

.cgv-category-strip::before,
.cgv-category-strip::after {
  display: grid;
  place-items: center;
  min-height: clamp(46px, 5.2vh, 58px);
  border: 2px outset #eee9d5;
  background: #eee9d5;
  color: #d00;
  font-size: 24px;
}

.cgv-category-strip::before {
  content: "◀";
}

.cgv-category-strip::after {
  content: "▶";
}

.cgv-category-strip button {
  min-height: clamp(46px, 5.2vh, 58px);
  padding: 5px;
  font-weight: 800;
}

.cgv-category-strip button.active {
  color: #d00;
  background: #f6f2de;
}

.cgv-action-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-top: 2px solid #bcb9a7;
}

.cgv-action-strip button,
.cgv-action-strip a {
  display: grid;
  place-items: center;
  min-height: clamp(46px, 5.6vh, 60px);
  padding: 6px;
  border: 2px outset #eee9d5;
  background: #eee9d5;
  color: #1f1d19;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.cgv-action-strip button:disabled,
.cgv-action-strip a[aria-disabled="true"] {
  color: #c9c4b2;
  opacity: 1;
}

.cgv-payment-panel {
  align-self: start;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  min-height: calc(100vh - 20px);
  height: calc(100vh - 20px);
  overflow: hidden;
  border: 2px solid #8e9bbb;
  border-left: 2px solid #8e9bbb;
  background: #f0eedf;
  color: #111;
  box-shadow: none;
}

.cgv-payment-head {
  padding: 16px;
  border-bottom: 2px solid #bcb9a7;
  background: #fffde9;
}

.cgv-payment-head span,
.cgv-payment-head strong {
  display: block;
}

.cgv-payment-head span {
  color: #777261;
  font-size: 13px;
  font-weight: 800;
}

.cgv-payment-head strong {
  margin-top: 4px;
  color: #d00;
  font-size: 26px;
}

.cgv-payment-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #c5c0ad;
}

.cgv-payment-panel .cgv-order-area {
  min-height: 0;
  margin: 0;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #c5c0ad;
  background: transparent;
  overflow: hidden;
}

.cgv-payment-panel .cgv-order-title {
  min-height: 38px;
}

.cgv-payment-panel .cgv-ticket-items {
  height: auto;
  min-height: 0;
}

.cgv-payment-panel .cgv-ticket-row {
  grid-template-columns: minmax(0, 1fr);
}

.cgv-payment-panel .cgv-ticket-row b {
  justify-self: start;
}

.cgv-customer-form {
  padding: 14px 16px;
}

.cgv-customer-form summary {
  cursor: pointer;
  font-weight: 800;
}

.cgv-customer-form label {
  color: #4a473e;
}

.cgv-customer-form input,
.cgv-customer-form textarea {
  border-radius: 0;
  border: 1px solid #9b988a;
  background: #fffef4;
}

.cgv-pay-button {
  width: calc(100% - 32px);
  min-height: 54px;
  margin: 4px 16px 16px;
  border: 2px outset #ff7777;
  border-radius: 0;
  background: #f05d60;
  color: #111;
  font-weight: 900;
}

@media (min-width: 981px) and (max-width: 1360px) {
  .cgv-pos-main {
    grid-template-columns: minmax(720px, 1fr) 310px;
  }

  .cgv-workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .cgv-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cgv-sale-tile {
    min-height: clamp(122px, 14vh, 152px);
  }
}

@media (max-width: 980px) {
  .cgv-pos-main {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .cgv-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .cgv-screen,
  .cgv-payment-panel {
    display: block;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .cgv-ticket-items {
    height: auto;
    min-height: 220px;
  }

  .cgv-left-lane,
  .cgv-product-area,
  .cgv-order-area {
    margin: 0 0 8px;
  }

  .cgv-left-lane {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cgv-left-lane .cgv-sale-tile {
    min-height: 116px;
  }

  .cgv-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cgv-category-strip,
  .cgv-action-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cgv-category-strip::before,
  .cgv-category-strip::after {
    display: none;
  }
}