/* 侧栏底部用户区始终可见，列表在内部滚动 */
main.flex.h-full.overflow-hidden > section.w-60.min-w-60 {
  min-height: 0;
  overflow: hidden;
}

main.flex.h-full.overflow-hidden > section.w-60.min-w-60 > div.h-10.w-full.flex.items-center {
  flex-shrink: 0;
}

main.flex.h-full.overflow-hidden > section.w-60.min-w-60 > div.w-full.flex-1.flex.flex-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

main.flex.h-full.overflow-hidden > section.w-60.min-w-60 > div.w-full.flex-1.flex.flex-col > div.overflow-y-auto[data-sidebar-flex-fill='1'] {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}

/* 在线客服：企业微信二维码，尺寸在原 104px 基础上增加 1/3 */
.ant-popover.qrcode .sidebar-customer-qr-img {
  display: block;
  width: calc(104px * 4 / 3);
  height: calc(104px * 4 / 3);
  object-fit: contain;
}

.sidebar-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-section-title-clickable {
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  padding: 2px 4px;
  margin: 0;
  line-height: 20px;
  transition: color 0.15s ease;
}

.sidebar-section-title-clickable:hover {
  color: var(--color-primary, #2a9d6a) !important;
}

.sidebar-section-title-clickable:hover .sidebar-section-toggle svg path {
  fill: var(--color-primary, #2a9d6a);
}

.sidebar-section-toggle svg {
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.sidebar-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  pointer-events: none;
}

/* 与「新分组」按钮一致 */
.sidebar-new-product-btn {
  margin: 0;
  flex-shrink: 0;
  user-select: none;
  font-size: 14px;
  line-height: 20px;
  height: 20px;
}

.sidebar-new-product-btn .sidebar-add-icon {
  display: block;
  flex-shrink: 0;
}

.sidebar-new-product-btn:hover .sidebar-add-icon,
.sidebar-new-product-btn.group:hover .sidebar-add-icon {
  fill: var(--color-primary, #2a9d6a);
}

/* 悬停「新商品」时在按钮右侧显示的菜单（样式对齐 ant-popover） */
.sidebar-calc-type-menu {
  position: fixed;
  z-index: 1060;
  min-width: 107px;
}

.sidebar-calc-type-menu-inner {
  padding: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow:
    0 6px 16px 0 rgba(0, 0, 0, 0.08),
    0 3px 6px -4px rgba(0, 0, 0, 0.12),
    0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

/* 指向按钮的小箭头（默认菜单在按钮右侧，箭头在左边） */
.sidebar-calc-type-menu-arrow {
  position: absolute;
  top: 14px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.06);
  z-index: 1;
  pointer-events: none;
}

.sidebar-calc-type-menu[data-placement='left'] .sidebar-calc-type-menu-arrow {
  left: auto;
  right: -4px;
  box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.06);
}

.sidebar-calc-type-menu-item {
  margin: 0;
  padding: 0 8px;
  line-height: 32px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
}

.sidebar-calc-type-menu-item:hover {
  background: #f4f4f6;
}

/* 点击菜单项时在屏幕外触发原生 Popover，避免顶部重复出现 */
.ant-popover[data-sidebar-hidden='1'] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sidebar-vip-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-vip-prompt-box {
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px 16px;
  box-shadow:
    0 6px 16px 0 rgba(0, 0, 0, 0.08),
    0 3px 6px -4px rgba(0, 0, 0, 0.12),
    0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-vip-prompt-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
}

.sidebar-vip-prompt-content {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
  line-height: 1.5;
}

.sidebar-vip-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sidebar-vip-prompt-cancel,
.sidebar-vip-prompt-ok {
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 6px;
  padding: 4px 15px;
  font-size: 14px;
  cursor: pointer;
  line-height: 22px;
}

.sidebar-vip-prompt-ok {
  border-color: var(--color-primary, #2a9d6a);
  background: var(--color-primary, #2a9d6a);
  color: #fff;
}
