/* New product creation page — additions to ui-kit.css */

/* role-menu*, role-banner* → moved to ui-kit.css */
/* sync-pill* → moved to ui-kit.css */
/* chip-wrap, chip*, chip-pop*, drp-* → moved to ui-kit.css */

.form-id {
  display: block; margin-top: 2px;
  font: 400 11px var(--font-mono); color: var(--fg-4);
}

/* ── toolbar__filters / toolbar__bulk child rules → 已整合至 ui-kit.css ── */
/* batch-picker / seg / seg__btn / batch-list* → moved to ui-kit.css (2026-06-02) */
/* info-card → moved to ui-kit.css */

/* ============ Import banner ============ */
.imp-banner {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  border: 1px solid; border-radius: var(--radius-md);
  margin-bottom: 12px;
  animation: pop 240ms var(--ease-emphasis);
}
.imp-banner__main { flex: 1; }
.imp-banner__title { font: 600 13px var(--font-sans); color: var(--fg-1); }
.imp-banner__desc { font: 400 12.5px var(--font-sans); color: var(--fg-2); margin-top: 3px; }
.imp-banner__txt { font: 500 12px var(--font-mono); color: var(--fg-2); }
.imp-banner__bar {
  display: block; height: 4px; background: rgba(0,0,0,.06);
  border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.imp-banner__bar span {
  display: block; height: 100%; background: var(--brand-primary);
  transition: width 180ms var(--ease-standard);
}
.imp-banner--busy { background: #fff; border-color: var(--border-1); }
.imp-banner__spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--gray-200); border-top-color: var(--brand-primary);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.imp-banner--err {
  background: var(--danger-bg); border-color: var(--danger-border);
  color: var(--danger);
}
.imp-banner--err > svg { color: var(--danger); flex: none; }
.imp-banner--err b { color: var(--danger); }
.imp-banner--ok {
  background: var(--success-bg); border-color: var(--success-border);
  color: var(--success);
}
.imp-banner--ok > svg { color: var(--success); flex: none; }

/* Inline cells */
.cell {
  display: flex; align-items: center; gap: 4px;
  min-height: 36px; padding: 4px 10px;
  font: 400 13px var(--font-sans); color: var(--fg-1);
  cursor: default;
}
.cell--editable { cursor: text; border-radius: 0; transition: background var(--dur-fast) var(--ease-standard); }
.cell--editable:hover { background: #F0F8F4; box-shadow: inset 0 0 0 1px var(--brand-primary); }
.cell--error { box-shadow: inset 0 0 0 1px var(--danger); }
.cell--error:hover { box-shadow: inset 0 0 0 1.5px var(--danger); }
.cell--formula { background: var(--gray-50); color: var(--fg-2); cursor: not-allowed; }
.cell--formula svg { color: var(--fg-4); }
/* .cell-empty → 已整合至 ui-kit.css */
.cell-formula { font-family: var(--font-mono); font-size: 12px; }
.cell-input {
  width: 100%; min-height: 36px;
  padding: 4px 10px; border: 2px solid var(--brand-primary);
  background: #fff; font: 400 13px var(--font-sans); color: var(--fg-1);
  outline: none; box-shadow: var(--shadow-focus);
}
.cell-input:focus { border-color: var(--brand-primary); }
.cell-input--err { border-color: var(--danger); box-shadow: none; }
.cell-err-msg {
  padding: 2px 10px 4px;
  font: 400 11px var(--font-sans);
  color: var(--danger);
  line-height: 1.3;
}

/* ============ Compound editors (competitor / promo) ============ */
.compound { display: flex; flex-direction: column; gap: 8px; }
.compound__row { display: flex; align-items: center; gap: 6px; }
.compound__lbl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 24px;
  background: var(--gray-100); border-radius: var(--radius-sm);
  font: 600 11px var(--font-mono); color: var(--fg-2);
}
.compound .field { flex: 1; }

/* ============ Wider drawer ============ */
.drawer--wide { width: min(880px, 92vw); }

/* ============ Misc ============ */
.help.err { color: var(--danger); }
/* .app__main / .page overrides → 已整合至 ui-kit.css */

/* Hide focus outline only when our custom focus ring is in play */
button:focus { outline: none; }

/* ============================================================ */
/* L2 Excel Rewrite — new classes                               */
/* ============================================================ */

/* ── FormMetaCard ─────────────────────────────────────────── */
.meta-card__body {
  display: flex; flex-direction: column;
  padding: 12px 16px;
}
.meta-card__row {
  display: grid; grid-template-columns: 200px 1fr;
  align-items: baseline; padding: 6px 0;
}
.meta-card__row dt {
  font: 400 12px var(--font-sans); color: var(--fg-3);
}
.meta-card__row dd {
  font: 400 13px var(--font-sans); color: var(--fg-1);
  margin: 0;
}

/* .applicant-chip → ui-kit.css（applicant-chip__initials 未使用，一併移除）*/

/* ── sku-card toolbar ─────────────────────────────────────── */
.sku-card { padding: 0; overflow: visible; }
/* .sku-toolbar → 已移至 ui-kit.css，此處刪除 */

/* ── segmented control → 已整合至 ui-kit.css ── */

/* ── sku-tbl wrapper ──────────────────────────────────────── */
.sku-tbl-wrap {
  overflow-x: auto;
  overflow-y: visible;
  outline: none;
  cursor: default;
  user-select: none;
}
.sku-tbl-wrap:focus { box-shadow: inset 0 0 0 2px var(--brand-primary); }

/* ── sku-tbl table ────────────────────────────────────────── */
.sku-tbl {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  font: 400 13px var(--font-sans);
}

/* ── thead rows: sticky ───────────────────────────────────── */
.sku-tbl thead th { position: sticky; background: #fff; z-index: 3; }
.sku-tbl__thead-r1 th { top: 0; }
.sku-tbl__thead-r2 th { top: 28px; }
.sku-tbl__thead-r3 th { top: 56px; }

/* ── group header colors ──────────────────────────────────── */
.sku-tbl__th-group {
  text-align: center; font: 600 11px var(--font-sans);
  letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 8px; border: 1px solid var(--border-1);
  height: 28px; white-space: nowrap;
}
/* Override sticky-header background: #fff (specificity 0,1,2) for group band cells */
.sku-tbl thead .th-a { background: var(--th-a-bg, #FFF8EC); color: var(--th-a-fg, #7A5A1A); }
.sku-tbl thead .th-b { background: var(--th-b-bg, #EEF6F7); color: var(--th-b-fg, #1A5A6A); }
.sku-tbl thead .th-c { background: var(--th-c-bg, #F3EEF8); color: var(--th-c-fg, #5A2A7A); }
.sku-tbl thead .th-d { background: var(--th-d-bg, #FFF0E8); color: var(--th-d-fg, #7A3A1A); }
.sku-tbl thead .th-e { background: var(--th-e-bg, #F4F4F2); color: var(--th-e-fg, #4A4A40); }
.sku-tbl thead .th-f { background: var(--th-e-bg, #F4F4F2); color: var(--th-e-fg, #4A4A40); }
.sku-tbl thead .th-g { background: #FCE8E8; color: #7A2E2E; }
.sku-tbl thead .th-h { background: #F0F4FA; color: #2A4A6B; }
.sku-tbl thead .th-i { background: #F3F0E8; color: #5B4A2E; }
.sku-tbl thead .th-j { background: var(--th-e-bg, #F4F4F2); color: var(--th-e-fg, #4A4A40); }

/* ── field/sub-band header ────────────────────────────────── */
.sku-tbl__th-field {
  padding: 4px 8px; font: 500 12px var(--font-sans); color: var(--fg-1);
  background: var(--gray-50); border: 1px solid var(--border-1);
  white-space: nowrap; text-align: left;
  height: 28px; vertical-align: middle;
}
.sku-tbl__th-req .req-star, .req-star { color: var(--danger); }
.sku-tbl__th-subband {
  text-align: center; font: 600 11px var(--font-sans); color: var(--fg-2);
  background: var(--gray-100); border: 1px solid var(--border-1);
  padding: 4px 8px; height: 28px;
}
.sku-tbl__th-ctrl {
  background: var(--gray-50); border: 1px solid var(--border-1);
  text-align: center; font: 500 11px var(--font-sans); color: var(--fg-3);
  padding: 0 4px; height: 28px; vertical-align: middle;
}

/* stk-shadow, stk-l-* → moved to ui-kit.css */

/* ── border-collapse: separate 補正 ───────────────────────── */
/* separate 模式每格有獨立 border，相鄰格會形成 2px；統一移除 top/left，只留 right/bottom */
.sku-tbl .sku-tbl__cell,
.sku-tbl .sku-tbl__td-ctrl,
.sku-tbl .sku-tbl__th-ctrl,
.sku-tbl .sku-tbl__th-field,
.sku-tbl .sku-tbl__th-group,
.sku-tbl .sku-tbl__th-subband { border-top: none; border-left: none; }
/* 第一欄補回 left border */
.sku-tbl td:first-child, .sku-tbl th:first-child { border-left: 1px solid var(--border-1); }
/* 第一 header row 補回 top border */
.sku-tbl thead tr:first-child th { border-top: 1px solid var(--border-1); }
/* 第一 data row 補回 top border */
.sku-tbl tbody tr:first-child td { border-top: 1px solid var(--border-1); }

/* ── data cells ───────────────────────────────────────────── */
.sku-tbl__cell {
  padding: 0; height: 36px; border: 1px solid var(--border-1);
  position: relative; vertical-align: top; overflow: visible;
  cursor: pointer;
}
.sku-tbl__cell--ro {
  background: var(--gray-50); cursor: not-allowed;
}
.sku-tbl__cell--na {
  background: repeating-linear-gradient(
    -45deg, var(--gray-50), var(--gray-50) 4px,
    var(--gray-100) 4px, var(--gray-100) 8px
  );
  cursor: not-allowed;
}
.sku-tbl__cell--err { box-shadow: inset 0 0 0 1.5px var(--danger); z-index: 2; }
.sku-tbl__cell.in-range { background: rgba(0,147,95,.08); }
.sku-tbl__cell.is-active {
  box-shadow: inset 0 0 0 2px var(--brand-primary);
  z-index: 3;
}
.sku-tbl__cell.is-editing { overflow: visible; z-index: 10; }

/* ── ctrl cells ───────────────────────────────────────────── */
.sku-tbl__td-ctrl {
  padding: 0 4px; border: 1px solid var(--border-1);
  text-align: center; vertical-align: middle;
  color: var(--fg-3); font: 400 12px var(--font-sans);
  background: var(--gray-50);
}

/* ── row hover ────────────────────────────────────────────── */
.sku-tbl__row:hover .sku-tbl__cell:not(.sku-tbl__cell--na) { background: rgba(0,0,0,.015); }
.sku-tbl__row:hover .sku-tbl__cell.in-range { background: rgba(0,147,95,.10); }
/* sticky 欄 hover 需用不透明底色，防止捲動內容穿透 */
.sku-tbl__row:hover .sku-tbl__cell.stk-l-0,
.sku-tbl__row:hover .sku-tbl__cell.stk-l-36,
.sku-tbl__row:hover .sku-tbl__cell.stk-l-40,
.sku-tbl__row:hover .sku-tbl__cell.stk-l-48,
.sku-tbl__row:hover .sku-tbl__cell.stk-l-72,
.sku-tbl__row:hover .sku-tbl__cell.stk-l-88 { background: var(--gray-50); }

/* 新增列按鈕：已改用全站共用 .tbl-add-row（ui-kit.css）；原 .sku-tbl__add-row 已移除 */

/* ── CellDisplay internals ────────────────────────────────── */
/* cell-na, cell-em, cell-formula-val, cell-bool-*, cell-nt → moved to ui-kit.css */
/* Exclude flex-based display types so their display:flex is not overridden */
.sku-tbl__cell > span,
.sku-tbl__cell > div:not(.cell-err-msg):not(.sku-tbl__fill-handle):not(.cv-radio):not(.cv-chips):not(.cv-tags):not(.cv-url):not(.cv-drange) {
  display: block; padding: 0 8px; line-height: 36px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
/* text fields: wrap vertically instead of overflowing horizontally */
.sku-tbl__cell > span.cv-text {
  white-space: pre-wrap; overflow-wrap: break-word;
  overflow: visible; text-overflow: unset;
  line-height: 1.5; padding: 9px 8px;
}

/* ── fill handle ──────────────────────────────────────────── */
.sku-tbl__fill-handle {
  position: absolute; bottom: -3px; right: -3px;
  width: 6px; height: 6px;
  background: var(--brand-primary); border: 1px solid #fff;
  border-radius: 1px; cursor: crosshair; z-index: 5;
}
.sku-tbl-wrap--fill-dragging { cursor: crosshair; }

/* cell-editor-*, cv-*, radio-*, chip-tag*, tag-item*, drange-*, img-marker* → moved to ui-kit.css */
/* when editing, cell-level active ring removed — input has its own border */
.sku-tbl__cell.is-active.is-editing { box-shadow: none; }

/* btn-icon, fdr-*, btn-adv* → moved to ui-kit.css */


/* ── row selected highlight ── */
tr.row--selected td { background: #EFF7F2 !important; }
