:root {
  --orange: #ff4f0a;
  --orange-dark: #e94505;
  --orange-soft: #fff3ed;
  --ink: #171717;
  --muted: #767676;
  --line: #e8e8e8;
  --line-strong: #dddddd;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --success: #24a865;
  --warning: #d97b00;
  --error: #d13f32;
  --sidebar-width: 194px;
  --radius: 8px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--surface); }
body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 9px 20px;
}

.brand-lockup img {
  width: 36px;
  height: 36px;
  flex: none;
  object-fit: contain;
}

.brand-lockup span {
  display: block;
  min-width: 0;
}

.brand-lockup strong {
  display: block;
  color: var(--orange);
  font-size: 18px;
  letter-spacing: .02em;
  line-height: 1.2;
}

.brand-lockup small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.app-nav {
  display: grid;
  gap: 3px;
  overflow: auto;
  scrollbar-width: thin;
}

.app-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 11px;
  border-radius: 7px;
  color: #4b4b4b;
}

.app-nav__item > i { flex: 0 0 auto; font-size: 20px; }
.app-nav__item > span { min-width: 0; }

.app-nav__item:hover,
.app-nav__item:focus-visible {
  color: var(--orange);
  background: var(--orange-soft);
}

.app-nav__item:focus-visible {
  outline: 3px solid rgba(255, 79, 10, .28);
  outline-offset: 2px;
}

.app-nav__item.is-active {
  color: var(--orange-dark);
  background: var(--orange-soft);
  font-weight: 700;
}

.app-nav__secondary {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.app-nav__secondary > span {
  padding: 0 11px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.app-main-column {
  min-width: 0;
  min-height: 100vh;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar-title span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .03em;
}

.topbar-title strong {
  margin-top: 1px;
  font-size: 18px;
  line-height: 1.3;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.app-page {
  min-width: 0;
  min-height: calc(100vh - 74px);
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px 32px 54px;
}

.app-page:focus { outline: none; }

.app-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  font-weight: 680;
  white-space: nowrap;
}

.app-button:hover { border-color: #bdbdbd; background: var(--surface-soft); }
.app-button.primary { border-color: var(--orange); color: #fff; background: var(--orange); }
.app-button.primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }
.app-button.compact { min-height: 40px; padding: 0 13px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 26px 14px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
  z-index: 20;
}

.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--orange);
  font-size: 18px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--orange);
  border-radius: 50%;
  font-size: 20px;
}

.side-nav { margin-top: 28px; display: grid; gap: 10px; }
.nav-item {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
}
.nav-item i { font-size: 23px; }
.nav-item:hover { background: #fafafa; }
.nav-item.is-active { color: var(--orange); background: var(--orange-soft); font-weight: 650; }

.sidebar-user {
  position: static;
  margin-top: auto;
  padding: 16px 8px 2px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user div > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.user-avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-dark); }
.logout-form { margin-left: auto; }
.logout-button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #888; cursor: pointer; }
.logout-button:hover { color: var(--orange); background: var(--orange-soft); }

.login-page { min-height: 100vh; background: #fff8f4; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 42px 40px 30px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 20px 60px rgba(40,30,20,.09); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; color: var(--orange); font-size: 20px; font-weight: 750; letter-spacing: .06em; }
.login-brand .brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--orange); border-radius: 50%; font-size: 22px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.login-subtitle { margin: 8px 0 26px; color: var(--muted); }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; }
.login-form label > span { color: #4f4f4f; font-size: 13px; font-weight: 650; }
.login-form input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; background: #fff; }
.login-form input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,79,10,.1); }
.login-submit { width: 100%; height: 46px; margin-top: 4px; }
.login-error { display: flex; align-items: center; gap: 7px; margin: -8px 0 18px; padding: 10px 12px; border: 1px solid #f0c1bb; border-radius: 7px; background: #fff3f1; color: var(--error); }
.login-footnote { margin: 26px 0 0; color: #999; font-size: 12px; text-align: center; }

.search-page, .product-page { min-width: 0; }

.search-topbar {
  height: 108px;
  display: grid;
  grid-template-columns: 230px minmax(520px, 740px);
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
}
.search-topbar h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.search-command {
  height: 62px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px 110px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.search-command:focus-within { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,79,10,.08); }
.command-thumb { width: 42px; height: 42px; margin-left: 10px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; color: #aaa; background: #f2f2f2; }
.command-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-command input { height: 100%; border: 0; outline: 0; padding: 0 15px; font-size: 16px; min-width: 0; }
.icon-button { width: 56px; height: 42px; border: 0; border-left: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 25px; }
.icon-button:hover { color: var(--orange); }
.primary-button, .secondary-button, .source-button {
  min-height: 42px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.primary-button { border: 1px solid var(--orange); background: var(--orange); color: #fff; font-weight: 650; padding: 0 20px; }
.primary-button:hover:not(:disabled) { background: var(--orange-dark); border-color: var(--orange-dark); }
.primary-button:disabled, .secondary-button:disabled, .text-button:disabled { cursor: not-allowed; opacity: .42; }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; padding: 0 17px; }
.secondary-button:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.search-button { height: 62px; border-radius: 0; font-size: 17px; }

.search-workbench { min-height: calc(100vh - 108px); display: grid; grid-template-columns: 36% 64%; }
.query-panel { padding: 32px 22px 32px 26px; border-right: 1px solid var(--line); }
.results-panel { padding: 32px 26px 50px; }
.panel-heading, .results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.panel-heading h2, .results-heading h2 { margin: 0; font-size: 20px; }
.results-heading > p { margin: 23px 0 0; color: var(--muted); }
.local-badge { margin-top: 15px; display: inline-flex; align-items: center; gap: 5px; color: #5f6d66; font-size: 12px; }
.count-text { color: var(--muted); font-weight: 400; }

.drop-zone {
  position: relative;
  width: 100%;
  min-height: 390px;
  border: 1px dashed #d7d7d7;
  border-radius: var(--radius);
  background: var(--surface-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
  outline: none;
}
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--orange); background: #fffaf7; }
.drop-zone:focus-visible { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,79,10,.13); }
.drop-zone > img { display: none; width: 100%; height: 390px; object-fit: contain; background: #f5f5f5; }
.drop-zone.has-image > img { display: block; }
.drop-zone.has-image .empty-prompt { display: none; }
.empty-prompt { display: grid; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }
.empty-prompt i { font-size: 48px; color: #bcbcbc; }
.empty-prompt strong { color: #333; font-size: 18px; }
.empty-prompt span { font-size: 13px; }
.query-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.search-status { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.search-status strong { font-size: 15px; }
.search-status p { margin: 3px 0 0; color: var(--muted); }
.status-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #b5b5b5; flex: none; }
.search-status.is-loading .status-dot { background: var(--orange); animation: pulse 1s infinite; }
.search-status.is-success .status-dot { background: var(--success); }
.search-status.is-error .status-dot { background: var(--error); }
@keyframes pulse { 50% { opacity: .35; } }

.search-history { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.search-history-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search-history-heading h3 { margin: 0; font-size: 17px; }
.search-history-heading > span { color: var(--muted); font-size: 12px; }
.search-history-list { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 3px; }
.search-history-empty { margin: 8px 0; color: var(--muted); font-size: 13px; }
.search-history-item { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.search-history-item:hover { border-color: #ffc2a8; background: #fffaf7; }
.history-restore { min-width: 0; border: 0; background: transparent; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; text-align: left; }
.history-restore img { width: 58px; height: 58px; border-radius: 6px; object-fit: contain; background: #f4f4f4; }
.history-copy { min-width: 0; display: grid; gap: 3px; }
.history-copy strong, .history-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-copy strong { color: #222; font-size: 13px; }
.history-copy span { color: var(--muted); font-size: 12px; }
.history-delete { border: 0; border-left: 1px solid var(--line); background: transparent; color: #aaa; }
.history-delete:hover { color: var(--error); background: #fff5f5; }

.results-empty { min-height: 570px; display: grid; align-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }
.results-empty i { font-size: 52px; color: #c6c6c6; }
.results-empty strong { color: #444; font-size: 17px; }
.results-list { display: grid; gap: 14px; }
.result-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
.result-card:first-child { border-color: var(--orange); background: #fffaf7; }
.result-grid { display: grid; grid-template-columns: 56px 122px minmax(0, 1fr); gap: 16px; align-items: center; }
.match-score { text-align: center; }
.match-score strong { display: block; color: var(--orange); font-size: 25px; font-weight: 650; }
.match-score span { color: var(--muted); font-size: 12px; }
.result-thumb { width: 122px; height: 122px; border-radius: 7px; overflow: hidden; background: #f1f1f1; display: grid; place-items: center; }
.result-thumb img { width: 100%; height: 100%; object-fit: contain; }
.result-info h3 { margin: 0 0 3px; font-size: 18px; line-height: 1.35; }
.result-location { margin: 0 0 15px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.open-folder-button { min-width: 0; max-width: 420px; padding: 2px 7px; border: 0; border-radius: 4px; overflow: hidden; color: #555; background: var(--surface-soft); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.open-folder-button:hover { color: var(--orange); background: var(--orange-soft); }
.open-folder-button:disabled { opacity: .6; cursor: wait; }
.detail-folder-button { max-width: 100%; text-align: left; }
.detail-folder-actions { min-width: 0; display: flex; align-items: center; gap: 7px; }
.detail-folder-actions .detail-folder-button { flex: 1; }
.detail-folder-button { max-width: none; overflow-x: auto; overflow-y: hidden; text-overflow: clip; }
.detail-copy-folder-button { flex: none; min-width: 30px; min-height: 28px; width: 30px; height: 28px; padding: 0; gap: 0; white-space: nowrap; }
.detail-copy-folder-button.is-copied { border-color: var(--success); color: var(--success); }
.result-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.result-facts div { min-width: 0; }
.result-facts dt { color: var(--muted); font-size: 12px; }
.result-facts dd { margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-side { grid-column: 2 / -1; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.evidence-label { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.evidence-list { display: flex; gap: 7px; }
.evidence-image { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 5px; object-fit: cover; background: #f4f4f4; }
.result-actions { width: min(370px, 52%); display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.result-actions .primary-button, .result-actions .secondary-button { min-height: 40px; }
.low-confidence-note { margin-top: 12px; color: var(--warning); font-size: 12px; }

.back-link { margin: 26px 28px 16px; display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.back-link:hover { color: var(--orange); border-color: var(--orange); }
.product-header { margin: 0 28px; min-height: 304px; display: grid; grid-template-columns: 310px minmax(430px, 1fr) 210px; gap: 38px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.product-main-image { width: 290px; height: 264px; display: grid; place-items: center; border-radius: 6px; background: #f5f5f5; overflow: hidden; color: #bbb; font-size: 46px; }
.product-main-image img { width: 100%; height: 100%; object-fit: contain; }
.product-identity { padding-top: 3px; min-width: 0; }
.product-identity h1 { margin: 0; font-size: 25px; line-height: 1.35; }
.product-name-en { margin: 4px 0 14px; color: var(--muted); font-size: 16px; }
.identity-list { margin: 0; display: grid; gap: 6px; }
.identity-list div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 10px; }
.identity-list dt { color: var(--muted); }
.identity-list dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-summary { display: flex; flex-direction: column; }
.source-button { height: 44px; border: 1px solid var(--orange); color: var(--orange); font-size: 16px; font-weight: 600; }
.source-button:hover { background: var(--orange-soft); }
.source-button.is-disabled { border-color: #ccc; color: #aaa; }
.summary-metrics { margin: 24px 0 0; }
.summary-metrics div { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 6px; border-bottom: 1px solid var(--line); }
.summary-metrics dt { color: var(--muted); }
.summary-metrics dd { margin: 0; font-size: 24px; }

.product-tabs { margin: 18px 28px 0; display: flex; gap: 16px; border-bottom: 1px solid var(--line); }
.tab-button { min-width: 128px; height: 54px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; font-size: 16px; }
.tab-button:hover { color: var(--orange); }
.tab-button.is-active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 650; }
.tab-panel { display: none; margin: 12px 28px 40px; }
.tab-panel.is-active { display: block; }
.product-pricing-bar { min-height: auto; margin-bottom: 12px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px; border: 1px solid #ffd3c1; border-radius: 7px; background: var(--orange-soft); }
.pricing-summary { display: grid; gap: 2px; flex: 1 1 200px; min-width: 180px; }
.pricing-summary > span, .product-pricing-form label span { color: var(--muted); font-size: 12px; }
.pricing-summary strong { font-size: 17px; }
.pricing-summary small { color: #666; }
.sku-filter-field { width: min(320px, 24vw); min-width: 200px; display: grid; gap: 5px; flex: 1 1 200px; }
.sku-filter-field > span:first-child { color: var(--muted); font-size: 12px; }
.sku-filter-input-wrap { height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #efc6b5; border-radius: 6px; background: #fff; }
.sku-filter-input-wrap:focus-within { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255, 79, 21, .12); }
.sku-filter-input-wrap i { color: var(--muted); font-size: 17px; }
.sku-filter-input-wrap input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; }
.sku-filter-field small { color: #777; }
.product-pricing-form { position: relative; padding-bottom: 19px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; flex: 2 1 auto; }
.product-pricing-form fieldset { min-width: 270px; padding: 8px 10px 10px; display: flex; align-items: end; gap: 8px; border: 1px solid #efc6b5; border-radius: 6px; }
.product-pricing-form legend { padding: 0 5px; color: #8a4b31; font-size: 11px; font-weight: 650; }
.product-pricing-form label { display: grid; gap: 4px; }
.product-pricing-form input { width: 110px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.product-pricing-form .secondary-button { height: 38px; }
.pricing-or { padding-bottom: 9px; color: var(--muted); }
.pricing-inherit-note { position: absolute; right: 0; bottom: 0; color: var(--muted); white-space: nowrap; }
.sku-toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.sku-toolbar > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.sku-toolbar > div:first-child span { color: var(--muted); }
.sku-scroll-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--orange); background: #fff; border: 1px solid #fedcd0; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.text-button { height: 40px; padding: 0 8px; border: 0; background: transparent; cursor: pointer; }
.text-button:hover:not(:disabled) { color: var(--orange); }
.sku-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 7px 7px; scrollbar-color: #fca27e #fff5f0; scrollbar-width: thin; }
.sku-table-wrap::-webkit-scrollbar { height: 10px; background: #fff5f0; }
.sku-table-wrap::-webkit-scrollbar-track { background: #fdf5f2; border-radius: 5px; }
.sku-table-wrap::-webkit-scrollbar-thumb { background: #fca27e; border-radius: 5px; border: 2px solid #fdf5f2; }
.sku-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--orange); }
.sku-table { width: 100%; min-width: 1190px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.sku-table th { height: 44px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--surface-soft); text-align: left; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sku-table td { min-height: 76px; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; background: #fff; }
.sku-table tbody tr:last-child td { border-bottom: 0; }
.sku-table tbody tr[hidden] { display: none; }
.sku-table tbody tr:hover td { background: #fffaf7; }
.sku-table th:nth-child(1), .sku-table td:nth-child(1) { position: sticky; left: 0; z-index: 2; }
.sku-table th:nth-child(2), .sku-table td:nth-child(2) { position: sticky; left: 38px; z-index: 2; }
.sku-table th:nth-child(3), .sku-table td:nth-child(3) { position: sticky; left: 98px; z-index: 2; box-shadow: 4px 0 8px -2px rgba(0, 0, 0, .07); }
.sku-table th:nth-child(1), .sku-table th:nth-child(2), .sku-table th:nth-child(3) { z-index: 4; background: var(--surface-soft); }
.sku-table th:nth-child(1) { width: 38px; }
.sku-table th:nth-child(2) { width: 60px; }
.sku-table th:nth-child(3) { width: 175px; }
.sku-table th:nth-child(4) { width: 125px; }
.sku-table th:nth-child(5) { width: 105px; }
.sku-table th:nth-child(6) { width: 100px; }
.sku-table th:nth-child(7) { width: 85px; }
.sku-table th:nth-child(8) { width: 125px; }
.sku-table th:nth-child(9) { width: 85px; }
.sku-table th:nth-child(10) { width: 95px; }
.sku-table th:nth-child(11) { width: 85px; }
.sku-table th:nth-child(12) { width: 115px; }
.check-cell { text-align: center !important; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--orange); cursor: pointer; }
.sku-image { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 5px; overflow: hidden; background: #f2f2f2; color: #aaa; font-size: 22px; }
.sku-image img { width: 100%; height: 100%; object-fit: contain; }
.sku-image-button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.sku-image-button:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.sku-spec-copy { max-width: 100%; padding: 3px 5px; margin: -3px -5px; border: 0; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; background: transparent; text-align: left; cursor: copy; }
.sku-spec-copy strong { overflow-wrap: anywhere; }
.sku-spec-copy i { flex: none; color: #aaa; opacity: 0; }
.sku-spec-copy:hover { color: var(--orange); background: var(--orange-soft); }
.sku-spec-copy:hover i, .sku-spec-copy:focus-visible i, .sku-spec-copy.is-copied i { opacity: 1; }
.sku-spec-copy.is-copied { color: var(--success); background: #effaf4; }
.sku-spec-copy:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.sku-table td.is-last-copied { background: #eaf4ff !important; box-shadow: inset 4px 0 #1677ff; }
.price-copy-row { display: flex; align-items: center; gap: 4px; }
.price-copy-row .inline-price-editor { width: 84px; }
.sku-price-copy { width: 30px; height: 32px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #888; cursor: copy; }
.sku-price-copy:hover, .sku-price-copy:focus-visible { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }
.sku-price-copy.is-copied { border-color: var(--success); color: var(--success); background: #effaf4; }
.price-source-note { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; white-space: nowrap; }
.margin-cell { font-weight: 650; color: #177245; }
.margin-cell.is-loss, .selling-price-cell.is-loss { color: var(--error); background: #fff3f1; }
.loss-note { display: block; margin-top: 3px; color: var(--error); font-size: 10px; }
.sku-image-dialog { width: min(900px, calc(100vw - 40px)); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.sku-image-dialog::backdrop { background: rgba(18, 18, 18, .72); }
.sku-image-dialog-shell { padding: 18px; background: #fff; }
.sku-image-dialog-shell .dialog-head { margin-bottom: 14px; }
.sku-image-dialog-shell h2 { max-width: 760px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.sku-image-dialog-shell > img { display: block; width: 100%; max-height: 76vh; object-fit: contain; background: #f6f6f6; }
.mapping-note { display: block; margin-top: 3px; color: var(--warning); font-size: 11px; font-weight: 400; }
.mapping-confirmed-note { display: block; margin-top: 3px; color: var(--success); font-size: 11px; font-weight: 400; }
.mono-text { font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; }
.price-cell { font-weight: 650; }
.inline-price-editor { display: flex; align-items: center; width: 90px; height: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.inline-price-editor:focus-within { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255, 79, 21, .12); }
.inline-price-editor > span { padding-left: 7px; color: #555; font-size: 12px; }
.inline-price-editor input { width: 100%; min-width: 0; height: 100%; padding: 0 6px 0 2px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 650; }
.price-cell > small { display: block; margin-top: 4px; color: #8b8b8b; font-size: 10px; font-weight: 400; }
.missing-value { color: var(--error); font-weight: 500; }
.cost-cell { color: var(--muted); }
.cost-cell strong { display: block; color: var(--ink); }
.cost-cell span { display: block; max-width: 120px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-copy-button, .row-cost-button, .row-confirm-button, .row-price-save-button, .row-price-restore-button { display: block; border: 0; background: none; cursor: pointer; padding: 2px 0; font-size: 12px; }
.row-copy-button { color: var(--orange); font-weight: 600; }
.row-price-save-button { color: var(--orange); font-weight: 650; }
.row-price-restore-button { color: #777; }
.row-copy-button:disabled { color: #aaa; cursor: not-allowed; }
.row-cost-button { margin-top: 2px; color: #666; font-size: 12px; }
.row-confirm-button { color: var(--warning); font-size: 12px; font-weight: 600; }
.placeholder-panel, .not-found { min-height: 390px; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.placeholder-panel.is-active { display: grid; }
.placeholder-panel i, .not-found i { font-size: 52px; color: #bbb; }
.placeholder-panel h2, .not-found h1 { margin: 10px 0 3px; color: var(--ink); }
.placeholder-panel p { margin: 0; }
.data-panel { padding: 8px 0; }
.data-panel h2 { font-size: 20px; }
.archive-section { margin: 22px 0; padding: 20px 0; border-top: 1px solid var(--line); }
.archive-section:first-of-type { margin-top: 0; border-top: 0; }
.archive-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.archive-section-heading h3 { margin: 0; font-size: 17px; }
.archive-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.archive-description-input { width: 100%; min-height: 132px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; resize: vertical; line-height: 1.65; }
.archive-description-input:focus, .archive-fact-row input:focus, .note-form textarea:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 2px rgba(255,79,21,.10); }
.archive-fact-table { border-top: 1px solid var(--line); }
.archive-fact-row { min-height: 54px; display: grid; grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr) 56px; gap: 0; align-items: center; border-bottom: 1px solid var(--line); }
.archive-fact-row input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; }
.archive-fact-row input:first-child { color: var(--muted); font-weight: 600; }
.archive-fact-row input:nth-child(2) { border-color: var(--line); background: #fff; }
.archive-fact-remove { justify-self: end; color: #9a5a49; font-size: 12px; }
.archive-source-details { margin: 24px 0; border-top: 1px solid var(--line); }
.archive-source-details summary { padding: 15px 2px; color: var(--muted); cursor: pointer; }
.archive-source-details[open] summary { color: var(--orange); }
.quote-packaging-details { margin: 24px 0; border-top: 1px solid var(--line); }
.quote-packaging-details > summary { padding: 15px 2px; color: var(--muted); cursor: pointer; }
.quote-packaging-details[open] > summary { color: var(--orange); }
.note-form { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.note-form textarea { width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 7px; resize: vertical; background: #fff; }
.note-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.notes-list { display: grid; gap: 10px; margin-top: 20px; }
.note-item { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.note-item p { margin: 0; white-space: pre-wrap; line-height: 1.65; }
.note-item footer { margin-top: 8px; color: var(--muted); font-size: 12px; }
.archive-history-table { min-width: 900px; }
.archive-history-table td { max-width: 300px; word-break: break-word; white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.product-packaging-card { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.product-packaging-card .section-heading { margin-bottom: 16px; }
.product-packaging-card h3 { margin: 0; font-size: 18px; }
.product-packaging-status { min-height: 20px; margin: 14px 0 0; color: var(--muted); }
.packaging-entry-sections { display: grid; gap: 16px; }
.packaging-entry-section { padding-top: 16px; border-top: 1px solid var(--line); }
.packaging-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.packaging-entry-heading h4 { margin: 0; font-size: 14px; }
.packaging-entry-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.packaging-entry-list { display: grid; gap: 10px; }
.packaging-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.packaging-entry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.packaging-entry-fields label { display: grid; gap: 6px; }
.packaging-entry-fields label > span { color: #555; font-size: 12px; font-weight: 600; }
.packaging-entry-fields textarea { width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 7px; resize: vertical; }
.packaging-entry-fields textarea:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 2px rgba(255,79,10,.08); }
.packaging-entry-remove { margin-top: 24px; color: #b7442a; }
.data-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.data-list div { display: grid; grid-template-columns: 140px 1fr; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; word-break: break-all; }
.issue-list { margin-top: 22px; display: grid; gap: 8px; }
.issue-row { display: flex; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.issue-row.is-error { border-color: #f0c7c2; color: var(--error); }
.issue-row.is-warning { border-color: #f1d7af; color: var(--warning); }
.issue-row p { margin: 2px 0 0; color: #555; }
.no-issues { color: var(--success); }
.not-found { margin-left: 0; display: grid; }

.management-panel { padding: 10px 0; }
.section-heading, .list-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2, .list-header h1 { margin: 0; font-size: 23px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.supplier-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.supplier-card { min-height: 190px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.supplier-card-head { display: flex; justify-content: space-between; gap: 18px; }
.supplier-card-head h3 { margin: 0; font-size: 17px; }
.supplier-card-head p { margin: 3px 0 0; color: var(--muted); }
.supplier-card-head > span { flex: none; height: 27px; padding: 3px 9px; border-radius: 99px; color: var(--orange); background: var(--orange-soft); font-size: 12px; }
.supplier-card dl { margin: 18px 0 12px; display: grid; gap: 6px; }
.supplier-card dl div { display: grid; grid-template-columns: 52px 1fr; gap: 8px; min-width: 0; }
.supplier-card dt { color: var(--muted); }
.supplier-card dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-card > a { color: var(--orange); font-weight: 600; }
.empty-card { min-height: 190px; padding: 26px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; align-content: center; gap: 5px; color: var(--muted); text-align: center; }
.empty-card i { font-size: 40px; color: #bbb; }
.empty-card strong { color: var(--ink); font-size: 16px; }
.history-block { margin-top: 28px; }
.history-block h3 { margin: 0 0 12px; font-size: 18px; }
.history-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { height: 44px; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.history-table th { background: var(--surface-soft); }
.history-table tr:last-child td { border-bottom: 0; }
.empty-table { height: 100px !important; color: var(--muted); text-align: center !important; }
.timeline { max-width: 900px; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 1px; background: var(--line-strong); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 17px; border: 4px solid var(--orange-soft); border-radius: 50%; background: var(--orange); }
.timeline-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.timeline-card header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.timeline-card header span { color: var(--muted); font-size: 12px; }
.timeline-card p { margin: 10px 0; font-size: 15px; }
.timeline-card > div { margin-top: 5px; color: #555; }
.timeline-card small { display: block; margin-top: 8px; color: var(--muted); }
.timeline-card .follow-up { color: var(--orange); }
.list-page { min-width: 0; padding: 36px; }
.list-header { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.list-header h1 { font-size: 30px; }
.list-header > span { color: var(--muted); }
.list-page .issue-list { margin-top: 0; }
.list-page .issue-row small { color: var(--muted); }

/* Support pages share the approved CRM shell but used to retain a thin,
   legacy content treatment. This layer normalizes their cards and empty
   states without changing any page-level data or actions. */
.list-page .eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.list-page .list-header {
  align-items: end;
  min-height: 112px;
  margin-bottom: 20px;
}

.list-page .list-header h1 {
  font-size: 28px;
  letter-spacing: -.02em;
}

.list-page .list-header > span {
  padding-bottom: 4px;
  font-size: 13px;
}

.list-page .empty-card,
.list-page .no-issues {
  min-height: 230px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fffdfa;
  text-align: center;
}

.list-page .supplier-grid > .empty-card {
  grid-column: 1 / -1;
}

.list-page .no-issues {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  margin: 0;
  color: var(--success);
  font-weight: 650;
}

.list-page .no-issues i {
  font-size: 34px;
}

.list-page .issue-row {
  border-radius: 9px;
  background: #fff;
  transition: border-color .15s ease, transform .15s ease;
}

.list-page .issue-row:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}

.list-page .settings-card,
.list-page .history-block {
  max-width: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 0 rgb(23 23 23 / 2%);
}

.list-page .settings-card + .settings-card,
.list-page .history-block + .history-block {
  margin-top: 16px;
}

.list-page .settings-card input,
.list-page .settings-card select,
.list-page .history-block input,
.list-page .history-block select {
  min-height: 42px;
  border-radius: 7px;
}
.eyebrow { margin: 0 0 3px; color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.settings-card { max-width: 980px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.settings-card-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.settings-card-head h2 { margin: 0; font-size: 21px; }
.settings-card-head p { margin: 4px 0 0; color: var(--muted); }
.settings-status { flex: none; padding: 7px 11px; border-radius: 99px; color: var(--orange); background: var(--orange-soft); font-weight: 600; }
.settings-form-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.settings-form-grid label { display: grid; gap: 6px; }
.settings-form-grid label > span { font-weight: 600; }
.settings-form-grid input, .settings-form-grid select { width: 100%; height: 44px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.settings-form-grid small { color: var(--muted); }
.pricing-formula { margin-top: 20px; padding: 14px 16px; display: flex; gap: 16px; border-radius: 6px; background: var(--surface-soft); }
.pricing-formula span { color: #555; }
.settings-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.library-search { width: min(760px, 100%); height: 50px; margin-bottom: 22px; display: grid; grid-template-columns: 44px 1fr 92px; align-items: center; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.library-search > i { justify-self: center; color: var(--muted); font-size: 20px; }
.library-search input { height: 100%; min-width: 0; border: 0; outline: 0; }
.library-search .primary-button { height: 50px; border-radius: 0; }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 15px; }
.library-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.library-image { position: relative; width: 100%; height: auto; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; background: #f6f6f6; color: #bbb; font-size: 40px; }
.library-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.library-card-body { padding: 15px; }
.library-card-body > p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.library-card-body h2 { display: none; }
.library-card-body h2 a:hover { color: var(--orange); }
.library-card-body dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.library-card-body dl div:last-child { grid-column: 1 / -1; }
.library-card-body dt { color: var(--muted); font-size: 11px; }
.library-card-body dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-actions { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.library-actions a { min-height: 38px; }

.form-dialog { width: min(520px, calc(100vw - 40px)); max-height: calc(100vh - 56px); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: auto; }
.form-dialog.wide-dialog { width: min(650px, calc(100vw - 40px)); }
.form-dialog.quotation-preview-dialog { width: min(920px, calc(100vw - 40px)); }
.form-dialog::backdrop { background: rgba(20,20,20,.42); }
.form-dialog form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-head p { margin: 0 0 2px; color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.dialog-head h2 { margin: 0; max-width: 440px; font-size: 21px; }
.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-soft); cursor: pointer; font-size: 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid label > span { color: #555; font-size: 13px; font-weight: 600; }
.form-grid input:not([type="checkbox"]), .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 10px; outline: 0; background: #fff; }
.form-grid input:not([type="checkbox"]), .form-grid select { height: 42px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,79,10,.08); }
.full-field { grid-column: 1 / -1; }
.check-options { display: flex; align-items: end; gap: 18px; padding-bottom: 8px; }
.check-options label { display: flex; align-items: center; gap: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.quotation-preview-shell { padding: 22px; }
.quotation-preview-brand { position: relative; min-height: 96px; display: flex; align-items: center; gap: 22px; padding: 14px 18px; overflow: hidden; border: 1px solid #d9e5e0; border-radius: 8px; background: #f6faf8; }
.quotation-preview-brand::after { content: "CTPET"; position: absolute; right: 30px; color: rgba(0,88,61,.06); font-size: 70px; font-weight: 800; transform: rotate(-12deg); }
.quotation-preview-brand img { position: relative; z-index: 1; width: 138px; height: 72px; object-fit: contain; }
.quotation-preview-brand > div { position: relative; z-index: 1; display: grid; gap: 5px; }
.quotation-preview-brand strong { font-size: 17px; }
.quotation-preview-brand span { color: var(--muted); }
.quotation-preview-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quotation-preview-item { min-height: 132px; display: grid; grid-template-columns: 112px 1fr; gap: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.quotation-preview-item > img, .quotation-preview-placeholder { width: 112px; height: 112px; display: grid; place-items: center; border-radius: 6px; background: #f4f5f4; object-fit: contain; color: #aaa; font-size: 28px; }
.quotation-preview-item > div:last-child { min-width: 0; display: grid; align-content: center; gap: 5px; }
.quotation-preview-item span { color: var(--muted); font-size: 11px; }
.quotation-preview-item strong { line-height: 1.45; }
.quotation-preview-item b { color: #00583d; font-size: 17px; }
.field-dialog-help { margin: 0 0 16px; color: var(--muted); line-height: 1.55; }
.export-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.export-field-grid label { min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.export-field-grid label.is-required { border-color: #b9d8ca; background: #f3faf7; cursor: default; }
.export-field-grid label.is-internal { background: #fffaf4; }
.export-field-grid label span { margin-left: auto; color: var(--muted); font-size: 10px; }

.toast { position: fixed; right: 28px; bottom: 28px; z-index: 50; min-width: 220px; max-width: 420px; padding: 12px 16px; border-radius: 7px; color: #fff; background: #242424; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--error); }

.quotation-editor-page { min-width: 0; padding: 28px 30px 44px; }
.quotation-editor-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.quotation-editor-topbar h1 { margin: 0; font-size: 30px; }
.quotation-editor-subtitle { margin: 8px 0 0; color: var(--muted); }
.quotation-editor-actions { display: flex; align-items: center; gap: 10px; }
.quotation-editor-flash { margin: 18px 0; padding: 12px 14px; border: 1px solid #d7e8dd; border-radius: 8px; background: #f5fbf7; color: #245c3f; }
.quotation-editor-flash.is-error { border-color: #f0c1bb; background: #fff3f1; color: var(--error); }
.quotation-editor-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(360px, .95fr); gap: 22px; align-items: start; }
.quotation-editor-main, .quotation-editor-side { display: grid; gap: 18px; }
.quotation-editor-module { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quotation-editor-module h2 { margin: 0; font-size: 20px; }
.quotation-editor-module .section-heading p { margin: 6px 0 0; color: var(--muted); }
.quotation-packaging-groups { display: grid; gap: 16px; }
.quotation-packaging-group { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.quotation-packaging-group h3 { margin: 0 0 12px; font-size: 14px; }
.quotation-editor-grid.six-column { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.quotation-editor-grid { display: grid; gap: 12px; margin-top: 16px; }
.quotation-editor-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quotation-editor-grid.four-column { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quotation-field { display: grid; gap: 6px; min-width: 0; }
.quotation-field.full-span { grid-column: 1 / -1; }
.quotation-field > span { color: #515151; font-size: 12px; }
.quotation-field input, .quotation-field textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; outline: 0; }
.quotation-field input:focus, .quotation-field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,79,10,.08); }
.quotation-image-field { margin-top: 16px; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border: 1px dashed #dcdcdc; border-radius: 10px; background: var(--surface-soft); }
.quotation-image-preview, .quotation-image-fallback { width: 140px; height: 140px; display: grid; place-items: center; border-radius: 8px; background: #f0f0f0; overflow: hidden; color: #b3b3b3; font-size: 28px; }
.quotation-image-preview img, .quotation-sku-media img, .quotation-preview-card-media img { width: 100%; height: 100%; object-fit: contain; }
.quotation-image-meta { display: grid; gap: 7px; min-width: 0; }
.quotation-image-meta > span { color: var(--muted); word-break: break-all; }
.quotation-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quotation-sku-list, .quotation-shipping-list { display: grid; gap: 14px; margin-top: 16px; }
.quotation-sku-card, .quotation-shipping-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; }
.quotation-sku-row, .quotation-tiered-sku { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.quotation-sku-media { display: grid; gap: 10px; }
.quotation-sku-media .quotation-image-fallback, .quotation-sku-media img { width: 160px; height: 160px; border-radius: 8px; background: #f4f4f4; }
.quotation-sku-fields { display: grid; gap: 12px; min-width: 0; }
.quotation-sku-meta, .quotation-mode-note, .quotation-muted-panel, .quotation-empty-note { padding: 12px 14px; border-radius: 8px; background: var(--surface-soft); color: #5f5f5f; }
.quotation-tier-list { display: grid; gap: 10px; }
.quotation-tier-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fcfcfc; }
.quotation-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.quotation-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.quotation-switch input { width: 16px; height: 16px; }
.quotation-locked-list, .quotation-export-brand-locks, .quotation-export-grid { display: grid; gap: 10px; margin-top: 16px; }
.quotation-locked-item, .quotation-checkbox { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.quotation-locked-item strong { min-width: 0; color: #353535; font-size: 12px; word-break: break-all; }
.quotation-locked-item em, .quotation-checkbox em { color: var(--muted); font-style: normal; font-size: 12px; }
.quotation-checkbox input { width: 16px; height: 16px; }
.quotation-checkbox.is-locked { background: #fafafa; }
.quotation-checkbox.is-hidden { display: none; }
.quotation-preview-status { padding: 12px 14px; border-radius: 8px; background: var(--orange-soft); color: #7c310f; font-weight: 600; }
.quotation-preview-body { display: grid; gap: 14px; margin-top: 14px; }
.quotation-preview-summary { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quotation-preview-summary h3 { margin: 0; font-size: 18px; }
.quotation-preview-summary p { margin: 6px 0 0; color: var(--muted); }
.quotation-preview-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quotation-preview-facts div, .quotation-preview-card dl div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.quotation-preview-facts dt, .quotation-preview-card dt { color: var(--muted); font-size: 12px; }
.quotation-preview-facts dd, .quotation-preview-card dd { margin: 3px 0 0; word-break: break-word; }
.quotation-preview-list, .quotation-preview-shipping { display: grid; gap: 12px; }
.quotation-preview-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quotation-preview-card.is-shipping { grid-template-columns: minmax(0, 1fr); }
.quotation-preview-card-media .quotation-image-fallback, .quotation-preview-card-media img { width: 116px; height: 116px; border-radius: 8px; background: #f4f4f4; }
.quotation-preview-card-copy { min-width: 0; display: grid; gap: 10px; }
.quotation-preview-card-copy.is-wide { width: 100%; }
.quotation-preview-card-copy strong { font-size: 16px; line-height: 1.4; }
.quotation-preview-card-copy dl { margin: 0; display: grid; gap: 8px; }
.has-error { border-color: #ef8f84 !important; background: #fff7f6 !important; box-shadow: 0 0 0 1px rgba(209,63,50,.08); }
.quotation-error-text { margin-top: 6px; color: var(--error); font-size: 12px; }

@media (max-width: 1440px) {
  .product-header { grid-template-columns: 260px minmax(280px, 1fr) 190px; gap: 24px; padding: 16px; }
  .product-main-image { width: 240px; height: 230px; }
  .product-pricing-bar { padding: 12px 14px; }
  .product-pricing-form fieldset { min-width: 250px; }
  .quotation-editor-layout { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); }
  .quotation-editor-grid.four-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 150px; }
  .search-topbar { grid-template-columns: 170px minmax(520px, 1fr); }
  .product-header { grid-template-columns: 250px minmax(390px, 1fr) 190px; gap: 24px; }
  .product-main-image { width: 230px; }
  .supplier-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .library-grid { grid-template-columns: repeat(3, minmax(230px, 1fr)); }
}

/* Unified quotation editor: module visibility is controlled only by the left checkbox. */
.quotation-editor-layout-single { grid-template-columns: minmax(0, 1fr); }
.quotation-editor-layout-single .quotation-editor-main { max-width: none; }
.section-heading-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.quotation-module-toggle, .quotation-plan-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; padding-top: 3px; color: var(--orange); font-size: 12px; font-weight: 700; cursor: pointer; }
.quotation-module-toggle input, .quotation-plan-toggle input { width: 16px; height: 16px; accent-color: var(--orange); }
.quotation-editor-module.is-not-exported { border-style: dashed; background: #fffdf9; }
.quotation-editor-module.is-not-exported::after { content: "未勾选，不进入预览和导出"; display: block; margin-top: 14px; color: var(--muted); font-size: 12px; }
.quotation-editor-grid.five-column { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.quotation-sku-attributes { display: grid; gap: 10px; padding-top: 2px; }
.quotation-sku-attributes > strong { color: #334a43; font-size: 13px; }
.quotation-bilingual-field { align-content: start; }
.quotation-bilingual-field::after { content: "上中文，下英文"; color: var(--muted); font-size: 11px; }
.quotation-attributes-summary { min-height: 42px; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 8px; color: #5f5f5f; line-height: 1.6; }
.quotation-attributes-dialog { width: min(1080px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 12px; box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.quotation-attributes-dialog::backdrop { background: rgba(25, 34, 30, .38); }
.quotation-dialog-head, .quotation-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; }
.quotation-dialog-head { border-bottom: 1px solid var(--line); }
.quotation-dialog-head h2 { margin: 0; color: #29423c; font-size: 20px; }
.quotation-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.quotation-attributes-table-wrap { overflow-x: auto; padding: 16px 20px 4px; }
.quotation-attributes-table-wrap table { width: 100%; border-collapse: collapse; }
.quotation-attributes-table-wrap th, .quotation-attributes-table-wrap td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.quotation-attributes-table-wrap th { color: #29423c; background: #f5faf7; font-size: 12px; }
.quotation-attributes-table-wrap input { width: 100%; min-width: 150px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; }
.quotation-attribute-actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
.quotation-dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.quotation-logistics-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.quotation-logistics-choice-grid .quotation-muted-panel { display: grid; gap: 10px; }
.quotation-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.quotation-chip-list span { padding: 5px 9px; border: 1px solid #d5e3dc; border-radius: 99px; color: #35604f; background: #f5faf7; font-size: 12px; }
.quotation-plan-toggle { color: #35604f; font-weight: 600; }

@media (max-width: 900px) {
  .quotation-logistics-choice-grid, .quotation-editor-grid.five-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.quotation-preview-page { min-width: 0; padding: 28px 30px 44px; }
.quotation-preview-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.quotation-preview-topbar h1 { margin: 0; font-size: 30px; }
.quotation-preview-topbar p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.quotation-preview-topbar form { margin: 0; }
.quotation-preview-document { max-width: 1280px; margin: 0 auto; padding: 34px; border: 1px solid var(--line); background: #fff; box-shadow: 0 12px 30px rgba(37, 58, 50, .06); }
.quotation-preview-document-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid #00583d; }
.quotation-preview-document-head h2 { margin: 0; color: #00583d; font-size: 28px; }
.quotation-preview-document-head p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.quotation-preview-meta { display: grid; gap: 7px; color: #56645e; font-size: 13px; text-align: right; }
.quotation-preview-section { margin-top: 26px; }
.quotation-preview-section h3 { margin: 0 0 12px; color: #00583d; font-size: 18px; }
.quotation-preview-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.quotation-preview-table { width: 100%; border-collapse: collapse; }
.quotation-preview-table th, .quotation-preview-table td { min-width: 100px; padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
.quotation-preview-table th { color: #29423c; background: #eaf4f0; font-weight: 700; }
.quotation-preview-table tr:last-child td { border-bottom: 0; }
.quotation-preview-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.quotation-preview-product-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.quotation-preview-product-head > img { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; }
.quotation-preview-facts div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdfc; }
.quotation-preview-facts dt { color: var(--muted); font-size: 12px; }
.quotation-preview-facts dd { margin: 4px 0 0; word-break: break-word; }
.quotation-preview-notes { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdfc; }
.quotation-preview-notes p { margin: 0; white-space: pre-wrap; line-height: 1.6; }

@media (max-width: 1100px) {
  .search-topbar { height: auto; grid-template-columns: 1fr; gap: 14px; padding: 20px 24px; }
  .search-command { width: 100%; }
  .product-header { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .product-main-image { width: 200px; height: 220px; }
  .product-summary { grid-column: 1 / -1; }
  .product-pricing-bar { align-items: stretch; flex-direction: column; }
  .product-pricing-form { flex-wrap: wrap; }
  .quotation-editor-topbar, .quotation-preview-topbar { flex-wrap: wrap; }
  .quotation-editor-actions { flex-wrap: wrap; }
  .quotation-editor-grid.four-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-editor-grid.five-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-editor-grid.six-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 10px 14px; display: flex; align-items: center; gap: 10px; overflow-x: auto; }
  .brand { flex: none; height: 42px; padding: 0 6px; }
  .brand > span:last-child, .sidebar-user { display: none; }
  .side-nav { margin: 0; display: flex; gap: 6px; }
  .nav-item { flex: none; width: 44px; height: 42px; justify-content: center; padding: 0; }
  .nav-item span { display: none; }
  .search-workbench { display: block; }
  .query-panel, .results-panel { padding: 22px 16px 30px; }
  .query-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-grid, .product-header, .quotation-sku-row, .quotation-tiered-sku { grid-template-columns: 1fr; }
  .result-side { grid-column: 1; }
  .product-main-image { width: 100%; max-width: 320px; }
  .product-summary { grid-column: 1; }
  .quotation-editor-page, .quotation-preview-page, .list-page { padding: 20px 16px 32px; }
  .quotation-editor-grid.two-column, .quotation-logistics-choice-grid, .quotation-preview-facts { grid-template-columns: 1fr; }
  .quotation-editor-grid.six-column { grid-template-columns: 1fr; }
  .packaging-entry-fields { grid-template-columns: 1fr; }
  .packaging-entry { grid-template-columns: 1fr; }
  .packaging-entry-remove { margin-top: 0; justify-self: start; }
  .quotation-image-field { grid-template-columns: 1fr; }
  .quotation-sku-media .quotation-image-fallback, .quotation-sku-media img { width: 140px; height: 140px; }
  .quotation-preview-document { padding: 20px 16px; }
  .quotation-preview-document-head { flex-direction: column; }
  .quotation-preview-meta { text-align: left; }
  .toolbar-actions, .product-pricing-form { align-items: stretch; flex-direction: column; }
  .sku-filter-field { width: 100%; }
}

@media print {
  .quotation-preview-topbar { display: none; }
  .quotation-preview-page { min-width: 0; padding: 0; }
  .quotation-preview-document { border: 0; box-shadow: none; }
}

/* Modular quotation composer: source-backed product record, output checklist, and quote preview. */
.quotation-editor-layout-modular { grid-template-columns: 220px minmax(560px, 1fr) minmax(340px, 430px); gap: 14px; align-items: start; }
.quotation-module-rail { position: sticky; top: 18px; display: grid; gap: 12px; min-width: 0; }
.quotation-module-rail-head, .quotation-quote-meta-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.quotation-module-rail-head h2 { margin: 2px 0 6px; font-size: 20px; }
.quotation-module-rail-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.quotation-module-checklist { display: grid; gap: 6px; }
.quotation-module-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.quotation-module-check:has(input:checked) { border-color: #f5aa91; background: #fff7f3; }
.quotation-module-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--orange); }
.quotation-module-check span { display: grid; gap: 3px; min-width: 0; }
.quotation-module-check strong { color: #26332f; font-size: 12px; }
.quotation-module-check small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.quotation-module-rail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quotation-module-rail-actions .secondary-button { padding: 8px 5px; font-size: 11px; }
.quotation-quote-meta-card h3 { margin: 0 0 10px; font-size: 14px; }
.quotation-quote-meta-card dl { display: grid; gap: 8px; margin: 0; }
.quotation-quote-meta-card dl div { display: grid; gap: 2px; }
.quotation-quote-meta-card dt { color: var(--muted); font-size: 10px; }
.quotation-quote-meta-card dd { margin: 0; overflow-wrap: anywhere; color: #26332f; font-size: 11px; }
.quotation-fixed-product-card { padding: 18px; border: 1px solid #d5e5dd; border-radius: 10px; background: #f8fcfa; }
.quotation-fixed-product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.quotation-fixed-product-head h2 { margin: 0; font-size: 19px; color: #29423c; }
.quotation-fixed-product-head p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.quotation-source-badge, .quotation-preview-live-badge { flex: none; padding: 5px 9px; border-radius: 99px; color: #29674f; background: #e5f3ec; font-size: 10px; font-weight: 700; }
.quotation-fixed-product-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.quotation-fixed-product-facts div { display: grid; gap: 4px; min-width: 0; padding: 9px 10px; border-top: 1px solid #dcebe3; }
.quotation-fixed-product-facts span { color: var(--muted); font-size: 10px; }
.quotation-fixed-product-facts strong { overflow-wrap: anywhere; color: #2c3b35; font-size: 12px; font-weight: 600; }
.quotation-editor-preview-side { position: sticky; top: 18px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; }
.quotation-editor-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 4px 12px; }
.quotation-editor-preview-head h2 { margin: 0; font-size: 18px; color: #29423c; }
.quotation-editor-preview-head p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.quotation-editor-preview-document { max-height: calc(100vh - 240px); overflow: auto; padding: 16px; border: 1px solid #d8e1dc; background: #fff; box-shadow: 0 8px 18px rgba(37, 58, 50, .06); }
.quotation-editor-preview-document h3 { margin: 0; color: #f04f2e; font-size: 17px; }
.quotation-editor-preview-document h4 { margin: 16px 0 7px; padding-bottom: 5px; border-bottom: 1px solid #f2a48e; color: #29423c; font-size: 11px; }
.quotation-preview-mini-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin-top: 10px; font-size: 9px; }
.quotation-preview-mini-meta div { display: grid; gap: 2px; min-width: 0; }
.quotation-preview-mini-meta span { color: var(--muted); }
.quotation-preview-mini-meta strong { overflow-wrap: anywhere; color: #26332f; font-size: 10px; }
.quotation-preview-mini-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.quotation-preview-mini-table th, .quotation-preview-mini-table td { padding: 5px 4px; border-bottom: 1px solid #e6ece8; text-align: left; vertical-align: top; }
.quotation-preview-mini-table th { color: #29423c; background: #f2f8f5; font-weight: 700; }
.quotation-preview-mini-table td img { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
.quotation-preview-mini-note { margin-top: 10px; padding: 8px; background: #fffaf2; color: #765233; font-size: 9px; line-height: 1.45; }
.quotation-editor-preview-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 4px 2px; }
.quotation-editor-preview-actions button { padding: 8px 10px; font-size: 11px; }
.quotation-editor-module.is-not-exported { border-style: dashed; background: #fffdf9; }
.quotation-editor-module.is-not-exported::after { content: "左侧未勾选：资料保留，但不会进入预览和导出"; display: block; margin-top: 14px; color: var(--muted); font-size: 12px; }
.quotation-editor-layout-modular .quotation-editor-module { padding: 18px; }

@media (max-width: 1500px) {
  .quotation-editor-layout-modular { grid-template-columns: 200px minmax(500px, 1fr) minmax(300px, 360px); }
  .quotation-fixed-product-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .quotation-editor-layout-modular { grid-template-columns: 190px minmax(0, 1fr); }
  .quotation-editor-preview-side { position: static; grid-column: 1 / -1; }
  .quotation-editor-preview-document { max-height: none; }
}

@media (max-width: 760px) {
  .quotation-editor-layout-modular { display: block; }
  .quotation-module-rail, .quotation-editor-preview-side { position: static; margin-bottom: 14px; }
  .quotation-module-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotation-fixed-product-facts { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CATEGORY TREE & PRODUCT FAVORITES STYLES
   ========================================================================== */

.category-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cat-pill.is-active {
  background: #ff4f0a;
  border-color: #ff4f0a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(255, 79, 10, 0.25);
}

.cat-pill-fav {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.cat-pill-fav:hover {
  background: #fef3c7;
}
.cat-pill-fav.is-active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
}

/* CATEGORY TREE PANEL */
.category-tree-panel {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.tree-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tree-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tree-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 420px;
  overflow-y: auto;
}

.tree-node-item {
  display: flex;
  flex-direction: column;
}

.tree-node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  font-size: 12px;
}

.tree-node-row:hover {
  background: #f1f5f9;
}

.tree-node-row.is-active {
  background: #fff3ed;
  color: #ff4f0a;
  font-weight: 700;
}

.tree-node-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tree-caret {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.tree-caret.is-open {
  transform: rotate(90deg);
}

.tree-node-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-count-badge {
  font-size: 10px;
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}

.tree-node-row.is-active .tree-count-badge {
  background: #fed7aa;
  color: #9a3412;
}

.tree-node-actions {
  display: none;
  align-items: center;
  gap: 2px;
}

.tree-node-row:hover .tree-node-actions {
  display: flex;
}

.tree-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 2px;
  font-size: 12px;
  border-radius: 3px;
}

.tree-action-btn:hover {
  color: #ff4f0a;
  background: #e2e8f0;
}

.tree-children {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

/* FAVORITE STAR BUTTON ON PRODUCT CARDS & DETAIL */
.fav-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #cbd5e1;
  padding: 4px;
  line-height: 1;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-star-btn:hover {
  transform: scale(1.15);
  color: #fbbf24;
}

.fav-star-btn.is-favorite {
  color: #f59e0b;
}

/* CATEGORY TAGS ON PRODUCT CARDS */
.product-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.prod-cat-tag {
  font-size: 10.5px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.prod-cat-tag:hover {
  background: #dbeafe;
}

.prod-assign-btn {
  font-size: 10.5px;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}
.prod-assign-btn:hover {
  color: #ff4f0a;
  border-color: #ff4f0a;
}

