/* Global Top Bar */
.topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffffcc; /* translucent white */
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px; /* hai bên 14px = var(--pad), trùng với card bên dưới */
  z-index: 1000;
}
.topbar .tb-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto; /* giữ kích thước cố định, không bị kéo dãn bởi flex */
}
.topbar .tb-btn svg { width: 20px; height: 20px; fill: #374151; }
.topbar .tb-title {
  font-weight: 700;
  color: #111;
  font-size: 14px;
  white-space: nowrap; /* tránh rớt dòng tiêu đề */
  flex-shrink: 0;      /* ưu tiên co phần search thay vì tiêu đề */
}

.topbar .tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .tb-checkin-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

/* Products search in topbar */
.topbar .tb-products-search {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 4px;
  flex: 1;
  position: relative; /* cho phép đặt icon quét absolute bên trong */
}

.topbar .tb-products-input {
  flex: 1;
  min-width: 0;
  height: 42px; /* tối ưu cho mobile, gần kích thước ngón tay */
  padding: 8px 40px 8px 12px; /* chừa chỗ cho icon quét bên phải */
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  position: relative;
  z-index: 0;
}

.topbar .tb-products-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  cursor: pointer;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1; /* nổi lên trên input để click được */
}

/* Orders search in topbar */
.topbar .tb-orders-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  flex: 1 1 auto; /* chiếm phần còn lại bên phải, co giãn theo màn hình */
}

.topbar .tb-orders-input-wrap {
  position: relative;
  flex: 1;
}

.topbar .tb-orders-input {
  flex: 1 1 auto;
  min-width: 0;
  width:100%;
  height: 42px;
  padding: 8px 38px 8px 12px; /* chừa chỗ cho nút X bên phải */
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
}

.topbar .tb-orders-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topbar .tb-orders-clear.show {
  display: inline-flex;
}

.topbar .tb-orders-scan {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  cursor: pointer;
  z-index: 999;
}

.topbar .tb-orders-scan svg {
  width: 20px;
  height: 20px;
  fill: #374151; /* giống màu icon menu/products */
}
