/* Order-warning panel: manual buy price vs resale + gift value.
   Reuses the dashboard tokens declared in styles.css / frost-theme.css. */

.order-warning-panel { margin-bottom: 14px; }

.order-warning-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.order-warning-actions .small { color: var(--muted); }

.order-warning-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 13px 0;
}
.order-warning-metrics article {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.order-warning-metrics span { color: var(--muted); font-size: 12px; }
.order-warning-metrics strong { font-size: 21px; line-height: 1.15; }
.order-warning-metrics small { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- form */
.order-warning-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}
.order-warning-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
}
.order-warning-form input[type="text"],
.order-warning-form input[type="number"],
.order-warning-form input:not([type]) {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.order-warning-form input:focus-visible {
  border-color: var(--teal);
  outline: 2px solid rgb(0 124 130 / 18%);
  outline-offset: 0;
}
.order-warning-check {
  display: flex !important;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}
.order-warning-check input { width: 16px; height: 16px; flex: none; }
.order-warning-form-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.order-warning-panel > .flash { padding: 0 13px 10px; }

/* ---------------------------------------------------------------- import */
.order-warning-import {
  padding: 13px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.order-warning-import-head { display: grid; gap: 3px; margin-bottom: 8px; }
.order-warning-import-head strong { font-size: 13px; }
.order-warning-import-head span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.order-warning-import textarea {
  width: 100%;
  padding: 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}
.order-warning-import-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.order-warning-file { display: inline-flex; align-items: center; gap: 7px; color: var(--teal); cursor: pointer; font-size: 12px; }
.order-warning-file input { max-width: 210px; font-size: 12px; }

/* ---------------------------------------------------------------- table */
.order-warning-list { padding: 0; }
.ow-table-wrap { overflow-x: auto; }
.ow-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.ow-table th {
  padding: 9px 11px;
  color: var(--muted);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  text-align: left;
}
.ow-table td { padding: 9px 11px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.ow-table tbody tr:hover { background: #f8fbfd; }
.ow-table tbody tr:last-child td { border-bottom: 0; }
.ow-table tr.is-qualified { background: var(--green-soft); }
.ow-table tr.is-qualified:hover { background: #e0f4e8; }
.ow-table tr.is-disabled { color: var(--muted); }
.ow-table tr.is-disabled .ow-profit { color: var(--muted); }
.ow-table tr.is-qualified td:first-child { box-shadow: inset 3px 0 0 var(--green); }

.ow-model { display: grid; gap: 2px; }
.ow-model strong { font-size: 13px; }
.ow-model span { color: var(--muted); font-size: 11px; }
.ow-gift { display: block; color: var(--muted); font-size: 11px; }
.ow-gift-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ow-profit { font-size: 14px; }
.ow-profit.is-up { color: var(--green); }
.ow-profit.is-down { color: var(--red); }
.ow-threshold { color: var(--muted); }
.ow-notify { display: grid; gap: 2px; color: var(--muted); font-size: 11px; }
.ow-actions { display: flex; gap: 9px; }
.ow-danger { color: var(--red); }
.ow-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.ow-badge-go { color: #0d6b41; background: var(--green-soft); border: 1px solid #b7e3cb; }
.ow-badge-wait { color: var(--muted); background: #f1f5f9; border: 1px solid var(--line); }
.ow-badge-off { color: var(--muted); background: #fff; border: 1px dashed var(--line); }

@media (max-width: 900px) {
  .order-warning-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 640px) {
  .order-warning-actions { width: 100%; }
  .order-warning-form-actions { justify-content: stretch; }
  .order-warning-form-actions .primary { flex: 1; }
}

/* ---------------------------------------------------------------- 图片导入 */
.ow-drop {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px 14px;
  text-align: center;
  background: #fff;
  border: 1.5px dashed var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ow-drop:hover,
.ow-drop.is-over { border-color: var(--teal); background: #f2fbfb; }
.ow-drop.is-busy { cursor: progress; opacity: .7; }
.ow-drop strong { font-size: 13px; }
.ow-drop span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.ow-drop input[type="file"] { display: none; }

.ow-preview { margin-top: 10px; display: grid; gap: 9px; }
.ow-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.ow-preview-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.ow-preview-bar select,
.ow-preview-bar input[type="text"] {
  min-height: 30px;
  padding: 0 7px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}
.ow-columns { display: flex; gap: 7px; flex-wrap: wrap; }
.ow-column-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}
.ow-column-chip.is-on { border-color: var(--teal); background: #eefaf9; color: var(--teal); }

.ow-preview-table { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.ow-preview-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ow-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 8px;
  color: var(--muted);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.ow-preview-table td { padding: 4px 6px; border-bottom: 1px solid #f1f5f9; }
.ow-preview-table tr.is-off { opacity: .35; }
.ow-preview-table input {
  width: 100%;
  min-width: 62px;
  min-height: 28px;
  padding: 0 6px;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
}
.ow-preview-table input:hover { border-color: var(--line); }
.ow-preview-table input:focus { border-color: var(--teal); outline: none; }
.ow-preview-table input.is-numeric { text-align: right; }
.ow-preview-table .ow-raw { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- 列表补充 */
.ow-match { display: grid; gap: 2px; max-width: 210px; }
.ow-match strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ow-match a { color: var(--teal); font-size: 11px; }
.ow-match span { color: var(--muted); font-size: 11px; }
.ow-match .ow-miss { color: #b45309; }
.ow-match .ow-warn {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--red);
  background: #fdeaea;
  border: 1px solid #f7c1c1;
  font-size: 11px;
}
.ow-attn { color: var(--red); }
.ow-pending { color: #b45309; font-size: 12px; font-weight: 700; }
.ow-badge-match { color: #0d6b41; background: var(--green-soft); border: 1px solid #b7e3cb; }
.ow-badge-pending { color: #92400e; background: #fef3c7; border: 1px solid #fde68a; }
.ow-badge-miss { color: #92400e; background: #fff7ed; border: 1px solid #fed7aa; }

.ow-toast {
  padding: 9px 12px;
  border-radius: 5px;
  background: var(--canvas);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
}
.ow-toast strong { color: var(--ink); }
.ow-toast.is-error { color: var(--red); border-color: #f3c9c9; background: #fdf2f2; }

/* --------------------------------------------------------------------------
   折叠：下单预警默认收起，只在点击顶部栏「下单预警」后才展开
   入口按钮（.ow-toggle / .ow-toggle-badge）的样式在 topbar.css —— 它属于顶栏，
   跟那一行的按钮体系放在一起才好统一尺寸与圆角。
   -------------------------------------------------------------------------- */
.order-warning-panel.is-collapsed { display: none !important; }

