/* 收银端样式：PC 全屏布局 */

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b4a8f 0%, #4a7cf7 100%);
}
.login-box { background: #fff; border-radius: 14px; padding: 40px 36px; width: 380px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.login-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 6px; color: #2b4a8f; }
.login-sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 26px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px; background: #2b4a8f; color: #fff; display: flex;
  align-items: center; padding: 0 20px; gap: 18px;
}
.topbar .shop-name { font-size: 17px; font-weight: 700; }
.topbar .menu { display: flex; gap: 6px; flex: 1; }
.topbar .menu a {
  color: rgba(255,255,255,.75); text-decoration: none; padding: 7px 14px;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}
.topbar .menu a.active { background: rgba(255,255,255,.18); color: #fff; }
.topbar .user { font-size: 13px; color: rgba(255,255,255,.8); }

/* ---------- 收银台三栏 ---------- */
.cashier-wrap { display: flex; height: calc(100vh - 56px); overflow: hidden; }

/* 左栏：商品 */
.panel-left { width: 44%; background: #fff; border-right: 1px solid #e8eaef; display: flex; flex-direction: column; }
.pos-search { padding: 12px 14px; border-bottom: 1px solid #eef0f3; }
.pos-search .input { font-size: 16px; height: 44px; }
.cat-tabs { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; border-bottom: 1px solid #f0f1f4; flex-shrink: 0; }
.cat-tabs .cat {
  padding: 5px 14px; border-radius: 16px; background: #f1f3f7; color: #555;
  cursor: pointer; white-space: nowrap; font-size: 13px;
}
.cat-tabs .cat.active { background: #4a7cf7; color: #fff; }
.product-list { flex: 1; overflow-y: auto; padding: 10px 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; }
.product-item {
  border: 1px solid #e8eaef; border-radius: 8px; padding: 10px 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; gap: 8px; align-items: center;
}
.product-item:hover { border-color: #4a7cf7; background: #f7faff; }
.product-item.selected { border-color: #22a06b; background: #f0faf4; }
.product-item .p-name { font-size: 14px; font-weight: 600; line-height: 1.4; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-item .p-spec { font-size: 12px; color: #999; margin-top: 3px; }
.product-item .p-price { color: #e5484d; font-size: 16px; font-weight: 700; margin-top: 6px; }
.product-item .p-price span { font-size: 12px; font-weight: 400; }
.product-item .p-stock { font-size: 11px; color: #aaa; margin-left: 6px; }
.product-item .p-stock.zero { color: #e5484d; }
/* 收银台商品卡片：文字在左，固定尺寸正方形图片靠右（无图显示虚线占位） */
.product-item .p-text { flex: 1; min-width: 0; }
.product-item .p-img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; background: #f5f6f8; flex-shrink: 0; display: block; }
.product-item .p-img-empty { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 12px; border: 1px dashed #e0e3e8; box-sizing: border-box; }

/* 中栏：购物车 */
.panel-mid { width: 36%; background: #fff; border-right: 1px solid #e8eaef; display: flex; flex-direction: column; }
.panel-title { padding: 12px 16px; font-size: 14px; font-weight: 600; color: #555; border-bottom: 1px solid #f0f1f4; display: flex; justify-content: space-between; }
.cart-list { flex: 1; overflow-y: auto; }
.cart-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f6f7f9; gap: 10px; }
.cart-row .c-name { flex: 1; font-size: 14px; }
.cart-row .c-name .c-spec { color: #aaa; font-size: 12px; }
.cart-row .c-price { color: #e5484d; font-weight: 600; font-size: 14px; width: 90px; text-align: right; }
.qty-box { display: flex; align-items: center; gap: 6px; }
.qty-box button { width: 26px; height: 26px; border-radius: 5px; border: 1px solid #d5d9e0; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.qty-box button:hover { border-color: #4a7cf7; color: #4a7cf7; }
.qty-box .qty { width: 36px; text-align: center; font-size: 15px; font-weight: 600; }
.cart-empty { text-align: center; color: #bbb; padding: 60px 0; }

/* 右栏：结算 */
.panel-right { width: 20%; background: #f8f9fb; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sum-line { display: flex; justify-content: space-between; font-size: 14px; color: #555; }
.sum-line .v { font-weight: 600; color: #333; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px dashed #d5d9e0; }
.sum-total .v { color: #e5484d; font-size: 28px; font-weight: 700; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-methods .pm {
  flex: 1; min-width: 70px; padding: 8px 4px; text-align: center; border: 1px solid #d5d9e0;
  border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px;
}
.pay-methods .pm.active { border-color: #4a7cf7; color: #4a7cf7; background: #f0f5ff; font-weight: 600; }

/* ---------- 小票打印 ---------- */
.receipt-print { width: 72mm; font-family: "Courier New", monospace; font-size: 12px; color: #000; padding: 4px 2px; }
.receipt-print .rp-center { text-align: center; }
.receipt-print .rp-shop { font-size: 16px; font-weight: 700; }
.receipt-print .rp-row { display: flex; justify-content: space-between; }
.receipt-print .rp-line { border-top: 1px dashed #999; margin: 6px 0; }
.receipt-print .rp-item { display: flex; justify-content: space-between; margin: 2px 0; }
.receipt-print .rp-item .rp-name { flex: 1; }
.receipt-print .rp-item .rp-qty { width: 70px; text-align: right; }

@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print { position: absolute; left: 0; top: 0; }
}

/* ---------- 管理页面通用 ---------- */
.page-wrap { padding: 20px; max-width: 1200px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 18px; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.tag-green { background: #e6f7ef; color: #22a06b; }
.tag-red { background: #fdeaea; color: #e5484d; }
.tag-gray { background: #f0f1f4; color: #777; }
.tag-blue { background: #e8f0fe; color: #2b6de8; }
.tag-yellow { background: #fdf6e3; color: #b07c10; }

/* 时间线（订单状态流转） */
.tl { margin-top: 12px; padding-left: 8px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: #4a7cf7; margin-top: 5px; flex-shrink: 0; }
.tl-dot.last { background: #22a06b; }
.tl-body { font-size: 13px; }

/* 盘点行高亮 */
.hl { background: #fffbe6 !important; animation: hl-pulse 1.2s ease; }

/* 商品候选下拉（入库页选择商品） */
.cand {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20;
  background: #fff; border: 1px solid #d5d9e0; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto;
}
.cand-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; font-size: 13px; }
.cand-item:hover, .cand-item.selected { background: #f0f5ff; }
.cand-item .cand-name { flex: 1; }
.cand-item .cand-barcode { color: #999; font-size: 12px; }
.cand-item .cand-price { color: #e5484d; }
.cand-empty { padding: 12px; text-align: center; color: #999; font-size: 13px; }
@keyframes hl-pulse { 0% { background: #fff3b0; } 100% { background: #fffbe6; } }

/* 统计卡片（报表页） */
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-card .v { font-size: 22px; font-weight: 700; color: #2b4a8f; }
.stat-card.warn .v { color: #e5484d; }
.stat-card .l { font-size: 12px; color: #999; margin-top: 4px; }

/* ---------- 菜单权限灰显 ---------- */
.topbar .menu a.disabled { color: rgba(255,255,255,.35); cursor: not-allowed; }
.topbar .menu a.disabled:hover { background: transparent; }

/* ---------- 员工管理：权限勾选胶囊 ---------- */
.perm-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-item {
  display: flex; align-items: center; gap: 4px; padding: 4px 10px;
  border: 1px solid #d5d9e0; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.perm-item.checked { border-color: #4a7cf7; background: #f0f5ff; color: #2b6de8; }
.perm-item.disabled { opacity: .5; cursor: not-allowed; }
.perm-tip { font-size: 12px; color: #b7791f; background: #fdf6e3; border-radius: 6px; padding: 6px 10px; margin-top: 8px; }

/* 编辑弹窗价格字段旁的「历史」链接 */
.hist-link {
  margin-left: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #4a7cf7;
  font-weight: normal;
  text-decoration: underline;
}

/* 商品编辑弹窗：图片上传预览 */
.p-upload-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #e8eaef; background: #f5f6f8; }
.p-upload-placeholder {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 12px; border: 1px dashed #d5d9e0; border-radius: 8px; background: #fafbfc;
}
.p-upload-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
