/* Topbar meta (sealed) */
.meta .hint{ font-size: 12px; color: var(--tcg-muted); margin-top: 2px; }

.right-tools{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* Panels */
    .panel.cardlike{
      background: var(--tcg-card);
      border: 1px solid var(--tcg-border);
      border-radius: var(--tcg-radius);
      box-shadow: 0 10px 24px rgba(15,23,42,.05);
      overflow: hidden;
    }

.panel-head{
      padding: 14px 16px 10px;
      border-bottom: 1px solid rgba(15,23,42,.08);
      background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(248,250,252,.75));
    }

.panel-title{ font-weight: 900; }

.panel-sub{ color: var(--tcg-muted); margin-top: 2px; }

.pack-cell{ text-align:left !important; }

.pack-row-title{ font-weight: 800; font-size: 13px; line-height: 1.25; }

/* Inputs / selects inside table */
    .tcg-input, .tcg-select{
      height: 32px;
      border-radius: 10px !important;
      border-color: rgba(15,23,42,.14) !important;
      font-size: 12px !important;
    }

.tcg-select{ padding-right: 28px; }

.w-qty, .w-outqty{ width: 92px !important; }

.w-cost, .w-outprice{ width: 118px !important; }

/* Action buttons in rows */
    .tcg-btn-action{
      height: 32px;
      padding: 0 12px;
      border-radius: 999px;
      font-weight: 800;
      white-space: nowrap;
    }

/* Make the "采购清单" pill match buttons */
    .pill-count{
      height: 32px;
      padding: 0 12px;
      display:flex; align-items:center; gap:8px;
      border-radius: 999px;
      border: 1px solid rgba(15,23,42,.14);
      background: rgba(59,130,246,.06);
      cursor: pointer;
      user-select:none;
      font-size: 12.5px;
    }

.pill-count .n{
      min-width: 22px;
      height: 22px;
      border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      background: rgba(59,130,246,.14);
      border: 1px solid rgba(59,130,246,.22);
      font-weight: 900;
      font-variant-numeric: tabular-nums;
    }

/* Tighten misc text helpers */
    .tiny{ font-size: 11px !important; }

.muted, .muted2, .text-muted{ color: var(--tcg-muted) !important; }

/* Pack menu (accordion) */

    .pm-acc .accordion-button{ display:flex; align-items:center; gap:8px; }

.pm-acc .series-label{ flex: 1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.pm-acc .pack-sub{ flex:0 0 auto; font-size:10px; color: var(--tcg-muted); font-weight:700; }

.pm-acc .accordion-item{
      border: 1px solid rgba(15,23,42,.08);
      border-radius: 14px;
      overflow:hidden;
      margin-bottom: 8px;
      background:#fff;
    }

.pm-acc .accordion-button{
      padding: 10px 12px;
      font-weight: 800;
      font-size: 12px;
      background:#fff;
      box-shadow:none;
    }

.pm-acc .accordion-body{ padding: 10px 10px 12px; }

.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;}

.tiny{font-size:12px;}

.right-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end;}

.pill-count{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(30,58,138,.10);border:1px solid rgba(30,58,138,.25);font-weight:900;cursor:pointer;user-select:none;}

.pill-count .n{min-width:24px;height:24px;border-radius:999px;background: var(--tcg-primary-2);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:12px;}

.w-qty{max-width:110px;}

.w-cost{max-width:150px;}

.pack-row-title{font-weight:800;}

.muted2{color: rgba(15,23,42,.55);}

.kpi{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;}

.kpi .pill-count{cursor:default;}

/* Stock: 默认只读隐藏调整列（勾选/数量/操作） */
.stock-table:not(.adjust-on) .col-adjust { display: none !important; }

/* Stock batch bar */
.stock-batch{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(17,24,39,.08);
  background:#f8fafc;
  border-radius:14px;
  margin-bottom:10px;
}

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

.pill-mini{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#e5e7eb;
  font-weight:800;
  font-size:12px;
  color:#0f172a;
}

/* Summary cards (Stock) */
    .summary-grid{
      display:grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 18px;
      margin-bottom: 18px;
    }

.summary-card{
      background: var(--tcg-card);
      border: 1px solid var(--tcg-border);
      border-radius: 22px;
      padding: 18px 20px;
      box-shadow: 0 6px 18px rgba(15,23,42,.04);
      min-height: 92px;
      display:flex;
      flex-direction:column;
      justify-content:center;
    }

.summary-card .label{
      color: var(--tcg-muted);
      font-weight: 600;
      font-size: 12px;
      margin-bottom: 8px;
    }

.summary-card .value{
      font-weight: 900;
      font-size: 32px;
      letter-spacing: .2px;
      line-height: 1;
    }

.summary-card .value.small{
      font-size: 28px;
    }

@media (max-width: 1400px){
      .summary-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

/* Logs modal accordion */
    #logsAcc .accordion-item{ border: 1px solid rgba(15,23,42,.08); border-radius: 16px; overflow:hidden; margin-bottom:10px; background:#fff; }

#logsAcc .badge-soft{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; border:1px solid rgba(15,23,42,.10); background: rgba(2,6,23,.03); font-size:11px; font-weight:900; color:#0f172a; }

#logsAcc .badge-soft.in{ background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.22); }

#logsAcc .badge-soft.out{ background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.22); }

#logsAcc .badge-soft.adjust{ background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.22); }

#logsAcc .badge-soft.correct{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.28); }


/* v2.1: align cover thumbnails (image column) */
.stock-table :is(th,td){ vertical-align: middle; }
.stock-table th:nth-child(2),
.stock-table td:nth-child(2){ text-align: center; }
.stock-table td:nth-child(2) .thumb,
.stock-table td:nth-child(2) img{ display:block; margin:0 auto; }
.thumb{ width:40px; height:56px; }


/* Cover column center */
.stock-table td.cover, .stock-table th.cover{ text-align:center; }
.stock-table td.cover .thumb{ display:block; margin:0 auto; }


/* ===== Box (sealed) table alignment (scoped) ===== */
.page-sealed .stock-table{ table-layout: fixed; }
.page-sealed .stock-table thead th{ text-align:center; }
.page-sealed .stock-table thead th:nth-child(2){ text-align:left; } /* Pack名称 header */
.page-sealed .stock-table td.pack-cell{ text-align:left !important; }
.page-sealed .stock-table td.text-end{ text-align:right !important; }
.page-sealed .stock-table td:last-child{ white-space: nowrap; }

.page-sealed .stock-table .tcg-input,
.page-sealed .stock-table .tcg-select,
.page-sealed .stock-table .form-control,
.page-sealed .stock-table .form-select,
.page-sealed .stock-table input[type="number"],
.page-sealed .stock-table input[type="text"],
.page-sealed .stock-table select{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  display:block;
}

/* Keep image column centered in box table */
.page-sealed .stock-table td:nth-child(1),
.page-sealed .stock-table th:nth-child(1){
  width: 76px;
}
.page-sealed .stock-table td:nth-child(1){ text-align:center; }
.page-sealed .thumb{ margin:0 auto; }
