/* restock.css - 陈列补货 H5 页面样式 (2026-08-30) */

/* === 视图切换 tab (floor/office/all) === */
.view-tabs {
  display: flex; gap: 8px; padding: 8px 12px;
  background: #fff; border-bottom: 1px solid var(--color-border);
}
.view-tabs .tab {
  flex: 1; padding: 6px 8px; text-align: center; font-size: 13px;
  background: var(--color-bg); color: var(--color-text-secondary);
  border-radius: 4px; cursor: pointer;
}
.view-tabs .tab.active {
  background: var(--color-primary); color: #fff; font-weight: 500;
}

/* === 工具栏 (filter + sort) === */
.toolbar {
  display: flex; gap: 8px; padding: 8px 12px; align-items: center;
  background: #fff; border-bottom: 1px solid var(--color-border);
  position: sticky; top: 49px; z-index: 9;
}
.toolbar .filter-btn, .toolbar .sort-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; font-size: 13px;
  background: var(--color-bg); border-radius: 4px; cursor: pointer;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.toolbar .filter-btn .arrow, .toolbar .sort-btn .arrow {
  color: var(--color-text-secondary); margin-left: 4px;
}
.toolbar .filter-btn.has-filter, .toolbar .sort-btn.has-filter {
  background: #fffbe6; border-color: #fde26a;
}
.toolbar .refresh-btn {
  padding: 6px 10px; font-size: 13px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 4px; cursor: pointer; color: var(--color-text);
}

/* === qty-min (建议补货量下限, 不显眼小输入) === */
.toolbar .qty-min {
  display: flex; align-items: center; gap: 2px;
  padding: 0 4px; height: 30px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 4px; color: var(--color-text-secondary);
  font-size: 11px;
}
.toolbar .qty-min.active {
  background: #fffbe6; border-color: #fde26a; color: #c77700;
}
.toolbar .qty-min-label {
  padding: 0 2px; opacity: 0.7; font-weight: 500;
}
.toolbar .qty-min input {
  width: 32px; padding: 0; margin: 0;
  border: 0; background: transparent;
  text-align: center; font-size: 12px; font-weight: 500;
  color: inherit; -moz-appearance: textfield;
}
.toolbar .qty-min input::-webkit-outer-spin-button,
.toolbar .qty-min input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.toolbar .qty-min input:focus {
  outline: 1px solid var(--color-primary); outline-offset: -1px;
  background: #fff; border-radius: 3px;
}

/* === 任务卡片 (floor 简洁版) === */
.task-card {
  background: #fff; border-radius: 6px; padding: 12px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.task-card .row1 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.task-card .row2 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.task-card .name {
  font-size: 15px; font-weight: 500; color: var(--color-text);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card .item-no {
  font-size: 11px; color: var(--color-text-secondary); font-family: monospace;
}
.task-card .meta-line {
  display: flex; gap: 12px; font-size: 12px; color: var(--color-text-secondary);
  flex-wrap: wrap;
}
.task-card .meta-line .v { color: var(--color-text); font-weight: 500; }
.task-card .stock-low { color: var(--color-warn); font-weight: 600; }
.task-card .stock-ok  { color: var(--color-primary); }
.task-card .pri {
  display: inline-block; padding: 2px 6px; border-radius: 3px;
  font-size: 11px; font-weight: 600;
}
.task-card .pri.P0 { background: #fde6e6; color: #b30000; }
.task-card .pri.P1 { background: #fff1d6; color: #c77700; }
.task-card .pri.P2 { background: #e6f4ff; color: #0066cc; }
.task-card .pri.P3 { background: #f0f0f0; color: #888; }
.task-card .status-tag {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 11px; background: #f0f0f0; color: #666;
}
.task-card .status-tag.acked { background: #e6f7e6; color: #1aad19; }
.task-card .status-tag.short { background: #fde6e6; color: #b30000; }
.task-card .status-tag.closed { background: #f0f0f0; color: #999; }

.task-card .actions {
  display: flex; gap: 8px;
}
.task-card .btn-done, .task-card .btn-short {
  flex: 1; padding: 8px 0; font-size: 14px; font-weight: 500;
  border: 0; border-radius: 4px; cursor: pointer;
}
.task-card .btn-done { background: var(--color-primary); color: #fff; }
.task-card .btn-done:active { background: #179b16; }
.task-card .btn-done:disabled { background: #b8e0b6; }
.task-card .btn-short { background: #fff; color: var(--color-warn); border: 1px solid var(--color-warn); }
.task-card .btn-short:active { background: #fff5f5; }
.task-card .btn-short:disabled { color: #e0a8a8; border-color: #e0a8a8; }

.task-card .post-feedback {
  font-size: 12px; color: #888; text-align: center; padding: 4px 0;
}
.task-card .post-feedback.ok   { color: var(--color-primary); }
.task-card .post-feedback.warn { color: var(--color-warn); }

/* === Office 详细表格 === */
.office-table {
  background: #fff; border-radius: 6px; margin-bottom: 12px;
  overflow: hidden;
}
.office-table table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.office-table th, .office-table td {
  padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.office-table th {
  background: var(--color-bg); color: var(--color-text-secondary);
  font-weight: 500; font-size: 12px; position: sticky; top: 0;
}
.office-table td .name {
  font-weight: 500; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.office-table td .sub {
  font-size: 11px; color: var(--color-text-secondary); margin-top: 2px;
}
.office-table td.right { text-align: right; font-family: monospace; }
.office-table td.center { text-align: center; }
.office-table tr.row-acked  td { background: #f7fcf7; }
.office-table tr.row-short  td { background: #fef5f5; }
.office-table tr.row-closed td { opacity: 0.5; }
.office-table .mini-tag {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 10px; background: #f0f0f0; color: #666; margin-left: 4px;
}

/* === 汇总卡片 (顶部) === */
.summary {
  display: flex; gap: 8px; padding: 8px 12px;
}
.summary .stat {
  flex: 1; background: #fff; border-radius: 6px; padding: 10px;
  text-align: center;
}
.summary .stat .n { font-size: 20px; font-weight: 600; color: var(--color-primary); }
.summary .stat .n.warn { color: var(--color-warn); }
.summary .stat .l { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; }

/* === 分类树 (侧边抽屉 / 弹层) === */
.cls-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4); z-index: 200;
  display: none;
}
.cls-mask.show { display: block; }
.cls-panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 78%; max-width: 320px;
  background: #fff; z-index: 201; overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.2s ease;
}
.cls-panel.show { transform: translateX(0); }
.cls-panel .head {
  padding: 12px; background: var(--color-primary); color: #fff;
  font-size: 16px; display: flex; align-items: center; justify-content: space-between;
}
.cls-panel .head .close { font-size: 20px; cursor: pointer; }
.cls-panel .list { padding: 4px 0; }
.cls-panel .item {
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--color-border); cursor: pointer; font-size: 14px;
}
.cls-panel .item:active { background: #f5f5f5; }
.cls-panel .item.active { background: #e8f5e9; color: var(--color-primary); font-weight: 500; }
.cls-panel .item .n { font-size: 11px; color: var(--color-text-secondary); }
.cls-panel .item.active .n { color: var(--color-primary); }
.cls-panel .all {
  padding: 10px 12px; background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  font-weight: 500; cursor: pointer;
}

/* === 排序弹层 (sheet) === */
.sort-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; z-index: 201;
  border-top-left-radius: 12px; border-top-right-radius: 12px;
  transform: translateY(100%); transition: transform 0.2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sort-sheet.show { transform: translateY(0); }
.sort-sheet .title {
  padding: 12px; text-align: center; font-size: 14px;
  color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.sort-sheet .opt {
  padding: 14px; text-align: center; border-bottom: 1px solid var(--color-border);
  cursor: pointer; font-size: 15px;
}
.sort-sheet .opt.active { color: var(--color-primary); font-weight: 500; }
.sort-sheet .opt:active { background: #f5f5f5; }

/* === 通用 === */
.text-secondary { color: var(--color-text-secondary); }
.text-warn { color: var(--color-warn); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.flex-1 { flex: 1; }
.mono { font-family: monospace; }

/* office 视图 tabs 切换 plan 视图 */
.plan-row {
  background: #fff; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.plan-row .info { flex: 1; min-width: 0; }
.plan-row .sup { font-size: 14px; font-weight: 500; }
.plan-row .qty { color: var(--color-primary); font-weight: 600; }
.plan-row .count { font-size: 12px; color: var(--color-text-secondary); }

/* status mini-tag (1x1 cell) */
.mini-tag { display: inline-block; padding: 1px 4px; border-radius: 3px; font-size: 10px; background: #f0f0f0; color: #666; }
.mini-tag.P0 { background: #fde6e6; color: #b30000; }
.mini-tag.P1 { background: #fff1d6; color: #c77700; }
.mini-tag.P2 { background: #e6f4ff; color: #0066cc; }

/* supplier tap target */
.supplier-row {
  background: #fff; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.supplier-row:active { background: #f5f5f5; }
.supplier-row .info { flex: 1; min-width: 0; }
.supplier-row .sup { font-size: 14px; font-weight: 500; }
.supplier-row .count { font-size: 12px; color: var(--color-text-secondary); }
.supplier-row .qty { color: var(--color-primary); font-weight: 600; font-size: 16px; }
