/* /var/www/pftest/assets/css/app.css  配料系统补充样式（沿用 kqtest common.css 变量体系） */

/* ===== SVG 图标（全站统一，禁用 Emoji） ===== */
.ic { display: inline-flex; width: 16px; height: 16px; vertical-align: -3px; }
.ic svg { width: 100%; height: 100%; }
.btn .ic { width: 15px; height: 15px; vertical-align: -2.5px; margin-right: 4px; }
.btn.btn-sm .ic { width: 13px; height: 13px; vertical-align: -2px; }
.ic-lg { display: inline-flex; width: 48px; height: 48px; color: var(--text-disabled); }
.ic-lg svg { width: 100%; height: 100%; }
.ic-xl { display: inline-flex; width: 40px; height: 40px; color: var(--danger); }
.ic-xl svg { width: 100%; height: 100%; }

/* ===== 结果区手工调整 ===== */
.qty-input {
  width: 88px;
  padding: 4px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.qty-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,115,232,.12); }
tr.locked-row { background: #fffaf0; }
tr.locked-row .qty-input { border-color: #f2b263; background: #fffdf7; }
.lock-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
  border-radius: 4px;
  background: #fdebd3;
  color: #b06000;
  vertical-align: 1px;
}
.err-bar {
  display: none;
  background: #fdeceb;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.err-bar-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--danger); font-size: 14px; margin-bottom: 6px; }
.err-bar-head .ic { width: 16px; height: 16px; }
.err-bar-body { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.8; }

/* 登录页背景 */
body.login-page {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 400px; padding: 40px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .icon { font-size: 40px; }
.login-logo h2 { font-size: 20px; margin-top: 8px; color: var(--text-primary); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form .form-label { font-size: 14px; }
.login-form .form-input { height: 44px; font-size: 15px; }
.login-form .btn { height: 44px; font-size: 15px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-disabled); }

/* 应用外壳 */
body.app { overflow: hidden; height: 100vh; display: flex; flex-direction: column; }
.app-body { flex: 1; overflow-y: auto; }

/* 计算页布局：左参数 右结果 */
.calc-layout { display: flex; gap: 16px; align-items: flex-start; }
.calc-aside { width: 320px; flex-shrink: 0; position: sticky; top: 0; }
.calc-main { flex: 1; min-width: 0; }

/* 元素标准表格（紧凑） */
.elem-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.elem-table th, .elem-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border-light); text-align: left; white-space: nowrap;
}
.elem-table th { background: var(--bg-page); color: var(--text-secondary); font-weight: 500; }
.elem-table td.num, .elem-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.elem-table tr:last-child td { border-bottom: none; }
.elem-table .ok { color: var(--success); font-weight: 600; }
.elem-table .bad { color: var(--danger); font-weight: 600; }

/* 原料勾选列表 */
.mat-pick { max-height: 420px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.mat-pick-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.mat-pick-row:last-child { border-bottom: none; }
.mat-pick-row:hover { background: #fafbfc; }
.mat-pick-row input[type="checkbox"] { width: 15px; height: 15px; flex: none; cursor: pointer; }
.mat-pick-row .mp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-pick-row .mp-price { color: var(--text-secondary); font-variant-numeric: tabular-nums; font-size: 12px; }
.mat-pick-tools { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }

/* 统计条 */
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.result-stat {
  background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.result-stat .lbl { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.result-stat .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-stat .val.cost { color: var(--danger); }
.result-stat .val.ok { color: var(--success); }
.result-stat .val.bad { color: var(--danger); }

/* 元素限值编辑网格 */
.limit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.limit-item { display: flex; align-items: center; gap: 6px; }
.limit-item .code { width: 46px; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex: none; }
.limit-item input { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.limit-item input:focus { outline: none; border-color: var(--primary); }

/* 打印 */
@media print {
  body { background: #fff; }
  .no-print, .main-header, .card-header .btn, .toast { display: none !important; }
  .main-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; }
  .print-area { width: 100%; }
  .data-table th, .data-table td { border: 1px solid #999 !important; }
}

/* 打印单据 */
.print-sheet { background: #fff; padding: 20px 24px; font-family: 'SimSun', '宋体', serif; color: #000; }
.print-sheet h1 { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 4px; margin-bottom: 4px; }
.print-sheet .sub-title { text-align: center; font-size: 15px; letter-spacing: 2px; margin-bottom: 14px; }
.print-meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { border: 1px solid #000; padding: 5px 6px; text-align: center; }
.print-table th { background: #f2f2f2; font-weight: 700; }
.print-table td.left { text-align: left; }
.print-foot { display: flex; justify-content: space-between; font-size: 13px; margin-top: 14px; }
.print-sign { display: flex; gap: 28px; font-size: 13px; margin-top: 26px; }
