:root {
  --bg: #eef3f6;
  --panel: #ffffff;
  --ink: #122033;
  --text: #122033;
  --ink-soft: #314256;
  --muted: #637185;
  --line: #d8e2ea;
  --brand: #0b6178;
  --brand-dark: #08475c;
  --brand-ink: #07394a;
  --accent: #b46a14;
  --soft: #e9f4f7;
  --soft-strong: #d8ecf3;
  --danger: #b42318;
  --success: #166534;
  --warning: #9a4b05;
  --shadow: 0 18px 42px rgba(13, 38, 54, 0.12);
  --shadow-soft: 0 8px 22px rgba(13, 38, 54, 0.07);
  --shadow-hairline: 0 1px 2px rgba(15, 35, 52, 0.045);
  --surface: #f8fbfd;
  --surface-strong: #eef5f7;
  --surface-card: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  --surface-card-strong: linear-gradient(180deg, #ffffff 0%, #f5f9fb 100%);
  --border-soft: rgba(198, 214, 225, 0.84);
  --interactive-soft: rgba(13, 95, 118, 0.08);
  --control-height: 44px;
  --focus-ring: 0 0 0 3px rgba(13, 95, 118, 0.14);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --backend-bg: #edf3f6;
  --backend-panel: #ffffff;
  --backend-panel-muted: #f6fafc;
  --backend-line: #d4e1e8;
  --backend-accent: #b46a14;
  --backend-sidebar-bg: #f7fbfd;
  --backend-control-height: 42px;
  --backend-card-padding: 18px;
  --backend-radius: 8px;
  --backend-focus-ring: 0 0 0 3px rgba(11, 97, 120, 0.16);
  --order-document-seal-width: 62mm;
  --order-document-seal-height: 34mm;
}

.temporary-product-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  margin: 14px 0;
}

.temporary-product-panel > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  font-weight: 800;
  color: var(--ink);
}

.temporary-product-panel > summary strong {
  color: var(--brand);
  font-size: 0.92rem;
}

.temporary-product-panel[open] {
  padding: 0 18px 18px;
}

.temporary-product-panel[open] > summary {
  margin: 0 -18px 12px;
  border-bottom: 1px solid var(--line);
}

.product-selection-assistant {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  margin: 12px 0;
  overflow: hidden;
}

.product-selection-assistant > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  font-weight: 900;
  color: var(--ink);
}

.product-selection-assistant > summary strong {
  color: var(--brand);
  font-size: 0.9rem;
}

.product-selection-assistant[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f6fafc;
}

.product-selection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  padding: 14px 16px 16px;
}

.product-selection-form,
.product-selection-results {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.product-selection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-selection-tags span,
.product-selection-reasons span,
.product-selection-params small {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6f8;
  color: #0b5d73;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-selection-dropzone {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px dashed #b8ced9;
  border-radius: var(--radius);
  background: #f8fbfd;
  cursor: pointer;
}

.product-selection-dropzone input {
  display: none;
}

.product-selection-dropzone strong {
  color: var(--brand);
}

.product-selection-dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-selection-dropzone.dragover {
  border-color: var(--brand);
  background: #eef8fb;
}

.product-selection-card,
.product-selection-empty {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.product-selection-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.product-selection-card-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-selection-card-head strong,
.product-selection-empty strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.product-selection-card-head span,
.product-selection-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-selection-card-head em {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8f4f7;
  color: var(--brand);
  font-style: normal;
  font-weight: 900;
}

.product-selection-reasons,
.product-selection-params,
.product-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.product-selection-params small {
  background: #f3f6f8;
  color: #566579;
}

.temporary-product-admin {
  border-left: 4px solid var(--brand);
}

.quote-contact-editor-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.62fr) minmax(330px, 1fr) minmax(300px, 0.92fr);
  column-gap: 10px;
  row-gap: 6px;
  align-items: start;
}

.quote-contact-editor-grid.full {
  grid-column: 1 / -1;
}

.quote-contact-original-slot.full {
  grid-column: 1 / -1;
}

.quote-contact-editor-grid .quote-contact-editor-field {
  min-width: 0;
  gap: 5px;
}

.quote-contact-editor-field .customer-followup-head {
  gap: 6px;
  min-height: 32px;
  margin-bottom: 0;
}

.quote-contact-editor-field .customer-followup-head button {
  min-height: 30px;
  padding: 4px 9px;
}

.quote-contact-method-list,
.quote-contact-email-list {
  display: grid;
  gap: 5px;
}

.quote-save-customer-btn {
  justify-self: start;
  min-height: 32px;
  padding: 5px 11px;
}

.quote-contact-method-row,
.quote-contact-email-row,
.customer-contact-value.contact-validation-row {
  display: grid;
  grid-template-columns: minmax(88px, 108px) minmax(150px, 1fr) minmax(54px, auto);
  gap: 5px;
  align-items: center;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.quote-contact-email-row {
  grid-template-columns: minmax(160px, 1fr) minmax(54px, auto);
}

.quote-contact-method-row input,
.quote-contact-email-row input,
.quote-contact-method-row select {
  min-width: 0;
}

.quote-contact-method-row > button,
.customer-contact-value.contact-validation-row > button {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
}

.quote-contact-email-row > button {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.quote-contact-email-row .contact-validation-status {
  grid-column: 1 / 2;
}

.contact-validation-row select,
.contact-validation-row input {
  min-height: 34px;
}

.contact-validation-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  grid-column: 2 / 3;
  justify-self: start;
  min-height: 18px;
  min-width: 0;
  padding: 0 2px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  color: #b54708;
  background: transparent;
  border: 0;
  white-space: normal;
}

.contact-validation-status:empty {
  display: none;
}

.contact-validation-row.valid .contact-validation-status {
  display: none;
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.contact-validation-row.valid {
  background: #ecfdf5;
  border-color: #86efac;
  box-shadow: inset 4px 0 0 #16a34a;
}

.contact-validation-row.valid input,
.contact-validation-row.valid select {
  border-color: #86efac;
  background: #f7fffb;
}

.contact-validation-row.invalid {
  background: #fffdf9;
  border-color: #fed7aa;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.contact-validation-row.invalid input,
.contact-validation-row.invalid select {
  border-color: #fed7aa;
}

.customer-option-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-option-admin-box {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.customer-option-admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.customer-option-admin-head h3 {
  margin: 0;
  font-size: 17px;
}

.customer-option-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: flex-start;
}

.customer-option-admin-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 9px 7px 12px;
  border: 1px solid #c7dfea;
  border-radius: 999px;
  color: var(--brand);
  background: #eef8fb;
  font-weight: 850;
}

.customer-option-admin-item.readonly {
  color: #52657a;
  background: #f5f8fb;
}

.customer-option-admin-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-option-admin-item small {
  color: #6b7b8d;
  font-size: 11px;
  font-weight: 800;
}

.customer-option-order-controls {
  display: inline-flex;
  gap: 3px;
  flex: 0 0 auto;
}

.customer-option-admin-item .customer-option-order-btn {
  min-height: 22px;
  width: 22px;
  padding: 0;
  border-radius: 999px;
  color: var(--brand);
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
  font-size: 13px;
  line-height: 1;
}

.customer-option-admin-item .customer-option-order-btn:disabled {
  color: #9aa8b6;
  cursor: not-allowed;
  opacity: 0.45;
}

.customer-option-admin-item button {
  min-height: 22px;
  width: 22px;
  padding: 0;
  border-radius: 999px;
  color: var(--brand);
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.customer-option-admin-item .customer-option-edit-btn {
  width: auto;
  min-width: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.customer-option-admin-add button.is-editing {
  border-color: rgba(196, 107, 18, 0.28);
  color: #8a4b0f;
  background: #fff7ed;
}

.customer-option-admin-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.customer-custom-tag-admin-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.customer-custom-tag-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.customer-custom-tag-admin-item.archived {
  opacity: 0.62;
  background: #f7f9fb;
}

.customer-custom-tag-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customer-custom-tag-main input {
  width: 100%;
  min-width: 0;
}

.customer-custom-tag-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #6b7b8d;
  font-size: 12px;
  font-weight: 750;
}

.customer-custom-tag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .quote-contact-editor-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .quote-contact-benefit-notice {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .quote-contact-editor-grid {
    grid-template-columns: 1fr;
  }

  .customer-option-admin-grid,
  .customer-option-admin-add {
    grid-template-columns: 1fr;
  }

  .quote-contact-method-row,
  .quote-contact-email-row,
  .customer-contact-value.contact-validation-row {
    grid-template-columns: 1fr;
  }

  .quote-contact-method-row > button,
  .quote-contact-email-row > button,
  .customer-contact-value.contact-validation-row > button,
  .contact-validation-status,
  .quote-contact-email-row .contact-validation-status {
    grid-column: 1;
    grid-row: auto;
  }

  .quote-contact-method-row > button,
  .quote-contact-email-row > button,
  .customer-contact-value.contact-validation-row > button {
    justify-self: start;
  }
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

::selection {
  color: #ffffff;
  background: rgba(13, 95, 118, 0.88);
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbfc 0%, var(--bg) 54%, #e9f0f4 100%);
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.responsive-table-shell,
.admin-table-wrap,
.quote-history-table-wrap,
.quotation-public-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 12px;
  transform: translateY(-140%);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: var(--brand-dark);
  font-weight: 900;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
.admin-link,
summary,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  color: #ffffff;
  background: linear-gradient(180deg, #0f6f8a, var(--brand));
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 6px 14px rgba(13, 95, 118, 0.12);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

button:hover {
  background: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(8, 63, 82, 0.18);
  transform: translateY(-1px);
}

button:focus-visible,
.admin-link:focus-visible,
summary:focus-visible,
.customer-quick-card:focus-visible,
.customer-tag-choice:focus-visible,
.customer-selected-tag:focus-visible,
.quote-item-main:focus-visible,
.color-swatches button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger) !important;
  background: #fff7f6 !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08) !important;
}

button:active {
  transform: translateY(0);
}

button.secondary {
  color: var(--brand);
  background: linear-gradient(180deg, #f7fbfd, var(--soft));
  border-color: #c7dfea;
  box-shadow: var(--shadow-hairline);
}

button.secondary:hover {
  background: var(--soft-strong);
  border-color: #9fc8d8;
  box-shadow: 0 6px 14px rgba(13, 95, 118, 0.09);
}

button.ghost {
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hairline);
}

button.ghost:hover {
  color: var(--brand);
  background: #f7fbfd;
  border-color: #bfd3df;
  box-shadow: var(--shadow-hairline);
}

button.danger {
  color: var(--danger);
  background: #fff0ee;
  border-color: #ffd3ce;
  box-shadow: none;
}

button.danger:hover {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.16);
}

button:disabled,
button.disabled {
  cursor: not-allowed;
  opacity: 0.56;
  filter: grayscale(0.16);
  transform: none !important;
  box-shadow: none !important;
}

button:disabled:hover,
button.disabled:hover {
  color: var(--muted);
  background: #f4f7f9;
  border-color: var(--line);
  box-shadow: none !important;
  transform: none !important;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 10px 14px;
  border: 1px solid #c7dfea;
  border-radius: var(--radius);
  color: var(--brand);
  background: #eef6fa;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.admin-link:hover {
  background: #dcecf3;
  transform: translateY(-1px);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(860px, 1.38fr);
  align-items: center;
  gap: 14px;
  padding: 12px clamp(18px, 2.4vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 7px 22px rgba(11, 40, 60, 0.055);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 3;
}

.app-header::after {
  content: "";
  position: absolute;
  left: clamp(18px, 2.4vw, 34px);
  right: clamp(18px, 2.4vw, 34px);
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), rgba(13, 95, 118, 0.18), rgba(180, 106, 20, 0.2), transparent);
  pointer-events: none;
}

.app-header h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.app-header h1 {
  font-size: clamp(16px, 1vw, 19px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-header > div {
  min-width: 0;
}

.brand-logo,
.quote-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--brand);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 8px 18px rgba(13, 95, 118, 0.15);
}

.brand-logo img,
.quote-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  display: block;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.header-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid rgba(215, 224, 232, 0.7);
  border-radius: var(--radius);
  background: rgba(248, 252, 253, 0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 1px 2px rgba(15, 35, 52, 0.035);
  min-width: 0;
}

.header-group:first-child {
  flex: 0 1 auto;
}

.header-group .field {
  margin: 0;
}

.language-tool-host {
  display: contents;
}

.language-tool {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.language-tool .field {
  margin: 0;
  min-width: 190px;
}

.language-tool .field span {
  font-size: 12px;
}

.workflow-language-slot {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 12px;
}

.workflow-language-slot:empty {
  display: none;
}

.workflow-language-slot .language-tool {
  max-width: 100%;
  padding: 8px;
  border: 1px solid #d3e3eb;
  border-radius: 14px;
  background: rgba(248, 252, 253, 0.96);
  box-shadow: var(--shadow-hairline);
}

.workflow-language-slot .language-tool::after {
  content: "API Key 由系统设置统一配置";
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.workflow-language-slot .language-tool .field {
  min-width: 190px;
}

.workflow-language-slot .ai-status-pill:not(.hidden) {
  align-self: center;
}

.quote-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.quote-heading-language-slot {
  margin: 0;
}

.quote-heading-language-slot .language-tool {
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border-radius: 10px;
  box-shadow: none;
}

.quote-heading-language-slot .language-tool .field {
  min-width: 150px;
}

.quote-heading-language-slot .language-tool .field span {
  display: none;
}

.quote-heading-language-slot .language-tool select,
.quote-heading-language-slot .language-tool button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.quote-heading-language-slot .language-tool::after {
  content: "API Key 由系统设置统一配置";
  font-size: 11px;
}

.header-group.sales-only {
  justify-content: flex-end;
  flex: 1 1 480px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(191, 211, 223, 0.82);
}

.header-group.sales-only button,
.header-group button,
.header-group .admin-link {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.header-group.sales-only button {
  white-space: nowrap;
}

#printBtn {
  border-color: #0b596f;
  background: linear-gradient(180deg, #0f708b, #0b5167);
  box-shadow: 0 8px 18px rgba(8, 79, 101, 0.18);
}

.header-more-actions {
  position: relative;
}

.header-more-actions summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #c7dfea;
  border-radius: var(--radius);
  color: var(--brand);
  background: linear-gradient(180deg, #f7fbfd, var(--soft));
  box-shadow: var(--shadow-hairline);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}

.header-more-actions summary::-webkit-details-marker {
  display: none;
}

.header-more-actions summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: 11px;
  transition: transform 0.16s ease;
}

.header-more-actions[open] summary {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.header-more-actions[open] summary::after {
  transform: rotate(180deg);
}

.header-more-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 7px;
  min-width: 190px;
  max-width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

.header-more-menu button {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
}

.ai-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 8px 12px;
  border: 1px solid #f5c26b;
  border-radius: 6px;
  color: #9a4b05;
  background: #fff8ed;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-status-pill.ok {
  border-color: #bbdfc6;
  color: #166534;
  background: #eef8f0;
}

.ai-status-pill.busy {
  border-color: #a9d4e6;
  color: var(--brand);
  background: var(--soft);
}

.ai-status-pill.warn {
  border-color: #f5c26b;
  color: #9a4b05;
  background: #fff8ed;
}

.translation-locked button:disabled,
.translation-locked select:disabled {
  cursor: wait;
  opacity: 0.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 0.88fr) minmax(560px, 1.12fr);
  gap: clamp(16px, 1.8vw, 24px);
  padding: 24px clamp(18px, 2.4vw, 34px);
  max-width: 1740px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(11, 40, 60, 0.065);
  overflow: clip;
}

.editor-panel {
  display: grid;
  gap: var(--space-5);
  padding: clamp(14px, 1.2vw, 20px);
  align-self: start;
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}

.quote-panel {
  padding: clamp(14px, 1.2vw, 20px);
  align-self: start;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafb 100%);
}

.preview-toolbar {
  position: sticky;
  top: -22px;
  z-index: 2;
  margin: -22px -22px 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.section-heading,
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading {
  min-width: 0;
  padding-bottom: 2px;
}

.section-heading > div {
  min-width: 0;
}

.section-heading .muted {
  display: block;
  max-width: 980px;
}

.editor-panel .section-heading {
  margin-bottom: 8px;
}

.editor-panel .section-heading h2 {
  font-size: 23px;
}

.editor-panel .eyebrow {
  margin-bottom: 2px;
}

.section-heading h2 {
  font-size: clamp(22px, 1.7vw, 29px);
  letter-spacing: 0.01em;
}

.section-heading h2,
.section-heading h3 {
  color: var(--ink);
  line-height: 1.16;
}

.section-heading h3 {
  font-size: 17px;
}

.section-heading.small {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(215, 224, 232, 0.78);
}

.section-heading.inline {
  align-items: center;
}

.brand-settings {
  margin-bottom: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--surface));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.brand-settings-collapse {
  display: grid;
  gap: 0;
}

.brand-settings-collapse summary {
  min-height: 52px;
  padding: 12px 16px;
}

.brand-settings-collapse summary h3 {
  margin: 0;
}

.brand-settings-collapse[open] summary {
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.brand-settings-collapse > .form-grid {
  padding: 16px;
}

.brand-settings-collapse > .form-grid + .form-grid {
  padding-top: 0;
}

.logo-actions {
  display: flex;
  align-items: end;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field > span,
.field.compact > span {
  color: var(--muted);
  font-weight: 850;
}

.field.compact {
  min-width: 132px;
  gap: 5px;
  font-size: 11px;
}

.combo-field {
  position: relative;
}

.combo-input {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.combo-input input {
  border-radius: 6px 0 0 6px;
}

.combo-toggle {
  width: 44px;
  padding: 0;
  flex: 0 0 44px;
  color: var(--brand);
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  font-weight: 900;
}

.combo-toggle:hover {
  color: #ffffff;
  background: var(--brand);
}

.combo-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.combo-menu button {
  width: 100%;
  padding: 8px 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  text-align: left;
  white-space: normal;
}

.combo-menu button:hover {
  color: var(--brand);
  background: #eaf5f8;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: var(--control-height);
  padding: 10px 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 35, 52, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input::placeholder,
textarea::placeholder {
  color: #8a94a3;
  font-weight: 650;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--brand);
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  background: #ffffff;
}

.field:focus-within > span,
.quote-contact-editor-field:focus-within .customer-followup-head,
.customer-contact-row:focus-within span {
  color: var(--brand);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9ccd8;
}

.editor-panel,
.quote-panel,
.customer-list,
.order-admin-preview,
.all-template-editors,
.database-summary,
.field-quick-results,
textarea {
  scrollbar-width: thin;
  scrollbar-color: #a9cbd9 transparent;
}

.editor-panel::-webkit-scrollbar,
.quote-panel::-webkit-scrollbar,
.customer-list::-webkit-scrollbar,
.order-admin-preview::-webkit-scrollbar,
.all-template-editors::-webkit-scrollbar,
.database-summary::-webkit-scrollbar,
.field-quick-results::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.editor-panel::-webkit-scrollbar-thumb,
.quote-panel::-webkit-scrollbar-thumb,
.customer-list::-webkit-scrollbar-thumb,
.order-admin-preview::-webkit-scrollbar-thumb,
.all-template-editors::-webkit-scrollbar-thumb,
.database-summary::-webkit-scrollbar-thumb,
.field-quick-results::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #a9cbd9;
}

.editor-panel .form-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.editor-panel .form-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.editor-panel .form-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.editor-panel .form-grid.four {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.editor-panel .field {
  gap: 6px;
  font-size: 12px;
}

.editor-panel input,
.editor-panel select {
  min-height: 38px;
  padding: 8px 11px;
}

.editor-panel textarea {
  min-height: 84px;
  padding: 9px 11px;
}

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.quick-options button {
  width: auto;
  border: 1px solid #c9d8e2;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fbfd;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.quick-options.wide button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-options button:hover {
  border-color: var(--brand);
  background: #eaf5f8;
}

.custom-payment-input {
  margin-top: 7px;
}

.drop-ready {
  border-color: var(--brand) !important;
  background: #eef8fc !important;
}

.uploading {
  position: relative;
}

.upload-progress {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: inherit;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.68);
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}

textarea {
  resize: vertical;
  max-width: 100%;
  overflow: auto;
  line-height: 1.45;
}

textarea[rows="2"] {
  min-height: 70px;
}

textarea[rows="3"] {
  min-height: 88px;
}

textarea[rows="4"] {
  min-height: 110px;
}

textarea[rows="6"] {
  min-height: 150px;
}

.product-summary {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-hairline);
}

.product-summary:focus-within,
.quote-items-panel:focus-within,
.order-panel:focus-within,
.order-bank-panel:focus-within,
.order-packing-editor:focus-within,
.customer-list-panel:focus-within,
.customer-detail-panel:focus-within {
  border-color: #b9d5e1;
  box-shadow: 0 0 0 1px rgba(13, 95, 118, 0.08), var(--shadow-hairline);
}

.quote-items-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-hairline);
}

.quote-items-list {
  display: grid;
  gap: 8px;
}

.quote-items-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quote-items-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbe5ec;
  border-radius: var(--radius);
  background: #ffffff;
}

.quote-items-summary span {
  color: var(--muted);
  font-size: 12px;
}

.quote-items-summary strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dbe5ec;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.quote-item-row.active {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}

.quote-item-main {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quote-item-main strong,
.quote-item-main span,
.quote-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.quote-item-main span,
.quote-item-main small {
  color: var(--muted);
  font-size: 12px;
}

.quote-pricing-matrix,
.pricing-section {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.quote-pricing-head,
.pricing-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quote-pricing-head h3,
.pricing-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.quote-pricing-head p,
.pricing-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pricing-context-pill,
.pricing-warning {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #c7e2eb;
  border-radius: 999px;
  background: #eef9fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pricing-warning {
  border-color: #f0cf8c;
  background: #fff8e7;
  color: #9a5b05;
}

.quote-pricing-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px dashed #b7d3df;
  border-radius: var(--radius);
  background: #f5fbfd;
}

.quote-pricing-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.quote-pricing-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-pricing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: #f8fcfd;
}

.quote-pricing-table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.quote-pricing-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
}

.quote-pricing-table th,
.quote-pricing-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #dfe9ef;
  color: var(--ink);
  text-align: left;
  vertical-align: middle;
}

.quote-pricing-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf5f8;
  color: #365064;
  font-weight: 900;
}

.quote-pricing-table tr.active td {
  background: #edf9fc;
  box-shadow: inset 3px 0 0 var(--brand);
}

.quote-pricing-model {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.quote-pricing-input {
  width: 100%;
  min-width: 78px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #cddde6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.quote-pricing-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.quote-pricing-manual-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 230px;
}

.quote-pricing-manual-actions .quote-pricing-input {
  flex: 1 1 96px;
  min-width: 96px;
}

.quote-pricing-manual-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.quote-pricing-table small {
  display: block;
  margin-top: 2px;
  color: #9a5b05;
  font-weight: 800;
}

.quote-pricing-check {
  min-height: 28px;
}

.pricing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pricing-summary-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dce8ef;
  border-radius: 8px;
  background: #ffffff;
}

.pricing-summary-card span,
.pricing-summary-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-summary-card strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-level-pricing {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}

.current-item-pricing {
  padding: 12px 14px;
  background: #fbfdff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quote-technical-documents {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #f8fbfd;
}

.quote-technical-documents-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.quote-technical-documents-head span {
  color: var(--muted);
  font-size: 12px;
}

.quote-technical-document-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quote-technical-document-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #ffffff;
}

.quote-technical-document-item strong,
.quote-technical-document-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-technical-document-item small {
  margin-top: 3px;
  color: var(--muted);
}

.product-media {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.product-media-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.quote-photo-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #bfd8e4;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(11, 40, 60, 0.08);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.quote-photo-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-links a {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.summary-item input {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.summary-item input:focus {
  outline: none;
  border-color: #8ac0d4;
  box-shadow: var(--focus-ring);
}

.profit-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.profit-analysis div {
  display: grid;
  gap: 4px;
}

.profit-analysis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profit-analysis strong {
  color: var(--brand);
  font-size: 16px;
}

.config-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.config-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-card);
  overflow: hidden;
  box-shadow: var(--shadow-hairline);
}

.config-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.config-fold summary::-webkit-details-marker {
  display: none;
}

.config-fold summary h3 {
  margin: 0;
}

.mini-add {
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.mini-add:hover {
  background: #dcecf3;
}

.check-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 8px;
  border-top: 1px solid #e4edf2;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.check-row.with-image {
  align-items: start;
}

.compact-config-row {
  grid-template-columns: auto minmax(0, 1fr) 92px 42px;
  align-items: center;
  padding: 5px 6px;
  gap: 6px;
}

.compact-config-row .option-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.included-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 64px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 11px;
  font-weight: 800;
}

.check-row input {
  width: auto;
  margin-top: 2px;
}

.check-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.check-row small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  line-height: 1.25;
  font-size: 11px;
}

.config-empty-state {
  margin: 0;
  padding: 12px;
  border: 1px dashed #b8d2df;
  border-radius: 8px;
  background: #f7fbfd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.price-tag {
  white-space: nowrap;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
}

#standardList .price-tag {
  display: none;
}

.price-input,
.editable-price input {
  width: 100px;
  max-width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  font-weight: 800;
  text-align: right;
  font-size: 13px;
}

.image-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.image-actions .ghost {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.option-image-cell {
  position: relative;
  width: 42px;
}

.option-image-cell .image-actions {
  position: absolute;
  top: -7px;
  right: -7px;
  margin: 0;
  gap: 0;
}

.option-image-cell .remove-image-mini {
  display: none;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 999px;
  color: #ffffff;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  font-size: 14px;
  line-height: 18px;
}

.option-image-cell .remove-image-mini.visible {
  display: inline-grid;
  place-items: center;
}

.image-upload {
  display: none;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.image-upload input {
  display: none;
}

.image-upload span {
  font-size: 0;
}

.image-upload span::before {
  content: "+";
  font-size: 16px;
}

.config-image {
  display: grid;
  place-items: center;
  margin: 6px 0 0;
  width: 100%;
  min-height: 120px;
  border: 1px dashed #b8c6d2;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
}

.config-image[data-image-drop] {
  cursor: pointer;
}

.config-image.compact {
  max-width: 180px;
  min-height: 86px;
}

#optionalList .config-image.compact,
#standardList .config-image.compact {
  width: 42px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  border-radius: 6px;
  font-size: 0;
}

#optionalList .config-image.compact span,
#standardList .config-image.compact span {
  font-size: 0;
}

#optionalList .config-image.compact span::before,
#standardList .config-image.compact span::before {
  content: "+";
  font-size: 18px;
}

#optionalList .config-image img,
#standardList .config-image img {
  max-height: none;
}

.config-image.media-small {
  min-height: 80px;
}

.config-image.media-large {
  min-height: 180px;
}

.config-image img {
  width: 100%;
  height: 100%;
  max-height: 160px;
  object-fit: cover;
  object-position: center;
  background: #ffffff;
}

.config-image img.fit-cover {
  object-fit: cover;
}

.config-image.empty {
  min-height: 86px;
}

.config-gallery {
  display: grid;
  gap: 14px;
  padding: 12px;
  border: 1px solid #d6e0e8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.config-image-grid,
.config-text-list {
  display: grid;
  gap: 14px;
}

.config-image-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.config-text-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.config-image-grid .config-card {
  grid-column: span 4;
}

.config-image-grid .config-card.media-small {
  grid-column: span 3;
}

.config-image-grid .config-card.media-large {
  grid-column: span 6;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #d6e0e8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
}

.media-gallery figure {
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  grid-column: span 4;
}

.media-gallery figure.media-small {
  grid-column: span 3;
  min-height: 90px;
}

.media-gallery figure.media-large {
  grid-column: span 6;
  min-height: 220px;
}

.media-gallery img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
  object-position: center;
}

.media-gallery img.fit-cover {
  object-fit: cover;
}

.quote-model-spec-list,
.quote-grouped-list {
  display: grid;
  gap: 14px;
}

.quote-spec-by-model,
.quote-grouped-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.quote-spec-by-model h4,
.quote-grouped-card h4 {
  margin: 0 0 8px;
  color: var(--brand-ink);
}

.quote-grouped-card.common {
  background: #f4faf7;
  border-color: #cde8d8;
}

.quote-grouped-card.different {
  background: #fbfcfd;
}

.quote-apply-badge {
  display: inline-flex;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 5px 9px;
  border: 1px solid #c7dfea;
  border-radius: 999px;
  color: var(--brand);
  background: #eef8fc;
  font-size: 12px;
  font-weight: 900;
}

.config-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.config-card.image-card {
  align-content: start;
}

.config-card strong,
.config-card span {
  font-size: 13px;
}

.config-card.text-only {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
}

.config-card.text-only strong {
  min-width: 0;
}

.quote-wizard {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card-strong);
}

.quote-wizard-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
}

.quote-wizard-step {
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-wizard-step.active {
  border-color: var(--blue);
  background: #e9f7fb;
  color: var(--blue-dark);
  box-shadow: 0 0 0 3px rgba(11, 101, 128, 0.12);
}

.quote-wizard-step.done {
  border-color: #8ed8bb;
  background: #effcf5;
  color: #087543;
}

.quote-wizard-actions {
  position: sticky;
  z-index: 12;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-hairline);
  backdrop-filter: blur(10px);
}

.quote-wizard-validation {
  padding: 12px 14px;
  border: 1px solid #f0aa75;
  border-radius: 8px;
  background: #fff8ef;
  color: #9a4b00;
}

.quote-wizard-validation strong {
  display: block;
  margin-bottom: 6px;
}

.quote-wizard-validation ul {
  margin: 0;
  padding-left: 18px;
}

.quote-wizard-validation li {
  margin: 4px 0;
}

.quote-wizard-inline-action {
  margin-left: 8px;
  padding: 4px 8px;
  min-height: 0;
  border-radius: 999px;
  font-size: 12px;
}

.quote-item-step-switcher {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #f7fbfd;
}

.quote-step-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.quote-step-switcher-head strong,
.quote-step-switcher-head span {
  display: block;
}

.quote-step-switcher-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.quote-step-switcher-current {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #bde2ef;
  border-radius: 999px;
  background: #eef9fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.quote-step-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 8px;
}

.quote-step-item-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.quote-step-item-card:disabled {
  cursor: default;
  opacity: 1;
}

.quote-step-item-card.active {
  border-color: var(--brand);
  background: #e9f7fb;
  box-shadow: inset 3px 0 0 var(--brand);
}

.quote-step-item-card.incomplete {
  border-color: #efc36f;
  background: #fffaf0;
}

.quote-step-item-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.quote-step-item-card small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.quote-step-item-card em {
  justify-self: end;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4f7;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.quote-step-item-card.complete em {
  background: #e7f8ee;
  color: #087543;
}

.quote-step-item-card.incomplete em {
  background: #fff0d6;
  color: #a16207;
}

.quote-step-item-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e7f2f6;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.quote-wizard-panel-hidden {
  display: none !important;
}

.wizard-field-error {
  border-color: #d64532 !important;
  box-shadow: 0 0 0 3px rgba(214, 69, 50, 0.12);
}

body.sales-mode .quote-panel {
  background: #f3f7fa;
}

body.sales-mode[data-quote-wizard-step="5"] .quote-panel,
body.sales-mode[data-quote-wizard-step="6"] .quote-panel {
  box-shadow: 0 16px 36px rgba(18, 32, 51, 0.14);
}

body.sales-mode[data-quote-wizard-step="5"] .quote-sheet,
body.sales-mode[data-quote-wizard-step="6"] .quote-sheet {
  border-color: #bccbd7;
  box-shadow: 0 18px 46px rgba(18, 32, 51, 0.16);
}

.config-number {
  color: var(--blue);
  font-weight: 800;
}

body.customer-mode .sales-only,
body.customer-mode .price-tag,
body.customer-mode .quote-price {
  display: none !important;
}

body.customer-mode .app-header,
body.customer-mode .editor-panel,
body.customer-mode .preview-toolbar,
body.customer-mode .translation-check,
body.customer-mode .export-preflight-panel,
body.customer-mode #mainAdminLink {
  display: none !important;
}

body.sales-mode .quote-remarks-field {
  display: none !important;
}

body:not(.order-mode) .order-only {
  display: none !important;
}

body.order-mode .sales-only {
  display: none !important;
}

body.order-mode [data-quote-wizard-panel] {
  display: none !important;
}

body.order-mode .spec-editor-panel,
body.order-mode .quote-customer-entry-panel,
body.order-mode .profit-analysis {
  display: none !important;
}

body.customer-mode .workspace {
  display: block;
  max-width: none;
  padding: 0;
}

body.customer-mode .quote-panel {
  position: static;
  top: auto;
  border: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

body.customer-mode .quote-sheet {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: #ffffff;
}

.customer-frontend {
  --customer-front-blue: #0b6580;
  --customer-front-ink: #122033;
  --customer-front-muted: #617086;
  background: #ffffff;
  color: var(--customer-front-ink);
  font-size: 15px;
  line-height: 1.65;
}

.customer-frontend-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  margin: -48px auto 42px;
  max-width: 1160px;
  border: 1px solid rgba(198, 214, 225, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(18, 32, 51, 0.08);
}

.customer-frontend-nav a {
  color: var(--customer-front-blue);
  font-weight: 800;
  text-decoration: none;
}

.customer-frontend-hero {
  padding: 72px 32px 54px;
  background: linear-gradient(180deg, #f6fbfd 0%, #ffffff 100%);
  border-bottom: 1px solid #d9e7ef;
}

.customer-frontend-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 36px;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
}

.customer-frontend-hero h1,
.customer-section-head h2,
.customer-product-model {
  margin: 0;
  color: var(--customer-front-ink);
  letter-spacing: 0;
}

.customer-frontend-hero h1 {
  font-size: 34px;
  line-height: 1.2;
}

.customer-frontend-actions,
.customer-public-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.button-like,
.customer-inquiry-form button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--customer-front-blue);
  border-radius: 8px;
  background: var(--customer-front-blue);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.button-like.secondary {
  background: #ffffff;
  color: var(--customer-front-blue);
}

.customer-product-main-image {
  margin: 0;
  min-height: 320px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e7ef;
  border-radius: 8px;
  background: #ffffff;
}

.customer-product-main-image img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.customer-image-placeholder {
  padding: 28px;
  color: var(--customer-front-muted);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.customer-frontend-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 54px 32px;
  border-bottom: 1px solid #edf3f7;
}

.customer-section-head {
  max-width: 780px;
  margin-bottom: 24px;
}

.customer-product-summary,
.customer-section-head p,
.customer-info-card p {
  color: var(--customer-front-muted);
}

.customer-product-grid,
.customer-card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.customer-info-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d9e7ef;
  border-radius: 8px;
  background: #ffffff;
}

.customer-info-card h3 {
  margin: 0 0 10px;
  color: var(--customer-front-blue);
  font-size: 18px;
}

.customer-info-card ul {
  margin: 0;
  padding-left: 18px;
}

.customer-info-card img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 6px;
  background: #f8fbfd;
}

.customer-video-card {
  text-decoration: none;
  color: inherit;
}

.customer-video-card span,
.customer-download-list a,
.customer-public-contact a {
  color: var(--customer-front-blue);
  font-weight: 900;
}

.customer-download-list {
  display: grid;
  gap: 10px;
}

.customer-download-list a {
  padding: 12px 14px;
  border: 1px solid #d9e7ef;
  border-radius: 8px;
  background: #f8fbfd;
  text-decoration: none;
}

.customer-inquiry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid #d9e7ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-inquiry-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--customer-front-muted);
}

.customer-inquiry-form .full,
.customer-inquiry-form button,
.customer-inquiry-status {
  grid-column: 1 / -1;
}

.customer-inquiry-form input,
.customer-inquiry-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9d8e3;
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  color: var(--customer-front-ink);
  background: #ffffff;
}

.customer-inquiry-status.saved {
  color: #07843c;
  font-weight: 900;
}

@media (max-width: 760px) {
  .quote-wizard {
    padding: 10px;
  }

  .quote-wizard-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-wizard-step {
    min-height: 38px;
    font-size: 12px;
  }

  .quote-step-switcher-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-step-item-list {
    grid-template-columns: 1fr;
  }

  .quote-step-item-card {
    width: 100%;
  }

  .quote-wizard-actions button {
    flex: 1 1 140px;
  }

  .customer-frontend-hero {
    padding: 46px 16px 36px;
  }

  .customer-frontend-nav {
    position: static;
    justify-content: flex-start;
    margin: 0 auto 26px;
    padding: 10px 12px;
    gap: 8px 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .customer-frontend-nav a {
    white-space: nowrap;
    font-size: 13px;
  }

  .customer-frontend-hero-grid,
  .customer-product-grid,
  .customer-card-row,
  .customer-inquiry-form {
    grid-template-columns: 1fr;
  }

  .customer-frontend-hero h1 {
    font-size: 26px;
  }

  .customer-product-main-image {
    min-height: 220px;
  }

  .customer-product-main-image img {
    max-height: 280px;
  }

  .customer-frontend-section {
    padding: 34px 16px;
  }

  .customer-inquiry-form button,
  .customer-inquiry-status {
    grid-column: auto;
  }
}

.customer-management-only,
.internal-customer-lookup {
  display: none !important;
}

body.sales-mode .internal-customer-lookup,
body.order-mode .internal-customer-lookup {
  display: block !important;
}

body.customer-management-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1680px;
}

body.customer-management-mode .quote-panel,
body.customer-management-mode .sales-only,
body.customer-management-mode .order-only,
body.customer-management-mode .internal-customer-lookup,
body.customer-management-mode .editor-panel > :not(.customer-management-panel) {
  display: none !important;
}

body.customer-management-mode .customer-management-panel.customer-management-only {
  display: grid !important;
}

.customer-management-panel {
  display: grid;
  gap: var(--space-3);
}

.customer-management-panel .section-heading {
  align-items: center;
  margin-bottom: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-hairline);
}

.customer-management-panel .quick-actions {
  justify-content: flex-end;
  margin: 0;
}

.customer-lookup-panel {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #cfdfe7;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f4fafc);
  box-shadow: var(--shadow-hairline);
}

.customer-lookup-panel.hidden {
  display: none !important;
}

.customer-lookup-grid {
  display: grid;
  gap: 7px;
  max-height: 188px;
  overflow-y: auto;
  padding-right: 2px;
}

.customer-quick-results {
  display: grid;
  gap: 6px;
}

.field-quick-results {
  margin-top: 5px;
  max-height: 138px;
  overflow: auto;
  padding: 1px 3px 1px 1px;
}

.field-quick-results.hidden {
  display: none !important;
}

.customer-lookup-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-lookup-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.customer-quick-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 2px;
  width: 100%;
  height: 48px;
  min-height: 0;
  padding: 6px 9px 6px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-left: 3px solid #c7dfea;
  border-radius: 7px;
  box-shadow: var(--shadow-hairline);
  text-align: left;
  overflow: hidden;
}

.customer-name-field {
  align-content: start;
  position: relative;
}

.customer-combined-field {
  padding: var(--space-3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-hairline);
}

.customer-combined-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.customer-address-inline-field {
  grid-column: 1 / 2;
}

.customer-country-inline-field {
  grid-column: 2 / 3;
}

.customer-name-field .customer-lookup-panel {
  margin-top: 6px;
}

.customer-lookup-panel .customer-quick-card {
  height: auto;
  min-height: 46px;
  align-content: start;
  padding-block: 6px;
}

.customer-quick-card:hover {
  color: var(--ink);
  background: #eef7fb;
  border-color: #8ac0d4;
  border-left-color: var(--brand);
  box-shadow: 0 7px 14px rgba(13, 95, 118, 0.08);
  transform: none;
}

.customer-quick-card span,
.customer-quick-card small {
  color: var(--muted);
  font-weight: 700;
}

.customer-quick-card strong,
.customer-quick-card span,
.customer-quick-card small {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  line-height: 1.18;
}

.customer-quick-card strong {
  font-size: 13px;
  line-height: 1.22;
}

.customer-quick-card span,
.customer-quick-card small {
  font-size: 11px;
  line-height: 1.2;
}

.customer-quick-card small:empty {
  display: none;
}

.customer-manage-status {
  min-height: 40px;
  color: var(--brand);
  background: #eef7fb;
  border-color: #c7dfea;
}

.customer-manage-status.saved {
  color: var(--success);
  background: #eef8f0;
  border-color: #bbdfc6;
}

.customer-manage-status.error {
  color: var(--danger);
  background: #fff0ee;
  border-color: #f7b4ad;
}

.customer-duplicate-panel:empty {
  display: none;
}

.customer-duplicate-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f5c26b;
  border-radius: 8px;
  background: #fff8ed;
}

.duplicate-alert-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9a4b05;
  font-weight: 800;
}

.duplicate-alert-list {
  display: grid;
  gap: 8px;
}

.duplicate-alert-item {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #f1d29b;
  border-radius: 7px;
  background: #ffffff;
}

.duplicate-alert-item.expanded {
  border-color: #e5b45f;
  box-shadow: 0 8px 18px rgba(154, 75, 5, 0.08);
}

.duplicate-alert-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.duplicate-alert-summary--masked {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
}

.duplicate-alert-summary span {
  overflow-wrap: anywhere;
}

.duplicate-alert-summary button {
  white-space: nowrap;
}

.duplicate-alert-item small,
.duplicate-similarity {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.duplicate-customer-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1d29b;
}

.duplicate-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f1d29b;
}

.duplicate-review-actions button {
  min-width: 96px;
}

.duplicate-alert-item.masked {
  background: #fffdf8;
}

.duplicate-detail-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.duplicate-detail-card-head {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.duplicate-detail-card-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.duplicate-detail-card-head strong {
  overflow-wrap: anywhere;
}

.duplicate-detail-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.duplicate-detail-card dl div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e8edf2;
}

.duplicate-detail-card dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.duplicate-detail-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-detail-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.duplicate-detail-card dd.empty {
  color: #98a4b3;
}

.customer-overview-bar {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
  box-shadow: var(--shadow-hairline);
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.customer-stats div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.customer-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 18px;
  line-height: 1;
}

.customer-filter-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.customer-filter-primary .field,
.customer-filter-primary select,
.customer-filter-primary input,
.customer-filter-tags {
  min-width: 0;
  max-width: 100%;
}

.customer-filter-primary .customer-tag-filter-field {
  grid-column: 1 / -1;
}

.customer-advanced-filters {
  margin: 0 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.customer-advanced-filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.customer-advanced-filters summary::-webkit-details-marker {
  display: none;
}

.customer-advanced-filters summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-advanced-filters .form-grid {
  padding: 0 11px 11px;
}

.customer-status-summary,
.quote-wizard-summary,
.order-status-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.customer-status-card,
.quote-wizard-summary-card,
.order-status-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.customer-status-card span,
.quote-wizard-summary-card span,
.order-status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.customer-status-card strong,
.quote-wizard-summary-card strong,
.order-status-card strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: ellipsis;
  margin-top: 5px;
  color: var(--ink);
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.2;
}

.customer-status-card small,
.quote-wizard-summary-card small,
.order-status-card small {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 9px;
  margin: 0 0 12px;
}

.customer-quick-actions button {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-height: 56px;
  white-space: normal;
  text-align: left;
}

.customer-quick-actions button small {
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.72;
}

.customer-manager-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.customer-list-panel,
.customer-detail-panel {
  min-width: 0;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
  overflow-x: hidden;
}

body.customer-management-mode .customer-list-panel,
body.customer-management-mode .customer-detail-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.customer-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-padding-top: 72px;
}

.customer-detail-summary {
  display: grid;
  grid-template-columns: minmax(160px, 0.78fr) minmax(0, 1.42fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.customer-detail-summary-title {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.customer-detail-summary-title strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.customer-detail-summary-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-detail-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.customer-detail-summary div {
  min-width: 0;
}

.customer-detail-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.customer-detail-summary dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.customer-detail-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-hairline);
}

.customer-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.customer-detail-tabs button {
  flex: 1 1 92px;
  min-height: 36px;
  padding: 7px 10px;
  border-color: #c8dce7;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}

.customer-detail-tabs button.active,
.customer-detail-tabs button[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.customer-detail-nav .customer-quick-actions {
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 6px;
  margin: 0;
}

.customer-detail-nav .customer-quick-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 9px;
  text-align: center;
}

.customer-detail-nav .customer-quick-actions button small {
  display: none;
}

.customer-quick-action-hint {
  padding: 8px 10px;
  border: 1px solid #d4e4eb;
  border-radius: 8px;
  background: #ffffff;
  color: #526474;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.customer-detail-tab-panels {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.customer-detail-tab-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.customer-detail-tab-panel[hidden] {
  display: none;
}

.customer-tab-intro {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
}

.customer-tab-intro strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.customer-tab-intro span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.customer-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 460px);
  min-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.customer-list-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(120px, auto);
  align-items: center;
  gap: 10px;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.customer-list-toolbar .muted {
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f4f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.customer-list-toolbar .danger {
  justify-self: end;
}

.customer-select-all,
.customer-row-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.customer-select-all input,
.customer-row-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--brand);
  box-shadow: none;
  cursor: pointer;
}

.customer-card-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 8px;
}

.customer-card-row.active {
  border-color: #8ac0d4;
  background: #f0f8fb;
}

.customer-card-row.selected {
  border-color: #a9d4e6;
  background: #f6fbfd;
}

.customer-row-check {
  justify-content: center;
  min-width: 34px;
  padding: 0 0 0 4px;
}

.customer-card {
  display: grid;
  justify-content: stretch;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hairline);
  text-align: left;
}

.quote-item-main:focus-visible {
  border-radius: 6px;
}

.customer-card:hover,
.customer-card-row.active .customer-card {
  color: var(--ink);
  background: #f0f8fb;
  border-color: #8ac0d4;
  box-shadow: 0 6px 14px rgba(13, 95, 118, 0.08);
  transform: none;
}

.customer-card-row.selected .customer-card {
  border-color: #a9d4e6;
}

.customer-card strong,
.customer-card span,
.customer-card small {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.customer-card strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.customer-card span {
  color: var(--muted);
  font-weight: 700;
}

.customer-card small {
  color: #536274;
  font-weight: 700;
}

.customer-card em {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: #e8f3f7;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.customer-card .new-customer-badge {
  margin-left: 0;
  color: var(--success);
  background: #eef8f0;
}

.customer-detail-panel textarea {
  min-height: 92px;
}

.customer-source-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(260px, 1fr);
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 2px solid #d88922;
  border-radius: 8px;
  background: #fff8ed;
  box-shadow: var(--shadow-hairline);
}

.customer-source-field > span,
.customer-source-other-field > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7a3e04;
  font-size: 14px;
}

.customer-source-field strong,
.customer-source-other-field strong {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: #c46b12;
  font-size: 11px;
  line-height: 1.3;
}

.customer-tag-panel {
  display: block;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid #c8d9e3;
  border-radius: 8px;
  background: #f7fbfd;
  overflow: hidden;
}

.customer-tag-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.customer-tag-panel summary::-webkit-details-marker {
  display: none;
}

.customer-tag-panel summary::after {
  content: "展开";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f5f9;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.customer-tag-panel[open] summary::after {
  content: "折叠";
}

.customer-tag-panel summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-tag-picker {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.customer-lost-reason-field > span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.customer-tag-options,
.customer-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.customer-type-filter-legacy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.customer-filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  max-height: 118px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: auto;
}

.customer-filter-tag,
.customer-filter-tag-clear {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cbd9e2;
  border-radius: 999px;
  color: #223246;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.customer-filter-tag.selected,
.customer-filter-tag-clear.selected {
  border-color: #0d5f76;
  color: #ffffff;
  background: #0d5f76;
}

.customer-selected-tags-inline {
  justify-content: flex-start;
  max-width: 100%;
}

.customer-selected-tags-row {
  margin-top: -8px;
  margin-bottom: 2px;
  padding: 0;
}

.customer-selected-tags-row:has(.customer-selected-tag) {
  min-height: 32px;
}

.customer-tag-choice,
.customer-selected-tag {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd9e2;
  border-radius: 999px;
  color: #223246;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.customer-tag-choice-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.customer-tag-choice-wrap .customer-tag-choice {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-tag-choice small {
  margin-left: 4px;
  opacity: 0.72;
  font-size: 10px;
  font-weight: 800;
}

.customer-tag-delete {
  min-height: 24px;
  height: 24px;
  width: 24px;
  min-width: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--danger);
  background: #fff7f6;
  box-shadow: none;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.customer-tag-delete:hover,
.customer-tag-delete:focus-visible {
  border-color: #f3b3aa;
  background: #fff0ed;
}

.customer-tag-choice.selected,
.customer-selected-tag {
  border-color: #0d5f76;
  color: #ffffff;
  background: #0d5f76;
}

.customer-selected-tag.customer-tag-custom {
  border-color: #d88922;
  background: #9a4f0f;
}

.customer-selected-tag span {
  margin-left: 5px;
  opacity: 0.85;
}

.customer-selected-tags-inline .customer-selected-tag {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
  box-shadow: none;
}

.customer-custom-tag-field {
  margin-top: 2px;
}

.customer-custom-tag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.customer-lost-reason-field {
  margin: 0 14px 14px;
}

.customer-lost-reason-field strong {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: #c0392b;
  font-size: 11px;
  line-height: 1.3;
}

.customer-profile-grid {
  display: grid;
  gap: 12px;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-profile-website {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.customer-website-list {
  display: grid;
  gap: 8px;
}

.customer-website-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
}

.customer-website-row button {
  min-height: 38px;
  padding: 7px 10px;
}

.customer-contact-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-contact-list {
  display: grid;
  gap: 8px;
}

.customer-contact-row {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(330px, 1fr) minmax(300px, 0.85fr) auto;
  gap: 8px 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
}

.customer-contact-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-contact-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
}

.customer-contact-values > span {
  grid-column: 1 / -1;
}

.customer-contact-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.customer-contact-row input {
  min-height: 34px;
  padding: 6px 8px;
}

.customer-contact-values .mini-add,
.customer-contact-delete,
.customer-contact-value button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.customer-contact-value {
  display: grid;
  grid-template-columns: minmax(94px, 112px) minmax(140px, 1fr) auto;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.customer-contact-values .customer-contact-value.contact-validation-row {
  grid-column: 1 / -1;
  padding: 6px;
}

.customer-contact-values[data-contact-emails] {
  grid-column: 3;
  grid-row: 1;
}

.customer-contact-values[data-contact-emails] .customer-contact-value {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.customer-contact-values[data-contact-emails] .customer-contact-value > button {
  grid-column: 2;
  grid-row: 1;
}

.customer-contact-values[data-contact-emails] .contact-validation-status {
  grid-column: 1;
}

.customer-contact-values .mini-add {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: start;
  min-width: 76px;
}

.customer-contact-delete {
  grid-column: 4;
  grid-row: 1;
  align-self: end;
  min-width: 82px;
}

@media (max-width: 1320px) {
  .customer-contact-row {
    grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
  }

  .customer-contact-values {
    grid-column: 2;
  }

  .customer-contact-values[data-contact-emails] {
    grid-column: 2;
    grid-row: auto;
  }

  .customer-contact-delete {
    grid-column: 2;
    grid-row: auto;
    justify-self: end;
  }
}

@media (max-width: 980px) {
  .customer-contact-row {
    grid-template-columns: 1fr;
  }

  .customer-contact-values,
  .customer-contact-values[data-contact-emails],
  .customer-contact-delete {
    grid-column: 1;
  }

  .customer-contact-delete {
    justify-self: start;
  }
}

.customer-followup-panel {
  display: grid;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-followup-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.customer-followup-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5eef3;
}

.customer-followup-section-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.customer-followup-section-head strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.customer-followup-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.customer-followup-section-head button {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.customer-follow-workflow-center {
  border-color: #cfe0e8;
  background: #fbfdfe;
}

.customer-follow-workflow-list,
.workbench-follow-workflow-mini-list {
  display: grid;
  gap: 10px;
}

.follow-workflow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.45fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.workbench-follow-workflow-mini-list .follow-workflow-card {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.follow-workflow-card.follow-workflow-disabled {
  background: #f8fafc;
}

.follow-workflow-main,
.follow-workflow-result,
.follow-workflow-head {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.follow-workflow-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.follow-workflow-head span {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.follow-workflow-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 0;
}

.follow-workflow-meta div {
  min-width: 0;
}

.follow-workflow-meta dt {
  color: #6c7785;
  font-size: 11px;
  font-weight: 900;
}

.follow-workflow-meta dd {
  margin: 2px 0 0;
  color: #263445;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.follow-workflow-contact-row,
.follow-workflow-actions,
.follow-workflow-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.follow-workflow-contact-row span {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.follow-workflow-contact-row span.available {
  background: #e8f7ee;
  color: #256245;
}

.follow-workflow-actions .secondary,
.follow-workflow-status-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.follow-workflow-result textarea {
  min-height: 58px;
}

.follow-workflow-result label {
  display: grid;
  gap: 4px;
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 900;
}

.follow-workflow-result small {
  color: #8a5b14;
  font-size: 12px;
  font-weight: 800;
}

.customer-followup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.customer-followup-head button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.customer-meeting-list {
  display: grid;
  gap: 8px;
}

.customer-follow-record-list {
  display: grid;
  gap: 8px;
}

.customer-follow-entry-card {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #fbfdff;
}

.customer-follow-entry-head {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
}

.customer-follow-entry-index {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.customer-follow-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #c8dce7;
  border-radius: 999px;
  background: #f2f8fb;
  color: #0f6680;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.customer-follow-status.due {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.customer-follow-status.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.customer-follow-status.pending {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c05621;
}

.customer-follow-entry-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 0;
}

.customer-follow-entry-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.customer-follow-entry-fields input {
  min-height: 38px;
  padding: 8px 10px;
}

.customer-follow-done-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  align-self: end;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
}

.customer-follow-done-field input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}

.customer-follow-entry-actions {
  display: flex;
  justify-content: flex-end;
}

.customer-follow-entry-actions button {
  min-height: 38px;
  padding: 7px 10px;
}

.customer-follow-row.due {
  border-color: #f5c2c2;
  background: #fffafa;
  box-shadow: inset 3px 0 0 #dc2626;
}

.customer-follow-row.done {
  background: #fbfefc;
}

.customer-followup-notes {
  margin-top: 2px;
}

.customer-manual-quote-panel {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-manual-quote-list {
  display: grid;
  gap: 8px;
}

.customer-manual-quote-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(120px, 0.7fr) minmax(90px, 0.45fr) minmax(220px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
}

.customer-manual-quote-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.customer-manual-quote-row input {
  min-height: 38px;
  padding: 8px 10px;
}

.customer-manual-quote-row button {
  min-height: 38px;
  padding: 7px 10px;
}

.customer-quote-history {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-contract-history {
  background: #fbfdf8;
  border-color: #d6e5ca;
}

.customer-contract-history .customer-quote-history-head strong {
  color: #315c1f;
}

.customer-contract-history-item {
  border-color: #d6e5ca;
}

.customer-contract-history-item summary em {
  color: #315c1f;
}

.customer-commerce-panel {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #c9dbea;
  border-radius: 8px;
  background: #f7fbfd;
}

.customer-commerce-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.customer-commerce-step {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d8e5ed;
  border-radius: 8px;
  background: #ffffff;
}

.customer-commerce-step span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.customer-commerce-step strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.customer-commerce-step.done {
  border-color: #a7d8bf;
  background: #f0fdf4;
}

.customer-commerce-sync {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #bfe0ea;
  border-radius: 8px;
  background: #f3fafc;
}

.customer-commerce-sync strong,
.customer-commerce-sync span,
.customer-commerce-sync dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-commerce-sync strong {
  display: block;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.customer-commerce-sync span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-commerce-sync dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.customer-commerce-sync dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.customer-commerce-sync dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.customer-commerce-upload {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.customer-commerce-upload .field.full,
.customer-commerce-file-field,
.customer-commerce-actions {
  grid-column: 1 / -1;
}

.file-drop-zone,
.customer-commerce-drop {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px 16px;
  border: 2px dashed #a9cbd9;
  border-radius: 8px;
  color: var(--brand);
  background: #f3fafc;
  cursor: pointer;
}

.file-drop-zone input,
.customer-commerce-drop input {
  display: none;
}

.file-drop-zone strong,
.customer-commerce-drop strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.file-drop-zone small,
.customer-commerce-drop small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.file-drop-zone.drop-ready,
.customer-commerce-drop.drop-ready {
  border-color: var(--brand);
  background: #e8f3f7;
  box-shadow: inset 0 0 0 1px rgba(15, 111, 132, 0.12);
}

.customer-commerce-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-commerce-file-list {
  display: grid;
  gap: 8px;
}

.customer-commerce-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d8e5ed;
  border-radius: 8px;
  background: #ffffff;
}

.customer-commerce-file strong,
.customer-commerce-file span,
.customer-commerce-file small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-commerce-file strong {
  color: var(--brand);
}

.customer-commerce-file span,
.customer-commerce-file small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-commerce-file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.customer-quote-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-quote-history-head strong {
  color: var(--ink);
}

.customer-quote-history-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-quote-history-list {
  display: grid;
  gap: 8px;
}

.customer-quote-history-item {
  border: 1px solid #d5e2ea;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.customer-quote-history-item summary {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(180px, 1.3fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
}

.customer-quote-history-item summary::-webkit-details-marker {
  display: none;
}

.customer-quote-history-item summary strong,
.customer-quote-history-item summary b,
.customer-quote-history-item summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-quote-history-item summary strong,
.customer-quote-history-item summary b {
  color: var(--ink);
  font-weight: 900;
}

.customer-quote-history-item summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.customer-quote-history-item summary em {
  justify-self: end;
  color: var(--brand);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.customer-quote-history-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0 12px 12px;
}

.customer-quote-history-item dl div {
  padding: 8px 0;
  border-top: 1px solid #edf2f5;
}

.customer-quote-history-item dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.customer-quote-history-item dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-quote-history-item > .quote-history-detail-grid {
  grid-template-columns: 1fr;
  padding: 0 12px 12px;
}

.customer-quote-history-item .quote-history-detail-section {
  padding: 9px;
}

.customer-quote-history-item .quote-history-detail-section .quote-history-detail-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  padding: 0;
}

.customer-quote-history-item .quote-history-config-card {
  font-size: 12px;
}

.customer-detail-save-status {
  flex: 1 1 auto;
  min-width: 0;
  color: #9a4b05;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.customer-detail-save-status.saved {
  color: #166534;
}

.customer-detail-save-status.error {
  color: var(--danger);
}

.customer-photo-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.customer-photo-drop {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 104px;
  margin-bottom: 12px;
  padding: 16px;
  border: 2px dashed #a9cbd9;
  border-radius: 8px;
  color: var(--brand);
  background: #f3fafc;
  text-align: center;
  cursor: pointer;
}

.customer-photo-drop input {
  display: none;
}

.customer-photo-drop span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-photo-drop.drop-ready {
  border-color: var(--brand);
  background: #e8f3f7;
}

.customer-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.customer-media-gallery {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.customer-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.customer-photo-delete {
  min-height: 28px;
  padding: 4px 8px;
  border-color: #ffd3ce;
  border-radius: 999px;
  color: var(--danger);
  background: rgba(255, 240, 238, 0.94);
  box-shadow: none;
  font-size: 11px;
  font-weight: 900;
}

.customer-photo-delete:hover {
  color: #ffffff;
  background: var(--danger);
  box-shadow: none;
}

.customer-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3f6f8;
}

.customer-photo figcaption {
  display: grid;
  gap: 2px;
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.customer-photo figcaption strong,
.customer-photo figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}

.customer-photo-actions a,
.customer-photo-actions button {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.customer-photo.file-card {
  min-height: 160px;
}

.customer-file-preview {
  display: grid;
  min-height: 96px;
  place-items: center;
  gap: 4px;
  padding: 18px 10px;
  background: #f3fafc;
  color: var(--brand);
  text-align: center;
  text-decoration: none;
}

.customer-file-preview strong {
  font-size: 20px;
}

.customer-file-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 780px) {
  .customer-commerce-summary,
  .customer-commerce-upload,
  .customer-commerce-file {
    grid-template-columns: 1fr;
  }

  .customer-commerce-file-actions {
    justify-content: flex-start;
  }
}

.customer-import-panel {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.customer-media-workbench {
  display: grid;
  gap: 14px;
}

.customer-import-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 2px dashed #a9cbd9;
  border-radius: 8px;
  color: var(--brand);
  background: #f3fafc;
  text-align: center;
  cursor: pointer;
}

.customer-media-drop {
  min-height: 124px;
  margin: 0;
}

.customer-import-drop input {
  display: none;
}

.customer-import-drop span {
  color: var(--muted);
  font-weight: 700;
}

.customer-import-drop.drop-ready {
  border-color: var(--brand);
  background: #e8f3f7;
}

.customer-import-status {
  margin-top: 10px;
}

.customer-import-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.customer-import-result {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.customer-import-result span {
  color: var(--muted);
  font-weight: 700;
}

.customer-import-result.warn {
  border-color: #f5c26b;
  background: #fff8ed;
}

.customer-recognition-review {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9dcc9;
  border-radius: 8px;
  background: #f1fbf5;
}

.customer-recognition-review[hidden] {
  display: none;
}

.customer-recognition-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.customer-recognition-head > div:first-child {
  display: grid;
  gap: 4px;
}

.customer-recognition-head span,
.customer-recognition-row small {
  color: var(--muted);
  font-weight: 800;
}

.customer-recognition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.customer-recognition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.customer-recognition-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d4ebdc;
  border-radius: 8px;
  background: #ffffff;
}

.customer-recognition-row span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.customer-recognition-row strong {
  overflow-wrap: anywhere;
}

.customer-media-gallery-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.custom-line-box {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.order-panel {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-hairline);
}

.order-status-summary.ready .order-status-card:nth-last-child(1) strong,
.quote-wizard-summary.ready .quote-wizard-summary-card:nth-child(4) strong {
  color: var(--success);
}

.order-status-summary.blocked .order-status-card:nth-last-child(2) strong,
.order-status-summary.blocked .order-status-card:nth-last-child(1) strong {
  color: var(--warning);
}

.order-missing-checklist {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid rgba(154, 75, 5, 0.2);
  border-radius: var(--radius);
  background: #fffaf1;
}

.order-missing-checklist.complete {
  border-color: rgba(22, 101, 52, 0.2);
  background: #f4fbf6;
}

.order-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.order-checklist-head strong {
  font-size: 14px;
}

.order-checklist-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-checklist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-checklist-items button {
  display: inline-grid;
  gap: 2px;
  justify-items: start;
  min-height: 34px;
  padding: 7px 10px;
  border-color: rgba(154, 75, 5, 0.24);
  background: #ffffff;
  color: var(--warning);
  white-space: normal;
  text-align: left;
}

.order-checklist-items button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.order-workflow-sections {
  display: grid;
  gap: 14px;
}

.order-workflow-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.order-workflow-section > .section-heading {
  margin-bottom: 10px;
}

.order-source-guide {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d7e5ee;
  border-radius: 8px;
  background: #f8fbff;
}

.order-source-guide strong {
  color: #102033;
  font-size: 13px;
}

.order-source-guide span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-import-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.order-import-summary div {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
}

.order-import-summary strong {
  color: #102033;
  font-size: 13px;
}

.order-import-summary span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-import-summary b,
.order-import-summary em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef7fb;
  color: #0c5b6d;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.order-import-summary em {
  background: #fff7e8;
  color: #945a12;
}

.order-workflow-section .order-fields-grid {
  margin: 0;
}

.order-field-attention {
  outline: 3px solid rgba(180, 106, 20, 0.22);
  outline-offset: 4px;
}

.order-contact-editor-slot {
  min-width: 0;
}

body.order-mode .order-contact-editor-slot {
  order: 100;
  grid-column: 1 / -1;
  align-self: start;
}

body.order-mode .order-contact-editor-slot .quote-contact-editor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 10px;
}

body.order-mode .order-contact-editor-slot .quote-contact-editor-grid.full {
  grid-column: auto;
}

body.order-mode .order-contact-editor-slot .quote-save-customer-btn {
  margin-top: 3px;
}

@media (max-width: 780px) {
  body.order-mode .order-contact-editor-slot .quote-contact-editor-grid,
  body.order-mode .order-contact-editor-slot .quote-contact-editor-grid.full {
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
  }
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 9px;
  margin: 10px 0 6px;
}

.quick-actions,
.header-actions {
  min-width: 0;
}

.quick-actions button,
.quick-actions .admin-link {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.quick-actions .danger {
  margin-left: auto;
}

.order-actions {
  align-items: center;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-hairline);
}

.order-action-bar {
  position: sticky;
  z-index: 12;
  bottom: 10px;
  backdrop-filter: blur(10px);
}

.order-actions #orderExportAllBtn {
  margin-left: auto;
  border-color: #0b596f;
  background: linear-gradient(180deg, #0f708b, #0b5167);
  box-shadow: 0 8px 18px rgba(8, 79, 101, 0.16);
}

.order-head {
  align-items: flex-start;
}

.order-document-head {
  row-gap: 4px;
  margin-bottom: 10px;
}

.order-parties {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  line-height: 1.55;
}

.order-document-parties {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  max-width: 580px;
  margin-top: 14px;
}

.order-address-card {
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-address-card {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
}

.order-address-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.order-address-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.order-address-card p {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.order-address-card .order-address-inline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.order-address-card .order-address-inline span {
  flex: 0 0 auto;
}

.order-table td,
.order-table th {
  vertical-align: top;
}

.order-option-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.order-option-list li {
  margin: 2px 0;
  line-height: 1.35;
}

.order-route-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid #cfd7df;
  border-bottom: 0;
  background: #fbfdff;
}

.order-route-strip div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-height: 36px;
  padding: 7px 12px;
}

.order-route-strip .order-route-to {
  justify-content: flex-end;
}

.order-route-strip div + div {
  border-left: 1px solid #cfd7df;
}

.order-route-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.order-route-strip strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.order-fill-field {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.order-fill-field.missing {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.quote-sheet.order-draft-fields .order-fill-field {
  color: #b91c1c;
  text-decoration-line: underline;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  background: rgba(254, 226, 226, 0.28);
  border-radius: 3px;
}

.quote-sheet.order-draft-fields .order-fill-field.missing {
  background: rgba(254, 226, 226, 0.45);
}

.order-bank-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.order-packing-editor {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.order-packing-editor .section-heading.inline {
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.order-packing-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.order-packing-item {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d8e4ec;
  border-radius: 8px;
  background: #fbfdff;
}

.order-packing-item:focus-within,
.customer-contact-row:focus-within,
.customer-meeting-row:focus-within,
.customer-follow-row:focus-within,
.customer-manual-quote-row:focus-within,
.quote-item-row:focus-within,
.check-row:focus-within {
  border-color: #b9d5e1;
  box-shadow: inset 3px 0 0 var(--brand), var(--shadow-hairline);
}

.order-packing-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-packing-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.order-packing-item-grid .field.full {
  grid-column: 1 / -1;
}

.order-packing-item textarea {
  min-height: 72px;
  resize: vertical;
}

.order-bank-account-field {
  gap: 10px;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.inline-checkbox input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--brand);
  box-shadow: none;
}

.order-bank-section {
  margin-top: 18px;
}

.order-bank-details {
  display: grid;
  gap: 6px;
}

.order-bank-line {
  margin: 0 0 6px;
  line-height: 1.45;
}

.order-bank-details .order-bank-line {
  margin: 0;
}

.order-admin-shell {
  max-width: 1760px;
}

.order-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-admin-tabs button {
  border: 1px solid #c8d8e2;
  background: #f5fafc;
  color: var(--brand);
}

.order-admin-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.order-stats-card {
  display: grid;
  gap: 14px;
}

.analysis-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px;
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  background: #f7fbfd;
}

.analysis-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #cfe0e9;
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.analysis-subnav a:hover,
.analysis-subnav a:focus,
.analysis-subnav a.active {
  border-color: var(--brand);
  background: #eef8fb;
}

.analysis-section-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  scroll-margin-top: 96px;
  padding: 12px;
  border: 1px solid #d8e6ee;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.analysis-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f6;
}

.analysis-section-heading h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.analysis-section-heading .muted {
  margin: 0;
  font-size: 12px;
}

.order-production-section {
  scroll-margin-top: 96px;
}

.order-production-filter {
  display: grid;
  gap: 4px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-production-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.order-production-summary-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  background: #ffffff;
}

.order-production-summary-card span,
.order-production-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-production-summary-card strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1.1;
}

.order-production-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.order-production-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e6ee;
  border-radius: 10px;
  background: #ffffff;
}

.order-production-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.order-production-main strong,
.order-production-main span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-production-main strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.order-production-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-production-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.order-production-meta div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #edf2f6;
  border-radius: 8px;
  background: #f8fbfd;
}

.order-production-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.order-production-meta dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.order-production-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.order-production-actions label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-production-actions select,
.order-production-actions button {
  width: 100%;
}

.order-production-actions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.order-production-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px dashed #b8d2df;
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--muted);
}

.order-production-empty strong {
  color: var(--ink);
}

@media (max-width: 1024px) {
  .order-production-card {
    grid-template-columns: 1fr;
  }

  .order-production-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .order-production-actions small {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .order-production-filter {
    width: 100%;
    min-width: 0;
  }

  .order-production-meta,
  .customer-commerce-sync dl {
    grid-template-columns: 1fr;
  }

  .order-production-actions {
    grid-template-columns: 1fr;
  }
}

.order-stats-filters {
  align-items: end;
  margin-bottom: 0;
}

.order-stats-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.order-stats-kpi {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #f8fbfd;
}

.order-stats-kpi span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-stats-kpi strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  word-break: break-word;
}

.order-stats-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-stats-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.order-stats-trend-card {
  grid-column: 1 / -1;
}

.order-stats-rankings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.order-stats-analysis-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-stats-analysis-card > span,
.order-stats-analysis-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-stats-analysis-card > strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.order-stats-analysis-card > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.order-stats-analysis-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.order-stats-analysis-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.order-stats-trend ol,
.order-stats-source-mix ol,
.order-stats-rankings ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-stats-trend li,
.order-stats-source-mix li,
.order-stats-rankings li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f6;
}

.order-stats-trend li:last-child,
.order-stats-source-mix li:last-child,
.order-stats-rankings li:last-child {
  border-bottom: 0;
}

.order-stats-trend li span,
.order-stats-source-mix li span,
.order-stats-rankings li span {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.order-stats-trend li strong,
.order-stats-source-mix li strong,
.order-stats-rankings li strong {
  color: var(--brand);
  font-size: 12px;
}

.order-stats-trend li em,
.order-stats-source-mix li em,
.order-stats-rankings li em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.order-manual-collapse {
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-manual-form {
  padding: 14px;
  margin-bottom: 0;
}

.order-manual-actions {
  align-items: start;
}

.order-stats-batch-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-stats-batch-toolbar .history-select-all {
  margin: 0;
}

.order-stats-batch-toolbar .muted {
  margin-left: auto;
}

.order-stats-table-wrap {
  margin-top: 0;
}

.order-stats-table td:last-child,
.order-stats-table th:last-child {
  width: 78px;
  text-align: center;
}

.order-admin-split {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.order-admin-workbench {
  padding: 18px;
}

.order-admin-workspace {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) minmax(380px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.order-admin-workspace.template-edit-expanded {
  grid-template-columns: 1fr;
}

.order-admin-preview-panel,
.order-admin-edit-panel {
  min-width: 0;
}

.order-admin-workspace.template-edit-expanded .order-admin-edit-panel {
  grid-column: 1;
  grid-row: 1;
}

.order-admin-workspace.template-edit-expanded .order-admin-preview-panel {
  display: none;
}

.order-admin-edit-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.order-admin-workspace.template-edit-expanded .order-admin-edit-panel {
  position: static;
}

.order-template-import-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-template-import-drop {
  cursor: pointer;
}

.order-template-import-drop.drop-ready {
  border-color: var(--brand);
  background: #eef8fc;
}

.order-template-import-preview {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.order-template-import-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #ffffff;
}

.order-template-import-card.needs-review {
  border-color: #f1c27d;
  background: #fff8ed;
}

.template-import-card-head,
.template-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.template-import-preview-sheet {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
  background: #fbfdff;
}

.template-import-preview-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.template-import-preview-sheet td,
.template-import-preview-sheet th {
  padding: 6px;
  border: 1px solid #d6e0e8;
}

.import-warning {
  margin: 0;
  color: #b45309;
  font-weight: 800;
}

.edit-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #eef5f8;
}

.edit-mode-tabs button {
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.template-visual-edit-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #eef5f8;
}

.template-placeholder-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.template-placeholder-bar button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.order-admin-edit-pane {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.edit-pane-head {
  display: grid;
  gap: 10px;
}

.edit-pane-head h3 {
  margin: 0 0 4px;
  color: var(--ink);
}

.order-admin-editor {
  min-height: min(760px, calc(100vh - 330px));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.order-admin-workspace.template-edit-expanded .order-admin-editor {
  min-height: min(920px, calc(100vh - 260px));
}

.order-template-visual-editor {
  min-height: min(640px, calc(100vh - 390px));
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.55;
  outline: none;
}

.order-admin-workspace.template-edit-expanded .order-template-visual-editor {
  min-height: min(820px, calc(100vh - 300px));
  max-height: calc(100vh - 230px);
}

.order-template-visual-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 95, 120, 0.12);
}

.order-template-visual-editor table {
  width: 100%;
  border-collapse: collapse;
}

.order-template-visual-editor td,
.order-template-visual-editor th {
  min-width: 72px;
  padding: 7px;
  border: 1px solid #d6e0e8;
  vertical-align: top;
}

.preview-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.order-admin-preview {
  min-height: 760px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-admin-workspace.template-edit-expanded .order-admin-preview {
  min-height: 560px;
  max-height: calc(100vh - 250px);
  padding: 20px;
}

.all-template-editors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 4px;
}

.order-admin-workspace.template-edit-expanded .all-template-editors {
  max-height: calc(100vh - 250px);
}

.order-template-preview-button {
  width: 100%;
  min-height: 44px;
  border-color: rgba(13, 94, 119, 0.35);
  background: linear-gradient(180deg, #0f708b, #0b5167);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(9, 76, 98, 0.16);
}

.order-template-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 22px;
}

.order-template-preview-dialog.hidden {
  display: none;
}

.order-template-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 32, 48, 0.58);
  backdrop-filter: blur(4px);
}

.order-template-preview-modal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: hidden;
  border: 1px solid rgba(207, 223, 232, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(8, 33, 49, 0.32);
}

.order-template-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #d7e5ee;
  background: #f7fbfd;
}

.order-template-preview-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.order-template-preview-scroll {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  background: #eef5f8;
}

.order-template-preview-sheet {
  width: min(980px, 100%);
  min-height: 70vh;
  margin: 0 auto;
  overflow: auto;
  background: #ffffff;
}

.all-template-editors textarea {
  min-height: 210px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quote-section h4 {
  margin: 18px 0 8px;
  color: var(--brand);
}

.quote-attachment-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cfd7df;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.quote-attachment-list a {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.quote-attachment-list span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-clauses {
  margin-top: 18px;
  line-height: 1.55;
}

.contract-clauses h3,
.contract-clauses h4 {
  page-break-after: avoid;
}

.contract-clauses p {
  margin: 7px 0;
}

.contract-clauses ul {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.bilingual-clause {
  padding-top: 8px;
  margin-top: 12px;
  border-top: 1px solid #e1e9ef;
}

.order-signature-section {
  display: grid;
  gap: 18px;
  margin-top: 34px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.order-signature-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 22px;
  align-items: end;
  min-height: 132px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-party-title {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-party-name {
  grid-column: 1;
  max-width: 100%;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-seal-box {
  grid-column: 1;
  display: grid;
  place-items: center;
  min-height: 110px;
}

.order-signature-row.seller {
  min-height: 190px;
}

.order-signature-row.seller .order-party-name {
  position: relative;
  z-index: 1;
  max-width: min(980px, 100%);
  padding-right: 0;
}

.order-signature-row.seller .order-seal-box {
  position: absolute;
  z-index: 2;
  top: -44px;
  left: min(520px, 48%);
  width: min(440px, 72%);
  min-height: 230px;
  transform: translateX(-50%);
  pointer-events: none;
}

.order-signature-row.seller .order-seal {
  max-width: 440px;
  max-height: 230px;
}

.order-signature-row.buyer .order-seal-box.empty {
  display: none;
}

.order-seal-box.empty {
  border: 0;
}

.order-seal {
  display: block;
  max-width: 250px;
  max-height: 150px;
  object-fit: contain;
}

.order-seal.compact {
  max-width: 150px;
  max-height: 92px;
}

.order-no-seal {
  display: none;
}

.order-sign-line {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid #c9d6df;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-document-stamp {
  display: grid;
  justify-items: center;
  align-self: flex-end;
  gap: 6px;
  width: fit-content;
  min-width: min(var(--order-document-seal-width), 100%);
  min-height: calc(var(--order-document-seal-height) + 4mm);
  max-width: min(var(--order-document-seal-width), 62%);
  margin: 18px 0 34px auto;
  padding: 0 0 2mm;
  border: 0;
  background: transparent;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
  transform: none;
}

.order-document-stamp .order-seal-box {
  min-height: var(--order-document-seal-height);
  overflow: visible;
}

.order-document-stamp .order-seal.document {
  max-width: var(--order-document-seal-width);
  max-height: var(--order-document-seal-height);
  object-fit: contain;
}

.custom-item {
  display: grid;
  grid-template-columns: 1.4fr 110px 96px 42px;
  gap: 10px;
  margin-top: 10px;
}

.quote-sheet {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  min-height: 820px;
  padding: 34px 38px;
  color: #182333;
  border-radius: 6px;
  box-shadow:
    inset 0 5px 0 var(--brand),
    0 12px 30px rgba(11, 40, 60, 0.08);
}

.quote-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 28px;
  padding: 4px 0 22px;
  border-bottom: 2px solid #d6e0e8;
  break-inside: avoid;
}

.quote-address-head {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.quote-brand {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) minmax(120px, 170px);
  align-items: start;
  column-gap: 16px;
  grid-column: 1 / -1;
  text-align: center;
  min-width: 0;
  min-height: 76px;
  padding: 0 0 14px;
  border-bottom: 2px solid #d6e0e8;
}

.quote-logo {
  grid-column: 1;
  justify-self: start;
  align-self: start;
  width: var(--quote-logo-width, 150px);
  height: var(--quote-logo-height, 64px);
  border-radius: 7px;
  font-size: 18px;
  flex: 0 0 auto;
  padding: 0;
  background: #ffffff;
}

.quote-brand > div:not(.quote-logo) {
  grid-column: 2;
  align-self: center;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.quote-brand.quote-brand-no-logo {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding-bottom: 14px;
}

.quote-brand.quote-brand-no-logo > div:not(.quote-logo) {
  grid-column: 1;
  text-align: center;
}

.quote-logo.logo-ultrawide {
  --quote-logo-width: 170px;
  --quote-logo-height: 54px;
}

.quote-logo.logo-wide {
  --quote-logo-width: 158px;
  --quote-logo-height: 58px;
}

.quote-logo.logo-square {
  --quote-logo-width: 74px;
  --quote-logo-height: 74px;
}

.quote-logo.logo-tall {
  --quote-logo-width: 62px;
  --quote-logo-height: 78px;
}

.company-title {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.company-title.company-title-short {
  font-size: 28px;
  letter-spacing: 0.015em;
}

.company-title.company-title-medium {
  font-size: 22px;
}

.company-address-line {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-company-details {
  grid-column: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.quote-title-block {
  grid-column: 1 / -1;
  grid-row: auto;
  display: grid;
  justify-items: stretch;
  text-align: center;
  justify-self: stretch;
  width: 100%;
}

.quote-title {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  text-align: center;
  font-size: 31px;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.quote-meta {
  display: grid;
  justify-self: end;
  justify-content: end;
  justify-items: end;
  gap: 8px;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  margin-right: 0;
  font-size: 13px;
  text-align: right;
}

.quote-meta.document-meta {
  justify-self: end;
  justify-content: end;
  justify-items: end;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  margin-right: 0;
  padding: 2px 4px;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  background: #fbfdff;
}

.order-document-head .quote-title-block {
  justify-items: stretch;
}

.order-document-head .quote-title {
  justify-self: stretch;
}

.order-document-head .quote-meta.document-meta {
  justify-self: end;
  margin-left: auto;
  margin-right: 0;
}

.quote-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: min(420px, 100%);
  max-width: min(420px, 100%);
  padding-bottom: 5px;
  border-bottom: 1px solid #e8eef3;
}

.quote-meta.document-meta div {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: end;
  column-gap: 16px;
  width: max-content;
  max-width: min(460px, 100%);
  padding: 4px 6px;
  border-bottom: 1px solid #e3ebf1;
}

.quote-meta.document-meta div:last-child {
  border-bottom: 0;
}

.quote-meta.document-meta strong {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quote-meta.document-meta span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.buyer-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #cfdce5;
  border-radius: 6px;
  background: #f8fbfd;
}

.buyer-strip a {
  color: var(--brand);
  text-decoration: none;
}

.buyer-strip a:hover {
  text-decoration: underline;
}

.buyer-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.buyer-strip strong {
  display: block;
  font-size: 14px;
}

.quote-product-hero {
  margin-top: 18px;
}

.quote-product-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid #d6e0e8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.quote-product-hero-grid-single {
  grid-template-columns: minmax(280px, 620px);
  justify-content: center;
}

.quote-product-hero-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 8px;
  margin: 0;
  min-height: 230px;
  padding: 12px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
}

.quote-product-hero-card img {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
  object-position: center;
  align-self: stretch;
}

.quote-product-hero-card figcaption {
  min-height: 34px;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  align-self: end;
}

.shared-data-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 14px;
  border: 1px solid #c7dbe5;
  border-radius: 999px;
  background: #f2fbfd;
  color: #0b5d73;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(12, 44, 60, 0.14);
}

.shared-data-status.danger {
  border-color: #ffc6bc;
  background: #fff1ee;
  color: #b63221;
}

.shared-sync-button {
  position: fixed;
  right: 18px;
  bottom: 62px;
  z-index: 90;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
}

.shared-account-badge {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 92;
  display: block;
  max-width: min(420px, calc(100vw - 28px));
  color: #0b5d73;
  font-size: 12px;
}

.shared-account-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-account-badge button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11px;
}

.shared-account-trigger {
  min-width: 64px;
  max-width: min(160px, calc(100vw - 28px));
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid #c7dbe5;
  border-radius: 999px !important;
  background: rgba(242, 251, 253, 0.98);
  color: #0b5d73;
  box-shadow: 0 10px 24px rgba(12, 44, 60, 0.14);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-account-trigger[aria-expanded="true"] {
  border-color: #89b8c9;
  background: #ffffff;
}

.shared-account-details {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid #c7dbe5;
  border-radius: 8px;
  background: rgba(242, 251, 253, 0.98);
  box-shadow: 0 16px 38px rgba(12, 44, 60, 0.16);
}

.shared-account-details[hidden] {
  display: none;
}

.shared-account-menu {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.shared-account-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shared-account-main strong,
.shared-account-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-account-main strong {
  color: var(--ink);
  font-size: 13px;
}

.shared-account-main span,
.shared-account-meta span {
  color: var(--muted);
  font-weight: 800;
}

.shared-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.shared-account-meta span {
  padding: 3px 7px;
  border: 1px solid rgba(198, 214, 225, 0.9);
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
}

.shared-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.impersonation-banner,
.must-change-password {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
}

.impersonation-banner {
  border: 1px solid #f2bf73;
  background: #fff7ea;
  color: #733d04;
}

.must-change-password {
  border: 1px solid #f2d28a;
  background: #fffbeb;
  color: #7c4a03;
}

.impersonation-banner strong,
.must-change-password strong {
  color: inherit;
  font-size: 12px;
}

.impersonation-banner span,
.must-change-password span {
  grid-column: 1 / 2;
  color: inherit;
  opacity: 0.86;
  font-weight: 700;
}

.impersonation-banner button,
.must-change-password button {
  grid-row: 1 / span 2;
  grid-column: 2 / 3;
  background: #ffffff;
  color: inherit;
  border-color: rgba(125, 76, 10, 0.25);
}

@media (max-width: 760px) {
  .shared-account-badge {
    right: 10px;
    max-width: calc(100vw - 20px);
  }

  .shared-account-details {
    width: calc(100vw - 20px);
  }

  .shared-account-menu,
  .impersonation-banner,
  .must-change-password {
    grid-template-columns: 1fr;
  }

  .shared-account-actions {
    justify-content: flex-start;
  }

  .impersonation-banner span,
  .must-change-password span,
  .impersonation-banner button,
  .must-change-password button {
    grid-column: auto;
    grid-row: auto;
  }
}

.app-header .shared-account-badge.shared-account-badge-inline {
  position: static;
  z-index: auto;
  flex: 0 1 auto;
  max-width: 100%;
  margin-left: auto;
  align-self: center;
  box-shadow: var(--shadow-hairline);
}

.app-header .shared-account-badge.shared-account-badge-inline span {
  max-width: 220px;
}

.app-header .shared-account-badge.shared-account-badge-inline button {
  min-height: 30px;
  padding: 4px 10px;
}

.role-workbench-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 20;
}

.role-menu-group {
  position: relative;
}

.role-menu-group summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 900;
  font-size: 14px;
}

.role-menu-group summary::-webkit-details-marker {
  display: none;
}

.role-menu-group[open] summary {
  background: var(--primary);
  color: #fff;
}

.role-menu-group > div {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.role-menu-group a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.role-menu-group a:hover {
  background: var(--soft);
  color: var(--primary);
}

.role-workbench-menu.backend-workbench-shell {
  display: block;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 252, 253, 0.97);
  box-shadow: 0 10px 26px rgba(13, 43, 60, 0.06);
}

.backend-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  max-width: 1800px;
  margin: 0 auto 12px;
}

.backend-nav-head h2 {
  margin: 2px 0 4px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.12;
}

.backend-breadcrumb {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.backend-quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(560px, 100%);
}

.backend-quick-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #bfdfeb;
  border-radius: 999px;
  background: #eefaff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.backend-quick-actions a.secondary {
  background: #fff;
  color: var(--muted);
}

.backend-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 1800px;
  margin: 0 auto;
}

.backend-menu-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.backend-menu-section[open] {
  border-color: #bfdfeb;
  background: #fbfeff;
}

.backend-menu-section summary {
  list-style: none;
  cursor: pointer;
}

.backend-menu-section summary::-webkit-details-marker {
  display: none;
}

.backend-menu-section-head {
  position: relative;
  margin-bottom: 0;
  padding-right: 54px;
}

.backend-menu-section-head::after {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 42px;
  padding: 3px 7px;
  border: 1px solid #bfdfeb;
  border-radius: 999px;
  background: #eefaff;
  color: var(--primary);
  content: "展开";
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.backend-menu-section[open] .backend-menu-section-head {
  margin-bottom: 10px;
}

.backend-menu-section[open] .backend-menu-section-head::after {
  background: var(--primary);
  color: #fff;
  content: "收起";
}

.backend-menu-section h3 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.2;
}

.backend-menu-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.backend-menu-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.backend-menu-section:not([open]) .backend-menu-links {
  display: none;
}

.backend-menu-link {
  display: flex;
  min-width: 0;
  min-height: 42px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid #d7e5ec;
  border-radius: 10px;
  background: #f9fcfd;
  color: var(--ink);
  text-decoration: none;
}

.backend-menu-link small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.backend-menu-link span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backend-menu-link:hover,
.backend-menu-link.active {
  border-color: var(--primary);
  background: #eaf8fc;
  color: var(--primary);
}

.backend-menu-link.active {
  box-shadow: inset 4px 0 0 var(--primary);
}

@media (max-width: 1180px) {
  .backend-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .backend-nav-head {
    display: grid;
  }

  .backend-quick-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .backend-menu-grid,
  .backend-menu-links {
    grid-template-columns: 1fr;
  }
}

body.backend-shell-active:not(.public-site) {
  --backend-sidebar-width: 286px;
  padding-left: var(--backend-sidebar-width);
}

body.backend-shell-pending:not(.public-site) .app-header,
body.backend-shell-pending:not(.public-site) .admin-mode-banner,
body.backend-shell-pending:not(.public-site) .admin-topbar {
  display: none;
}

body.backend-shell-active:not(.public-site) #modeSelect {
  display: none;
}

body.backend-shell-active:not(.public-site) label.field:has(#modeSelect) {
  display: none;
}

body.backend-shell-active:not(.public-site) .app-header {
  display: none;
}

body.backend-shell-active:not(.public-site) .app-header::after,
body.backend-shell-active:not(.public-site) .brand-header,
body.backend-shell-active:not(.public-site) .header-group.sales-only,
body.backend-shell-active:not(.public-site) .header-group:last-child {
  display: none;
}

body.backend-shell-active:not(.public-site) .header-actions {
  justify-content: flex-end;
  gap: 8px;
}

body.backend-shell-active:not(.public-site) .header-group {
  min-height: 0;
  padding: 6px 8px;
  border-radius: 12px;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .header-group button,
body.backend-shell-active:not(.public-site) .header-group select,
body.backend-shell-active:not(.public-site) .header-more-actions summary {
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.role-workbench-menu.backend-workbench-shell {
  position: static;
  z-index: 80;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.backend-sidebar {
  position: fixed;
  z-index: 90;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--backend-sidebar-width);
  overflow-y: auto;
  padding: 18px 14px;
  border-right: 1px solid #d8e6ed;
  background: #f7fbfd;
  box-shadow: 14px 0 30px rgba(17, 48, 65, 0.06);
}

.backend-sidebar-brand {
  display: grid;
  gap: 4px;
  padding: 10px 10px 16px;
  border-bottom: 1px solid #dbe8ef;
}

.backend-sidebar-brand strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.backend-sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.backend-topbar {
  position: sticky;
  z-index: 70;
  top: 0;
  margin: 0 0 18px;
  padding: 14px clamp(16px, 2vw, 28px);
  border-bottom: 1px solid #d8e6ed;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(17, 48, 65, 0.05);
}

.backend-topbar .backend-nav-head {
  max-width: none;
  margin: 0 0 10px;
}

.backend-menu-toggle {
  display: none;
}

.backend-sidebar .backend-menu-grid {
  display: block;
  max-width: none;
  margin: 14px 0 0;
}

.backend-sidebar .backend-menu-section {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}

.backend-sidebar .backend-menu-section-head {
  padding-right: 48px;
}

.backend-sidebar .backend-menu-links {
  grid-template-columns: 1fr;
}

.backend-sidebar .backend-menu-link {
  min-height: 38px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
}

.backend-sidebar .backend-menu-link small {
  text-transform: none;
}

.backend-sidebar .backend-menu-link:hover,
.backend-sidebar .backend-menu-link.active {
  border-color: #bfdfeb;
  background: #eaf8fc;
}

.backend-sidebar .backend-menu-link.active {
  box-shadow: inset 4px 0 0 var(--primary);
}

.backend-global-search {
  position: relative;
  max-width: 860px;
}

.backend-global-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #cfdde6;
  border-radius: 12px;
  background: #f9fcfd;
  color: var(--ink);
  font-weight: 800;
}

.backend-global-search input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(13, 109, 129, 0.12);
}

.backend-search-results {
  position: absolute;
  z-index: 95;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-width: min(520px, calc(100vw - 32px));
  max-height: 520px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #cfe0e8;
  border-radius: 14px;
  background: #fff;
  overflow-wrap: anywhere;
  box-shadow: 0 20px 45px rgba(16, 44, 61, 0.16);
}

.backend-search-results section + section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e1ecf1;
}

.backend-search-results h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.backend-search-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border: 1px solid var(--backend-line);
  border-radius: 999px;
  background: var(--backend-panel-muted);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.backend-search-type-customer {
  border-color: #bfe3d0;
  background: #eef8f1;
  color: #1f7a3a;
}

.backend-search-type-quote {
  border-color: #b9deea;
  background: #eef9fc;
  color: var(--brand);
}

.backend-search-type-product,
.backend-search-type-document {
  border-color: #d7dcea;
  background: #f4f6fb;
  color: #415170;
}

.backend-search-section-order .backend-search-type,
.backend-search-type-order {
  border-color: #f2d4a9;
  background: #fff8ed;
  color: #9a4b05;
}

.backend-search-section-menu .backend-search-type,
.backend-search-type-menu {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.backend-search-results a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.backend-search-results a:hover {
  background: #eefaff;
}

.backend-search-results strong {
  grid-column: 2;
  font-size: 14px;
}

.backend-search-results a > span:not(.backend-search-result-label),
.backend-search-empty {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backend-search-result-label {
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 1px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf3f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.backend-anchor {
  display: block;
  height: 0;
  overflow: hidden;
  scroll-margin-top: var(--backend-scroll-offset, 136px);
}

.backend-scroll-target {
  scroll-margin-top: var(--backend-scroll-offset, 136px);
}

.backend-target-focus {
  outline: 3px solid rgba(13, 109, 129, 0.2);
  outline-offset: 6px;
}

.backend-module-hidden {
  display: none !important;
}

.backend-module-active {
  scroll-margin-top: var(--backend-scroll-offset, 136px);
}

body.order-admin-page.backend-shell-active[data-backend-active-module="orderStatsCard"] .admin-mode-banner,
body.order-admin-page.backend-shell-active[data-backend-active-module="orderStatsCard"] .admin-topbar {
  display: none;
}

/* Backend UX system */
body.backend-shell-active:not(.public-site) {
  background: var(--backend-bg);
  color: var(--ink);
}

body.backend-shell-active .admin-shell,
body.backend-shell-active .workspace {
  gap: 18px;
}

.backend-sidebar {
  background: var(--backend-sidebar-bg);
  border-right: 1px solid var(--backend-line);
  box-shadow: 16px 0 34px rgba(15, 42, 58, 0.07);
}

.backend-sidebar-brand {
  border-bottom: 1px solid var(--backend-line);
}

.backend-topbar {
  border: 1px solid rgba(212, 225, 232, 0.86);
  border-top: 0;
  border-radius: 0 0 var(--backend-radius) var(--backend-radius);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px rgba(15, 42, 58, 0.08);
}

.backend-sidebar .backend-menu-section {
  border: 1px solid rgba(212, 225, 232, 0.78);
  border-radius: var(--backend-radius);
  background: var(--backend-panel);
  box-shadow: var(--shadow-hairline);
}

body.backend-shell-active:not(.public-site) .admin-mode-banner,
body.backend-shell-active:not(.public-site) .admin-topbar {
  display: none;
}

body.backend-shell-active .backend-topbar {
  margin-bottom: 14px;
  padding: 10px clamp(14px, 1.6vw, 22px);
}

body.backend-shell-active .backend-topbar .backend-nav-head {
  display: grid;
  grid-template-columns: minmax(190px, 0.26fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
}

.backend-context-line {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.backend-current-menu {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.backend-shell-active .backend-breadcrumb {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backend-topbar-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.backend-shell-active .backend-global-search {
  max-width: none;
  min-width: 0;
}

body.backend-shell-active .backend-global-search input {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.backend-topbar-actions,
.backend-legacy-actions-slot,
.backend-legacy-actions-slot .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.backend-topbar-actions {
  flex-wrap: wrap;
}

.backend-legacy-actions-slot[hidden] {
  display: none !important;
}

body.backend-shell-active .backend-topbar .backend-quick-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
}

body.backend-shell-active .backend-topbar .backend-quick-actions a,
body.backend-shell-active .backend-legacy-actions-slot .header-actions a,
body.backend-shell-active .backend-legacy-actions-slot .header-actions button,
body.backend-shell-active .backend-legacy-actions-slot .header-actions .status-pill {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

body.backend-shell-active .backend-legacy-actions-slot .header-actions .status-pill {
  display: inline-flex;
  align-items: center;
}

.backend-sidebar .backend-menu-link {
  position: relative;
  border-radius: var(--backend-radius);
  color: var(--ink-soft);
}

.backend-menu-link.active::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--backend-accent);
}

.backend-sidebar .backend-menu-link:hover,
.backend-sidebar .backend-menu-link.active {
  border-color: var(--backend-line);
  background: var(--backend-panel-muted);
}

body.backend-shell-active .admin-card,
body.backend-shell-active .workbench-panel,
body.backend-shell-active .customer-management-panel,
body.backend-shell-active .order-panel,
body.backend-shell-active .quote-wizard,
body.backend-shell-active .temporary-product-panel {
  border: 1px solid var(--backend-line);
  border-radius: var(--backend-radius);
  background: var(--backend-panel);
  box-shadow: 0 10px 26px rgba(15, 42, 58, 0.06);
}

body.backend-shell-active .admin-card,
body.backend-shell-active .workbench-panel,
body.backend-shell-active .customer-management-panel,
body.backend-shell-active .order-panel {
  padding: var(--backend-card-padding);
}

body.backend-shell-active .section-heading,
body.backend-shell-active .workbench-panel-head {
  gap: 12px;
}

body.backend-shell-active .section-heading h2,
body.backend-shell-active .section-heading h3,
body.backend-shell-active .workbench-panel-head h3 {
  letter-spacing: 0;
}

body.backend-shell-active .admin-card > .section-heading:first-child,
body.backend-shell-active .admin-card > h2:first-child,
body.backend-shell-active .workbench-panel > .workbench-panel-head:first-child,
body.backend-shell-active .customer-management-panel > .section-heading:first-child,
body.backend-shell-active .order-panel > .section-heading:first-child {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--backend-line);
}

body.backend-shell-active .admin-card > .section-heading:first-child p,
body.backend-shell-active .workbench-panel > .workbench-panel-head:first-child p,
body.backend-shell-active .customer-management-panel > .section-heading:first-child p,
body.backend-shell-active .order-panel > .section-heading:first-child p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.backend-shell-active input,
body.backend-shell-active select,
body.backend-shell-active textarea {
  border-color: var(--backend-line);
  border-radius: var(--backend-radius);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 42, 58, 0.035);
}

body.backend-shell-active input,
body.backend-shell-active select {
  min-height: var(--backend-control-height);
}

body.backend-shell-active input[type="checkbox"],
body.backend-shell-active input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

body.backend-shell-active input[type="file"] {
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

body.backend-shell-active input:focus,
body.backend-shell-active select:focus,
body.backend-shell-active textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--backend-focus-ring);
}

body.backend-shell-active .quote-history-filter-panel,
body.backend-shell-active .order-stats-filters,
body.backend-shell-active .tech-doc-filters,
body.backend-shell-active .audit-log-filters,
body.backend-shell-active .dashboard-actions,
body.backend-shell-active .customer-list-toolbar {
  padding: 12px;
  border: 1px solid var(--backend-line);
  border-radius: var(--backend-radius);
  background: var(--backend-panel-muted);
}

.backend-table-shell,
.analysis-table-wrap,
.order-stats-table-wrap {
  overflow: auto;
  border: 1px solid var(--backend-line);
  border-radius: var(--backend-radius);
  background: var(--backend-panel);
}

.admin-table {
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table thead th {
  background: var(--backend-panel-muted);
  color: var(--ink-soft);
}

body.backend-shell-active .admin-table,
body.backend-shell-active .quote-history-table,
body.backend-shell-active .analysis-table,
body.backend-shell-active .dashboard-sales-table,
body.backend-shell-active .order-stats-table {
  font-size: 12px;
}

body.backend-shell-active .admin-table th,
body.backend-shell-active .quote-history-table th,
body.backend-shell-active .analysis-table th,
body.backend-shell-active .dashboard-sales-table th,
body.backend-shell-active .order-stats-table th,
body.backend-shell-active .audit-log-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--backend-panel-muted);
  color: var(--ink-soft);
}

body.backend-shell-active .admin-table th,
body.backend-shell-active .admin-table td,
body.backend-shell-active .quote-history-table th,
body.backend-shell-active .quote-history-table td,
body.backend-shell-active .analysis-table th,
body.backend-shell-active .analysis-table td,
body.backend-shell-active .dashboard-sales-table th,
body.backend-shell-active .dashboard-sales-table td,
body.backend-shell-active .order-stats-table th,
body.backend-shell-active .order-stats-table td {
  padding: 8px 9px;
  line-height: 1.42;
}

body.backend-shell-active .excel-drop,
body.backend-shell-active .tech-doc-drop,
body.backend-shell-active .batch-upload-field {
  min-height: 96px;
  margin: 8px 0;
  padding: 14px;
  border-radius: var(--backend-radius);
  background: var(--backend-panel-muted);
}

body.backend-shell-active .status-pill,
body.backend-shell-active .approval-status,
body.backend-shell-active .quote-status-badge,
body.backend-shell-active .audit-log-status,
.backend-status-label {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #b9deea;
  border-radius: 999px;
  background: #eef9fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

body.backend-shell-active .status-pill.saved,
body.backend-shell-active .approval-status.approved,
body.backend-shell-active .quote-status-badge.won {
  border-color: #bbdfc6;
  background: #effaf2;
  color: var(--success);
}

body.backend-shell-active .status-pill.error,
body.backend-shell-active .status-pill.danger,
body.backend-shell-active .approval-status.rejected,
body.backend-shell-active .quote-status-badge.lost,
body.backend-shell-active .quote-status-badge.rejected {
  border-color: #f2b8b5;
  background: #fff4f2;
  color: var(--danger);
}

body.backend-shell-active .quote-status-badge.pending_approval,
body.backend-shell-active .approval-status.pending,
body.backend-shell-active .status-pill.warn {
  border-color: #f2d4a9;
  background: #fff8ed;
  color: var(--warning);
}

.backend-danger-zone {
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--backend-radius);
  background: #fff7f6;
  color: var(--ink);
}

body.backend-shell-active .recycle-bin-card,
body.backend-shell-active .secure-media-card {
  border-color: rgba(180, 35, 24, 0.18);
}

.backend-module-active {
  animation: backendModuleIn 0.18s ease-out;
}

@keyframes backendModuleIn {
  from {
    opacity: 0.86;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.backend-workbench-home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid #d2e2ea;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbfd, #ffffff);
}

.backend-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: center;
}

.backend-workbench-home h2 {
  margin: 4px 0 8px;
}

.backend-workbench-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.backend-workbench-home-grid a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #bfdfeb;
  border-radius: 12px;
  background: #ecf9fd;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.backend-workbench-home-grid a:hover {
  background: #dff4fb;
}

.backend-home-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.backend-home-card {
  display: grid;
  gap: 7px;
  min-height: 122px;
  padding: 15px;
  border: 1px solid #d1e3ec;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(18, 49, 68, 0.055);
}

.backend-home-card:hover {
  border-color: #abd8e7;
  background: #f7fcfe;
  transform: translateY(-1px);
}

.backend-home-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.backend-home-card strong {
  color: var(--primary);
  font-size: 17px;
}

.backend-home-card small {
  color: #6d7a8d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workbench-motivation-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.workbench-focus-card,
.workbench-next-action-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #fbfdfe;
  box-shadow: 0 8px 18px rgba(18, 49, 68, 0.045);
}

.workbench-panel-head.compact {
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4edf2;
}

.workbench-today-focus {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #cfe0e8;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-today-focus strong {
  color: #0c5b6d;
  font-size: 17px;
  line-height: 1.28;
}

.workbench-today-focus span,
.workbench-today-focus small {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.workbench-progress-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.workbench-progress-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-progress-card span,
.workbench-next-action-card small,
.workbench-ranking-metric h4,
.workbench-ranking-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workbench-progress-card strong {
  color: #0c5b6d;
  font-size: 21px;
  line-height: 1.1;
}

.workbench-progress-card small {
  color: #6c7785;
  font-size: 12px;
  font-weight: 800;
}

.workbench-next-action-list {
  display: grid;
  gap: 8px;
}

.workbench-next-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbe6ec;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.workbench-next-action-card:hover {
  border-color: #9bcfe1;
  background: #f7fcfe;
}

.workbench-next-action-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workbench-next-action-card strong {
  color: #0c5b6d;
  font-size: 15px;
  line-height: 1.3;
}

.workbench-next-action-card em {
  color: #6c7785;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-next-action-card b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #b7d3dd;
  border-radius: 6px;
  background: #eef8fb;
  color: #0c5b6d;
  font-size: 12px;
  white-space: nowrap;
}

.workbench-stats-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(420px, 1fr);
  gap: 14px;
  align-items: end;
}

.workbench-stats-toolbar h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.workbench-dashboard-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #d5e1e8;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workbench-ranking-panel {
  display: grid;
  gap: 12px;
}

.workbench-ranking-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workbench-ranking-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-ranking-metric h4 {
  margin: 0 0 10px;
}

.workbench-ranking-metric > strong {
  display: block;
  margin-bottom: 4px;
  color: #0c5b6d;
  font-size: 24px;
  line-height: 1.12;
}

.workbench-ranking-metric ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workbench-ranking-metric li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  background: #fbfdfe;
}

.workbench-ranking-metric li.current {
  border-color: #b7d3dd;
  background: #f0f8fb;
}

.workbench-ranking-metric li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eaf3f7;
  color: #0c5b6d;
  font-size: 12px;
  font-weight: 900;
}

.workbench-ranking-metric li strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.workbench-ranking-metric li b {
  color: #0c5b6d;
  font-size: 13px;
  white-space: nowrap;
}

.workbench-ranking-metric li em {
  grid-column: 2 / -1;
  color: #166534;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.workbench-kpi-card,
.workbench-panel,
.workbench-plan-list > div,
.workbench-plan-card,
.workbench-quick-actions a {
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 49, 68, 0.045);
}

.workbench-kpi-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
}

.workbench-kpi-card span,
.workbench-plan-list span,
.workbench-plan-card span,
.workbench-quick-actions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workbench-kpi-card strong,
.workbench-plan-list strong,
.workbench-plan-card strong {
  color: #0c5b6d;
  font-size: 24px;
  line-height: 1.1;
}

.workbench-kpi-card small,
.workbench-plan-list small,
.workbench-plan-card small {
  color: #6c7785;
  font-size: 12px;
  font-weight: 800;
}

.workbench-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.workbench-panel {
  min-width: 0;
  padding: 16px;
}

.workbench-panel-wide {
  grid-column: 1 / -1;
  min-height: 320px;
}

.workbench-path-panel {
  padding: 14px 16px 16px;
}

.workbench-path-panel .workbench-panel-head {
  margin-bottom: 10px;
}

.workbench-path-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.workbench-path-action {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 13px;
  border: 1px solid #cfe0e8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(18, 49, 68, 0.045);
}

.workbench-path-action:hover {
  border-color: #9bcfe1;
  background: #f7fcfe;
}

.workbench-path-action span {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 900;
}

.workbench-path-action strong {
  color: #0c5b6d;
  font-size: 18px;
  line-height: 1.2;
}

.workbench-path-action small {
  color: #6c7785;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-opportunity-panel {
  display: grid;
  gap: 12px;
}

.workbench-opportunity-settings {
  display: flex;
  justify-content: flex-end;
  min-width: 190px;
}

.workbench-opportunity-settings label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px auto;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d7e2e8;
  border-radius: 8px;
  background: #f8fbfd;
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 900;
}

.workbench-opportunity-settings input {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #cbd9e2;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.workbench-opportunity-list {
  display: grid;
  gap: 10px;
}

.workbench-opportunity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-left: 4px solid #b8c7d0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 49, 68, 0.04);
}

.workbench-opportunity-card.priority-high {
  border-left-color: #c2410c;
  background: #fffaf5;
}

.workbench-opportunity-card.priority-medium {
  border-left-color: #b7791f;
}

.workbench-opportunity-card.priority-low {
  border-left-color: #3f7f62;
}

.workbench-opportunity-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.workbench-opportunity-title {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workbench-opportunity-title strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workbench-opportunity-title span,
.workbench-opportunity-meta span,
.workbench-opportunity-main small {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-opportunity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.workbench-opportunity-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workbench-opportunity-reason {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #d7e5dc;
  border-radius: 999px;
  background: #f4faf6;
  color: #1f5f45;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workbench-opportunity-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.workbench-opportunity-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.workbench-opportunity-priority.high {
  color: #9a3412;
  background: #ffedd5;
}

.workbench-opportunity-priority.medium {
  color: #8a4b12;
  background: #fef3c7;
}

.workbench-opportunity-priority.low {
  color: #1f5f45;
  background: #dcfce7;
}

.workbench-opportunity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workbench-opportunity-actions button {
  min-height: 32px;
  padding: 6px 10px;
}

.workbench-opportunity-empty {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #cbd9e2;
  border-radius: 8px;
  background: #f8fbfd;
}

.workbench-opportunity-empty strong {
  color: var(--ink);
}

.workbench-opportunity-empty span {
  color: #5f6f7c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.workbench-opportunity-empty div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workbench-sales-target-panel {
  display: grid;
  gap: 12px;
}

.workbench-sales-target-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workbench-sales-target-list {
  display: grid;
  gap: 10px;
}

.workbench-sales-target-empty {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed #cbd9e2;
  border-radius: 8px;
  background: #f8fbfd;
}

.workbench-sales-target-empty span {
  color: #5f6f7c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.workbench-sales-target-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workbench-sales-target-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-sales-target-card span,
.workbench-sales-target-card small {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.workbench-sales-target-card strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workbench-sales-target-card i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef3;
}

.workbench-sales-target-card i::before {
  display: block;
  width: var(--target-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #2f7f73;
  content: "";
}

.workbench-sales-target-card.status-behind i::before {
  background: #c47a28;
}

.workbench-sales-target-card.status-unset i::before {
  background: #b8c4cd;
}

.workbench-sales-target-card.status-done i::before {
  background: #2f7f4f;
}

.workbench-production-orders-panel {
  display: grid;
  gap: 12px;
}

.workbench-production-orders {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.workbench-production-orders-summary,
.workbench-production-orders-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
  padding: 12px;
  border: 1px dashed #cbd9e2;
  border-radius: 8px;
  background: #f8fbfd;
}

.workbench-production-orders-summary strong,
.workbench-production-orders-empty strong {
  color: var(--ink);
}

.workbench-production-orders-summary span,
.workbench-production-orders-empty span {
  color: #5f6f7c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workbench-production-order-list {
  display: grid;
  gap: 10px;
  max-height: min(560px, 62vh);
  overflow: auto;
  padding-right: 2px;
}

.workbench-production-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-left: 4px solid #0f6b7d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 49, 68, 0.04);
}

.workbench-production-order-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.workbench-production-order-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workbench-production-order-title strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workbench-production-order-title span {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.workbench-production-order-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.workbench-production-order-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #edf3f6;
  border-radius: 6px;
  background: #fbfdfe;
  color: #1f2d3d;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workbench-production-order-meta b {
  color: #6c7785;
  font-size: 11px;
  font-weight: 900;
}

.workbench-production-order-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.workbench-production-stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.workbench-production-stage.ready {
  color: #14532d;
  background: #dcfce7;
}

.workbench-production-stage.pending {
  color: #8a4b12;
  background: #fef3c7;
}

.workbench-production-order-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workbench-production-order-actions > * {
  min-height: 32px;
  padding: 6px 10px;
}

.workbench-quote-visit-alerts {
  display: grid;
  gap: 10px;
}

.workbench-quote-visit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e4ea;
  border-left: 4px solid #7aa2b7;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-quote-visit-card.heat-hot {
  border-left-color: #c2410c;
  background: #fffaf5;
}

.workbench-quote-visit-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workbench-quote-visit-card span,
.workbench-quote-visit-card small {
  color: #5f6f7c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.workbench-quote-visit-metrics,
.workbench-quote-visit-next {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.workbench-quote-visit-empty {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #cbd9e2;
  border-radius: 8px;
  background: #f8fbfd;
}

.workbench-quote-visit-empty strong {
  color: var(--ink);
}

.workbench-quote-visit-empty span {
  color: #5f6f7c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.workbench-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.workbench-panel-head h3,
.workbench-list-group h4,
.workbench-recent-quotes h4 {
  margin: 0;
  color: var(--ink);
}

.workbench-panel-head .secondary,
.workbench-follow-card .secondary {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.workbench-funnel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.workbench-funnel-bars {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.workbench-funnel-bars,
.workbench-recent-quotes {
  min-width: 0;
  max-width: 100%;
}

.workbench-funnel-row {
  display: grid;
  gap: 7px;
}

.workbench-funnel-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #34495a;
  font-weight: 900;
}

.workbench-funnel-row span {
  color: var(--muted);
  font-size: 13px;
}

.workbench-funnel-row i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f5;
}

.workbench-funnel-row i::before {
  content: "";
  display: block;
  width: var(--bar);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0c6f83, #48a06f);
}

.workbench-recent-quotes,
.workbench-list-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.workbench-recent-quotes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.workbench-recent-quotes h4,
.workbench-recent-quotes-more {
  grid-column: 1 / -1;
}

.workbench-mini-row,
.workbench-follow-card,
.workbench-quote-resume-card,
.workbench-check-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  background: #fbfdfe;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workbench-mini-row strong {
  color: #446033;
}

.workbench-recent-quotes .workbench-mini-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 0;
  gap: 4px;
  padding: 8px;
}

.workbench-recent-quotes .workbench-mini-row button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.workbench-recent-quotes .workbench-mini-row span,
.workbench-recent-quotes .workbench-mini-row strong,
.workbench-recent-quotes .workbench-mini-row small {
  line-height: 1.35;
}

.workbench-recent-quotes .workbench-mini-row span,
.workbench-recent-quotes .workbench-mini-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-recent-quotes .workbench-mini-row small {
  display: none;
}

.workbench-recent-quotes-more {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px dashed #bdd4df;
  border-radius: 8px;
  background: #f6fbfd;
}

.workbench-recent-quotes-more span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-recent-quotes-more .secondary {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  white-space: nowrap;
  text-align: center;
}

.workbench-mini-row span,
.workbench-mini-row strong,
.workbench-mini-row small,
.workbench-follow-card span,
.workbench-follow-card strong,
.workbench-follow-card small,
.workbench-quote-resume-card span,
.workbench-quote-resume-card strong,
.workbench-quote-resume-card small,
.workbench-check-row span,
.workbench-check-row strong,
.workbench-check-row small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workbench-mini-row small,
.workbench-follow-card small,
.workbench-quote-resume-card small,
.workbench-check-row small {
  color: #697889;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.workbench-todo-form {
  display: grid;
  grid-template-columns: 120px 140px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.workbench-todo-input input {
  min-width: 0;
}

.workbench-plan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.workbench-plan-list > div {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px;
}

.workbench-plan-card {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.workbench-plan-card:hover,
.workbench-plan-card:focus-visible,
.workbench-plan-card.selected {
  border-color: #0c7185;
  background: #eef8fb;
  box-shadow: 0 10px 22px rgba(12, 113, 133, 0.12);
}

.workbench-plan-card.needs-alert {
  border-color: #d97706;
  background: #fff7ed;
}

.workbench-plan-card.needs-alert strong,
.workbench-plan-card.needs-alert em {
  color: #b45309;
}

.workbench-plan-card em {
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.workbench-carry-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
  font-size: 11px;
  font-weight: 900;
}

.workbench-check-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.workbench-check-row input {
  width: 18px;
  height: 18px;
}

.workbench-check-row.urgent {
  border-color: #f0c7a1;
  background: #fff8f0;
}

.workbench-check-row.done strong,
.workbench-check-row.done small {
  color: #8a98a8;
  text-decoration: line-through;
}

.workbench-quote-resume-list,
.workbench-follow-list {
  display: grid;
  gap: 9px;
}

.workbench-quote-resume-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.workbench-quote-resume-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.workbench-quote-resume-card span {
  display: inline-flex;
  width: fit-content;
  margin: 4px 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef7ef;
  color: #446033;
  font-size: 12px;
  font-weight: 900;
}

.workbench-follow-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.workbench-follow-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.workbench-follow-actions .secondary,
.workbench-follow-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.workbench-follow-actions .muted {
  font-size: 12px;
}

.workbench-follow-card span {
  color: #0c5b6d;
  font-size: 12px;
  font-weight: 900;
}

.workbench-follow-card.urgent {
  border-color: #efb4a0;
  background: #fff7f4;
}

.workbench-follow-card.today {
  border-color: #c9ddae;
  background: #f7fbf0;
}

.workbench-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workbench-quick-actions a {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 13px;
  color: var(--ink);
  text-decoration: none;
}

.workbench-quick-actions a:hover {
  border-color: #b7d3dd;
  background: #f7fbfd;
}

.workbench-quick-actions strong {
  color: #0c5b6d;
}

body.backend-shell-active:not(.backend-home-active) #workbenchHome {
  display: none;
}

body.backend-shell-active.backend-home-active .brand-settings {
  display: none !important;
}

body.backend-shell-active.backend-home-active .workflow-language-slot {
  display: none !important;
}

body.backend-shell-active.backend-home-active #quoteWorkbench,
body.backend-shell-active.backend-home-active #quoteMainHeading,
body.backend-shell-active.backend-home-active #quoteWizard,
body.backend-shell-active.backend-home-active [data-quote-wizard-panel],
body.backend-shell-active.backend-home-active .quote-panel {
  display: none !important;
}

body.backend-shell-active.backend-home-active .workspace,
body.backend-shell-active.sales-mode:not([data-quote-wizard-step="5"]):not([data-quote-wizard-step="6"]) .workspace {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1320px;
}

body.backend-shell-active.sales-mode:not([data-quote-wizard-step="5"]):not([data-quote-wizard-step="6"]) .quote-panel {
  display: none !important;
}

body.backend-shell-active.sales-mode:not([data-quote-wizard-step="5"]):not([data-quote-wizard-step="6"]) .editor-panel {
  max-height: none;
}

@media (max-width: 1180px) {
  body.backend-shell-active:not(.public-site) {
    padding-left: 0;
  }

  .backend-sidebar {
    transform: translateX(-104%);
    transition: transform 0.18s ease;
  }

  body.backend-menu-open .backend-sidebar {
    transform: translateX(0);
  }

  .backend-menu-toggle {
    position: fixed;
    z-index: 100;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    min-height: 44px;
    padding: 10px 15px;
    border-radius: 999px;
    box-shadow: 0 14px 26px rgba(14, 57, 72, 0.18);
  }

  .backend-topbar {
    top: 0;
  }

  .workflow-language-slot {
    justify-content: stretch;
  }

  .workflow-language-slot .language-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .workflow-language-slot .language-tool::after {
    grid-column: 1 / -1;
  }

  .workflow-language-slot .language-tool .field {
    min-width: 0;
  }

  .backend-home-hero,
  .backend-home-dashboard {
    grid-template-columns: 1fr;
  }

  .workbench-dashboard-hero,
  .workbench-motivation-panel,
  .workbench-stats-toolbar,
  .workbench-main-grid,
  .workbench-funnel,
  .workbench-sales-target-grid,
  .workbench-production-order-card,
  .workbench-ranking-list {
    grid-template-columns: 1fr;
  }

  .workbench-kpi-grid,
  .workbench-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-todo-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-todo-form button,
  .workbench-todo-input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .workbench-stats-toolbar,
  .workbench-dashboard-controls,
  .workbench-todo-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .workbench-motivation-panel,
  .workbench-ranking-list,
  .workbench-sales-target-grid,
  .workbench-kpi-grid,
  .workbench-recent-quotes {
    grid-template-columns: 1fr;
  }

  .workbench-next-action-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workbench-next-action-card b {
    width: 100%;
  }

  .workbench-opportunity-card,
  .workbench-production-order-card,
  .workbench-opportunity-settings label {
    grid-template-columns: 1fr;
  }

  .workbench-opportunity-side,
  .workbench-opportunity-actions,
  .workbench-production-order-side,
  .workbench-production-order-actions {
    justify-items: stretch;
    justify-content: stretch;
  }

  .workbench-opportunity-actions button,
  .workbench-production-order-actions > * {
    flex: 1 1 130px;
  }

  .workbench-production-order-meta {
    grid-template-columns: 1fr;
  }

  .workbench-production-order-list {
    max-height: none;
  }

  .workbench-progress-list {
    grid-template-columns: 1fr;
  }

  .sales-target-default-form,
  .sales-target-user-row {
    grid-template-columns: 1fr;
  }

  .backend-topbar .backend-nav-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .backend-topbar {
    left: 0;
    right: 0;
    border-radius: 0;
  }

  .backend-topbar-main {
    grid-template-columns: 1fr;
  }

  .backend-topbar-actions,
  .backend-legacy-actions-slot .header-actions {
    justify-content: flex-start;
  }

  .backend-topbar .backend-quick-actions {
    justify-content: flex-start;
  }

  .backend-search-results {
    position: fixed;
    top: 142px;
    left: 12px;
    right: 12px;
  }

  .backend-workbench-home {
    grid-template-columns: 1fr;
  }

  .backend-workbench-home-grid {
    grid-template-columns: 1fr;
  }

  .workbench-dashboard-controls,
  .workbench-kpi-grid,
  .workbench-todo-form,
  .workbench-plan-list,
  .workbench-quick-actions {
    grid-template-columns: 1fr;
  }

  .workbench-panel-head,
  .workbench-follow-card,
  .workbench-quote-resume-card,
  .workbench-check-row {
    grid-template-columns: 1fr;
  }

  .workbench-quote-resume-actions {
    justify-content: stretch;
  }

  .workbench-quote-resume-actions > * {
    flex: 1 1 140px;
  }

  .workbench-panel-head {
    display: grid;
  }

  .workbench-check-row {
    align-items: start;
  }

  .workbench-check-row input {
    justify-self: start;
  }
}

/* Public website */
.public-site {
  min-height: 100vh;
  background: #f5f8fa;
  color: #142033;
  font-family: Arial, "Helvetica Neue", sans-serif;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #d8e3ea;
  backdrop-filter: blur(12px);
}

.public-brand,
.public-nav,
.public-actions {
  display: flex;
  align-items: center;
}

.public-brand {
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.public-brand img {
  width: 138px;
  max-height: 58px;
  object-fit: contain;
}

.public-brand strong {
  display: block;
  max-width: 520px;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.public-brand small,
.public-muted,
.public-section-head p,
.public-hero p,
.public-company-card p {
  color: #607086;
}

.public-nav {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-nav a,
.public-secondary,
.public-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #c9d8df;
  border-radius: 8px;
  color: #0b5d6f;
  text-decoration: none;
  font-weight: 700;
  background: #fff;
}

.public-workbench-link,
.public-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  color: #fff !important;
  background: #0b6678 !important;
  border: 1px solid #0b6678 !important;
  text-decoration: none;
  font-weight: 800;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 28px;
  padding: clamp(48px, 7vw, 92px) clamp(20px, 5vw, 72px);
  background: linear-gradient(135deg, #eef7fa 0%, #ffffff 55%, #e8f1f4 100%);
}

.public-hero h1 {
  max-width: 760px;
  margin: 8px 0 18px;
  font-size: clamp(34px, 4.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.public-hero p {
  max-width: 700px;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.65;
}

.public-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.public-hero-card,
.public-company-card,
.public-contact-card,
.public-product-card {
  border: 1px solid #d3e0e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 32, 51, 0.08);
}

.public-hero-card {
  align-self: center;
  display: grid;
  gap: 14px;
  padding: 28px;
}

.public-hero-card strong {
  font-size: 22px;
}

.public-hero-card span {
  padding: 14px 16px;
  border-radius: 8px;
  background: #f0f6f8;
  color: #243449;
  font-weight: 700;
}

.public-inquiry-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: -28px clamp(20px, 5vw, 72px) 18px;
  padding: 18px 20px;
  border: 1px solid #c8dce6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(20, 32, 51, 0.08);
}

.public-inquiry-strip strong,
.public-inquiry-strip span {
  display: block;
}

.public-inquiry-strip strong {
  color: #142033;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.25;
}

.public-inquiry-strip span {
  margin-top: 4px;
  color: #607086;
  font-weight: 700;
  line-height: 1.5;
}

.public-section {
  padding: 58px clamp(20px, 5vw, 72px);
}

.public-section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.public-section h2 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
}

.public-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.public-product-card {
  overflow: hidden;
}

.public-product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid #e3ecf1;
}

.public-product-body {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.public-product-body h3 {
  margin: 0;
  font-size: 28px;
}

.public-product-type {
  margin: 0;
  color: #0b6678;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-document-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #cfe0ea;
  border-radius: 999px;
  background: #f7fbfd;
  color: #0b6678;
  font-weight: 800;
  text-decoration: none;
}

.public-product-highlights {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: #f7fbfd;
}

.public-product-highlights span {
  color: #243449;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.public-spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.public-spec-list div {
  padding: 12px;
  border-radius: 8px;
  background: #f4f8fa;
}

.public-spec-list dt {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.public-spec-list dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.public-product-list {
  margin: 0;
  padding-left: 20px;
  color: #34445a;
}

.public-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.public-card-action,
.public-card-secondary {
  justify-self: start;
}

.public-card-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d4e1e8;
  border-radius: 8px;
  color: #243449;
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.public-company {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 24px;
  background: #fff;
}

.public-company-card,
.public-contact-card {
  padding: 24px;
}

.public-link-list {
  display: grid;
  gap: 8px;
}

.public-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.public-contact-card {
  display: grid;
  gap: 12px;
}

.public-contact-card h3 {
  margin: 0;
}

.public-contact-card a {
  color: #0b6678;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.public-contact-methods {
  display: grid;
  gap: 8px;
}

.public-wechat-qr {
  max-width: 180px;
  border: 1px solid #d8e3ea;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.public-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed #b9ced8;
  border-radius: 10px;
  color: #607086;
  background: #fff;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(20px, 5vw, 72px);
  border-top: 1px solid #d8e3ea;
  color: #607086;
  background: #fff;
}

.approval-request-list {
  display: grid;
  gap: 10px;
}

.approval-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.approval-summary-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #f8fbfd;
}

.approval-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-summary-card strong {
  color: #0b5d73;
  font-size: 24px;
}

.approval-user-stats {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.approval-user-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #122033;
}

.approval-user-stats-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-user-stats-table {
  display: grid;
  overflow: hidden;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fff;
}

.approval-user-stats-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(5, minmax(64px, 0.6fr)) minmax(150px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #edf2f6;
  color: #26364a;
  font-size: 12px;
  font-weight: 800;
}

.approval-user-stats-row.head {
  border-top: 0;
  background: #edf6fa;
  color: #0b5d73;
  font-weight: 900;
}

.approval-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.approval-status-tabs button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
}

.approval-status-tabs button.active {
  color: #fff;
  border-color: #0b6b83;
  background: #0b6b83;
}

.approval-request-table {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fff;
}

.approval-request-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(110px, 0.7fr) 86px minmax(150px, 0.9fr) minmax(240px, 1.4fr) minmax(210px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #edf2f6;
  font-size: 12px;
  font-weight: 800;
}

.approval-request-row.head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-top: 0;
  background: #edf6fa;
  color: #0b5d73;
  font-weight: 900;
}

.approval-request-row.pending {
  background: #fffdf7;
}

.approval-request-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.approval-request-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.approval-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #f3c37b;
  border-radius: 999px;
  color: #9a4b05;
  background: #fff7e8;
  font-style: normal;
}

.approval-status.approved {
  border-color: #bbdfc6;
  color: #176b39;
  background: #f0fbf3;
}

.approval-status.rejected {
  border-color: #f7b4ad;
  color: #b91c1c;
  background: #fff7f6;
}

.approval-request-card,
.approval-detail-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  margin-top: 10px;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fff;
}

.approval-request-card div,
.approval-detail-card div {
  min-width: 0;
}

.approval-request-card span,
.approval-request-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.approval-detail-card {
  display: block;
}

.approval-diff-table {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(220px, 1fr) minmax(220px, 1fr);
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fff;
}

.approval-diff-table > div {
  min-width: 0;
  padding: 10px 12px;
  border-top: 1px solid #edf2f6;
  border-left: 1px solid #edf2f6;
  overflow-wrap: anywhere;
}

.approval-diff-table > div:nth-child(3n + 1) {
  border-left: 0;
}

.approval-diff-table > div:nth-child(-n + 3) {
  border-top: 0;
}

.approval-diff-head {
  color: #0b5d73;
  background: #edf6fa;
  font-weight: 900;
}

.approval-diff-table pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  font: inherit;
}

.admin-item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.company-share-toggle {
  justify-content: flex-end;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.admin-section-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #f8fbfd;
  font-weight: 700;
}

.approval-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.approval-row-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.approval-detail-panel {
  display: grid;
  gap: 10px;
  max-height: 360px;
  margin-top: 12px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #d8e3ea;
  border-radius: 8px;
  background: #fbfdff;
}

.approval-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.approval-detail-head strong,
.approval-detail-head span {
  display: block;
}

.approval-detail-head span,
.approval-detail-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.approval-change-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.approval-change-comparison div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: #fbfdff;
}

.approval-change-comparison span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.approval-change-comparison strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.approval-json-detail summary {
  cursor: pointer;
  color: #0b5d73;
  font-weight: 900;
}

.approval-json-detail pre {
  max-height: 230px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: #f5f8fa;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.account-permission-list {
  display: grid;
  gap: 12px;
}

.account-permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.account-permission-summary span,
.account-permission-summary strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d7e6ee;
  border-radius: 999px;
  background: #f7fbfd;
  color: #516073;
  font-size: 12px;
  font-weight: 850;
}

.account-permission-summary strong {
  border-color: #b8d9e7;
  background: #eaf8fc;
  color: #075a70;
}

.account-form-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fbfdff;
}

.account-form-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-form-panel-head h3 {
  margin: 0;
  color: #0b5d73;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.account-form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(220px, 0.8fr);
}

.account-permission-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8e3ea;
  border-radius: 10px;
  background: #fff;
}

.account-permission-table-wrap.preview {
  background: #fbfdff;
}

.account-permission-table {
  min-width: 1420px;
}

.account-permission-table-head,
.account-permission-row {
  display: grid;
  grid-template-columns: 160px 255px minmax(860px, 1fr) 112px;
  gap: 8px;
  align-items: start;
}

.account-permission-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  border-bottom: 1px solid #d8e3ea;
  background: #edf6fa;
  color: #0b5d73;
  font-size: 12px;
  font-weight: 900;
}

.account-permission-row {
  padding: 8px 10px;
  border-bottom: 1px solid #e4edf2;
}

.account-permission-row:last-child {
  border-bottom: 0;
}

.account-permission-row.preview {
  opacity: 0.72;
}

.account-identity-cell,
.account-profile-cell,
.account-row-actions {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.account-identity-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: 6px;
  background: inherit;
}

.account-identity-cell strong,
.account-identity-cell span,
.account-identity-cell small {
  overflow-wrap: anywhere;
}

.account-identity-cell strong {
  color: #122033;
  font-size: 13px;
}

.account-identity-cell span,
.account-identity-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-profile-cell {
  grid-template-columns: minmax(96px, 1fr) minmax(88px, 0.8fr) 58px;
}

.account-profile-cell .field,
.account-form-grid .field {
  gap: 4px;
}

.account-profile-cell input,
.account-profile-cell select,
.account-form-grid input,
.account-form-grid select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.account-profile-cell .checkbox-line {
  align-self: end;
  min-height: 34px;
  padding: 0;
  gap: 4px;
  font-size: 11px;
}

.account-profile-cell .checkbox-line input,
.account-form-grid .checkbox-line input {
  width: 15px;
  height: 15px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: #0b6b83;
  box-shadow: none;
}

.account-permission-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #f1d29b;
  border-radius: 8px;
  background: #fffaf1;
  color: #7c3f08;
  font-weight: 800;
}

.account-permission-note span,
.account-permission-note small {
  color: #8a5a20;
  font-size: 12px;
  font-weight: 700;
}

.account-permission-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.account-permission-cell {
  padding: 6px;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.account-permission-cell h3 {
  margin: 0 0 4px;
  color: #0b5d73;
  font-size: 11px;
}

.account-permission-cell > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 4px;
}

.permission-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  color: #243449;
  font-size: 11px;
  font-weight: 800;
}

.permission-toggle.compact {
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid #d7e6ee;
  border-radius: 6px;
  background: #fff;
}

.permission-toggle.compact input {
  width: 13px;
  height: 13px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: #0b6b83;
  box-shadow: none;
}

.permission-toggle.compact span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.permission-toggle.locked {
  opacity: 0.64;
}

.account-row-actions {
  align-content: start;
}

.account-row-actions button {
  width: 100%;
  min-height: 34px;
  padding: 6px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .account-form-grid,
  .account-form-grid.compact {
    grid-template-columns: 1fr;
  }

  .account-permission-table {
    min-width: 0;
  }

  .account-permission-table-head {
    display: none;
  }

  .account-permission-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .account-identity-cell {
    position: static;
    padding-right: 0;
  }

  .account-profile-cell {
    grid-template-columns: 1fr;
  }

  .account-permission-modules {
    grid-template-columns: 1fr;
  }

  .account-permission-cell > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-header,
  .public-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-hero,
  .public-inquiry-strip,
  .public-company,
  .public-product-grid,
  .public-contact-grid {
    grid-template-columns: 1fr;
  }

  .public-inquiry-strip {
    margin-top: 16px;
  }
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(248, 251, 253, 0.92), rgba(238, 243, 246, 0.96)),
    #eef3f6;
  color: var(--ink);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  display: grid;
  gap: 20px;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card-head {
  display: grid;
  gap: 8px;
}

.login-card h1,
.login-card h2,
.login-card p {
  margin: 0;
}

.login-card h1 {
  font-size: 26px;
  line-height: 1.18;
  color: var(--ink);
}

.login-card h2 {
  font-size: 18px;
  color: var(--ink);
}

.login-card p {
  color: var(--muted);
}

.login-form,
.login-current-account {
  display: grid;
  gap: 14px;
}

.login-form[hidden],
.login-current-account[hidden] {
  display: none;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.login-error {
  min-height: 18px;
  color: var(--danger);
  font-weight: 800;
}

.login-current-account {
  padding: 16px;
  border: 1px solid var(--backend-line);
  border-radius: 8px;
  background: var(--backend-panel-muted);
}

.login-account-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.login-account-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.login-account-list dt {
  color: var(--muted);
  font-weight: 800;
}

.login-account-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.login-password-notice {
  margin-top: 12px !important;
  padding: 10px 12px;
  border: 1px solid #f2d28a;
  border-radius: 8px;
  background: #fffbeb;
  color: #7c4a03 !important;
  font-weight: 800;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-actions button,
.login-form button {
  min-height: 44px;
}

.login-footer-actions {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.login-footer-actions a {
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}

.login-footer-actions a:hover {
  text-decoration: underline;
}

.shared-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 30, 42, 0.52);
  backdrop-filter: blur(5px);
}

.shared-login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(12, 30, 42, 0.24);
}

.shared-login-card h2 {
  margin: 0;
  color: var(--ink);
}

.shared-login-card p,
.shared-login-card small {
  margin: 0;
  color: var(--muted);
}

.shared-login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.shared-login-home {
  justify-self: center;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.shared-login-home:hover {
  text-decoration: underline;
}

.shared-login-error {
  min-height: 18px;
  color: #b63221 !important;
}

.quote-section {
  margin-top: 22px;
}

.quote-section h3 {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--brand), #0b5368);
  padding: 9px 12px;
  border-radius: 6px 6px 0 0;
  letter-spacing: 0.01em;
}

.quote-section h4 {
  margin: 18px 0 0;
  padding: 8px 10px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
  font-size: 14px;
  color: var(--brand);
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid #c8d4dd;
}

.quote-table th,
.quote-table td {
  border: 1px solid #cfd7df;
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
}

.quote-table th {
  background: #edf4f7;
  color: #1e3342;
  font-size: 12px;
  text-transform: uppercase;
}

.quote-table tbody tr:nth-child(even) td {
  background-color: #fbfdff;
}

.quote-table .section-row td {
  background: #f8fafc;
  font-weight: 800;
  color: var(--brand-dark);
}

.quote-table .quote-option-under-machine td {
  background: #fbfdff;
}

.quote-table .num {
  text-align: right;
  white-space: nowrap;
}

.packing-with-container {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  max-width: 100%;
}

.container-recommendation {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 6px;
  border: 1px solid #b9d9e3;
  border-radius: 999px;
  color: #0b5368;
  background: #eef8fb;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.packing-summary-row td {
  background: #fbfdff;
  padding-top: 8px;
  padding-bottom: 8px;
}

.packing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
}

.packing-summary > strong {
  color: var(--text);
  font-size: 13px;
}

.packing-summary b {
  color: var(--text);
}

.spec-table {
  table-layout: fixed;
}

.spec-table th,
.spec-table td {
  text-transform: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.spec-table .spec-group-col {
  width: 11%;
}

.spec-table .spec-item-col {
  width: 30%;
}

.spec-table .spec-unit-col {
  width: 12%;
}

.spec-table .spec-value-col {
  width: 37%;
}

.spec-table .spec-note-col {
  width: 10%;
}

.spec-editor-panel {
  margin: 14px 0;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.spec-editor-panel > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 11px 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.spec-editor-panel summary h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.spec-editor-panel .hint {
  color: var(--muted);
  font-size: 12px;
}

.spec-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  padding: 8px 10px;
  border-top: 1px solid #e3ebf0;
  background: #f8fbfd;
  overflow-x: auto;
  scrollbar-width: thin;
}

.spec-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e3ebf0;
}

.spec-editor-toolbar button,
.spec-editor-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.spec-editor-toolbar label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.spec-editor-toolbar select,
.spec-editor-toolbar input[type="color"] {
  min-height: 30px;
  border: 1px solid #d5e0e8;
  border-radius: 7px;
  background: #ffffff;
}

.spec-editor-toolbar select {
  max-width: 92px;
  padding: 4px 8px;
}

.spec-editor-toolbar input[type="color"] {
  width: 38px;
  padding: 2px;
}

.spec-editor-toolbar small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.spec-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
  padding: 6px 7px;
  border: 1px solid #d2e1ea;
  border-radius: 8px;
  background: #ffffff;
}

.spec-toolbar-group[data-spec-toolbar-group="历史"] {
  flex: 0 0 auto;
}

.spec-toolbar-group[data-spec-toolbar-group="行列"] {
  flex: 2 1 560px;
}

.spec-toolbar-group[data-spec-toolbar-group="单元格"] {
  flex: 1 1 360px;
}

.spec-toolbar-group[data-spec-toolbar-group="文字样式"] {
  flex: 1 1 500px;
}

.spec-toolbar-group[data-spec-toolbar-group="数据导入导出"] {
  flex: 0 1 320px;
}

.spec-toolbar-group-title {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding-right: 7px;
  margin-right: 1px;
  border-right: 1px solid #dbe8ef;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.spec-style-controls {
  align-items: center;
}

.checkbox-field.compact {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid #d5e0e8;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.checkbox-field.compact input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.danger-light {
  border-color: #f2c4bd !important;
  background: #fff6f4 !important;
  color: #a63a2e !important;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatches button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #d5e0e8;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.color-swatches span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.spec-editor-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #eef3f6;
  color: var(--muted);
  font-size: 12px;
}

.spec-editor-help strong {
  color: var(--brand);
  white-space: nowrap;
}

.spec-paste-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 0 16px 12px;
  border-top: 1px solid #eef3f6;
}

.spec-paste-tools textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  font: inherit;
}

.spec-paste-tools div {
  display: grid;
  gap: 8px;
  align-content: start;
}

.spec-editor {
  overflow: auto;
  padding: 0 16px 12px;
}

.editable-spec-table {
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.editable-spec-table .spec-row-col {
  width: 44px;
}

.editable-spec-table th,
.editable-spec-table td {
  border: 1px solid #d5e0e8;
  padding: 0;
  vertical-align: top;
}

.editable-spec-table td {
  cursor: cell;
}

.editable-spec-table th {
  padding: 8px;
  background: #edf4f7;
  color: #1e3342;
}

.editable-spec-table .spec-corner,
.editable-spec-table .spec-row-head {
  width: 44px;
  min-width: 44px;
  text-align: center;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.editable-spec-table .spec-col-head {
  min-width: 120px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.editable-spec-table .selected-head {
  background: #dcecf3;
  color: var(--brand);
}

.editable-spec-table .spec-cell-editor {
  width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: 8px;
  background: transparent;
  font: inherit;
  cursor: cell;
  outline: 0;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
}

.editable-spec-table .spec-category-cell {
  font-weight: 900;
}

.editable-spec-table .spec-cell-editor.editing {
  cursor: text;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 2px var(--brand);
  user-select: text;
}

.editable-spec-table .selected-row {
  background: #f8fbfd;
}

.editable-spec-table .selected-cell {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: #e8f5fa;
}

.editable-spec-table .selected-cell .spec-cell-editor {
  background: #e8f5fa;
}

.spec-row-head,
.spec-col-head {
  position: relative;
}

.spec-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.spec-col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  border-left: 1px solid #b7c9d6;
}

.spec-row-resizer {
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 8px;
  cursor: row-resize;
  z-index: 2;
}

.spec-row-resizer::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: 3px;
  left: 20%;
  border-bottom: 1px solid #b7c9d6;
}

.total-box {
  display: grid;
  gap: 0;
  max-width: 390px;
  margin-left: auto;
  margin-top: 14px;
  font-size: 13px;
  border: 1px solid #d3dde6;
  border-radius: 6px;
  overflow: hidden;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #edf1f5;
}

.total-row.grand {
  margin-top: 0;
  border-top: 2px solid var(--brand);
  border-bottom: 0;
  background: #f1f8fb;
  font-size: 18px;
  font-weight: 900;
}

.terms-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 13px;
  border: 1px solid #d6e0e8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

.quote-section h4 + .terms-list {
  border-top: 1px solid #d6e0e8;
}

.terms-list li {
  padding: 9px 11px;
  border-right: 1px solid #e3e9ee;
  border-bottom: 1px solid #e3e9ee;
  background: #ffffff;
}

.terms-list li.term-full {
  grid-column: 1 / -1;
  border-right: 0;
}

.terms-list strong {
  color: var(--muted);
}

.quote-section > ul:not(.terms-list):not(.cert-list) {
  margin: 0;
  padding: 12px 18px 12px 28px;
  border: 1px solid #d6e0e8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
}

.quote-section > ul:not(.terms-list):not(.cert-list) li {
  margin: 4px 0;
  line-height: 1.45;
}

.quote-cnc-system {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  margin: 0;
  list-style: none;
  border: 1px solid #d6e0e8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.cert-list li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.customer-note {
  padding: 14px 16px;
  border: 1px solid #c7dce6;
  border-radius: 8px;
  background: #f1f8fb;
  color: var(--brand-dark);
  font-weight: 700;
  line-height: 1.45;
}

.quote-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px 12mm;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 2px solid #d6e0e8;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.quote-footer a {
  color: var(--brand);
  text-decoration: none;
}

.quote-footer a:hover {
  text-decoration: underline;
}

.quote-footer strong {
  color: var(--ink);
}

.order-document-footer {
  display: grid;
  gap: 2px;
  color: #7b8796;
  line-height: 1.15;
}

.order-document-footer strong {
  color: #526273;
  font-size: 13px;
  line-height: 1.1;
}

.order-document-footer span {
  font-size: 11px;
  line-height: 1.12;
}

.quote-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 45mm;
  min-height: 34px;
  margin: 0;
  padding: 6px 10px 6px 7px;
  border: 1px solid #d6e0e8;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  color: var(--ink);
  text-align: left;
  vertical-align: middle;
  font: inherit;
  cursor: pointer;
  transform: none;
}

.quote-footer a.quote-contact-link:hover,
.quote-footer button.quote-contact-link:hover {
  border-color: var(--brand);
  text-decoration: none;
  background: #ffffff;
  transform: none;
}

.quote-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  flex: 0 0 auto;
}

.quote-contact-text {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.quote-contact-text b {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.1;
}

.quote-contact-text small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.quote-contact-link--whatsapp .quote-contact-icon {
  background: #25d366;
}

.quote-contact-link--wechat .quote-contact-icon {
  background: #07c160;
}

.quote-contact-link--email .quote-contact-icon {
  background: var(--brand);
  font-size: 14px;
}

.quote-contact-link--plain {
  box-shadow: none;
}

.quote-home-return,
.quote-home-return-first-page-mask {
  display: none;
}

.wechat-qr-dialog.hidden {
  display: none !important;
}

.wechat-qr-dialog {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wechat-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.wechat-qr-modal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.wechat-qr-modal h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.wechat-qr-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.wechat-qr-modal img {
  width: min(260px, 100%);
  height: 260px;
  margin: 4px auto 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.wechat-qr-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
  box-shadow: none;
  font-size: 20px;
}

.page-info {
  margin-left: auto;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #f5c26b;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a4b05;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(154, 75, 5, 0.08);
}

.status-pill.saved {
  border-color: #bbdfc6;
  background: #eef8f0;
  color: #166534;
  box-shadow: 0 4px 10px rgba(22, 101, 52, 0.08);
}

.status-pill.error {
  border-color: #f7b4ad;
  background: #fff0ee;
  color: var(--danger);
  box-shadow: 0 4px 10px rgba(180, 35, 24, 0.08);
}

.translation-check {
  display: grid;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 12px;
  border: 1px solid #f5c26b;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff8ed;
  color: var(--ink);
}

.translation-check p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.export-preflight-panel {
  display: grid;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  max-height: 260px;
  overflow: auto;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
}

.export-preflight-panel.blocked {
  border-color: #f3b1a9;
  border-left-color: var(--danger);
  background: #fff7f5;
}

.export-preflight-panel.passed {
  border-color: #b7dfc2;
  border-left-color: #21a366;
  background: #f4fbf6;
}

.export-preflight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.export-preflight-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.export-preflight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.export-preflight-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}

.export-preflight-item b {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef8f0;
  color: #166534;
  font-size: 11px;
}

.export-preflight-item.warn b {
  background: #fff0ee;
  color: var(--danger);
}

.export-preflight-item span {
  min-width: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.export-preflight-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.post-export-actions p {
  margin: 0;
}

.post-export-action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.post-export-action {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  min-height: 78px;
  padding: 10px;
  border: 1px solid #cfe3cf;
  border-radius: 8px;
  background: #ffffff;
  color: #21412c;
  text-decoration: none;
}

.post-export-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2f2e5;
  color: #1f6d33;
  font-size: 12px;
  font-weight: 900;
}

.post-export-action strong {
  color: #21412c;
  font-size: 13px;
  line-height: 1.25;
}

.post-export-action small {
  grid-column: 2;
  color: #526b55;
  font-size: 12px;
  line-height: 1.35;
}

.translation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.translation-issue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 128px;
  overflow: auto;
}

.translation-issue-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #f1d7a8;
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
}

.translation-issue-list small {
  color: var(--accent);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.admin-page {
  background: linear-gradient(180deg, #f8fbfd 0%, #eef3f6 62%, #eaf1f5 100%);
}

.admin-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.admin-login {
  max-width: 420px;
  margin: 8vh auto;
  padding: 28px;
  display: grid;
  gap: 16px;
}

.admin-login-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.admin-login .error {
  color: var(--danger);
  font-weight: 900;
}

.admin-panel {
  padding: 26px;
}

.admin-mode-banner {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 14px;
  padding: 9px 14px;
  border: 1px solid #9fc4d0;
  border-radius: 8px;
  background: #e7f4f7;
  color: #0f4c5c;
  font-size: 15px;
  font-weight: 900;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card-strong);
  box-shadow: var(--shadow-soft);
}

.admin-topbar .header-actions {
  max-width: 980px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 0;
}

.admin-card {
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.admin-card > h2,
.admin-card .section-heading h2,
.admin-collapse summary h2 {
  color: #102033;
  line-height: 1.18;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-workflow-guide {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-guide-return {
  text-decoration: none;
  white-space: nowrap;
}

.admin-workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-workflow-step {
  display: flex;
  min-width: 0;
  min-height: 118px;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border: 1px solid #d7e3ee;
  border-radius: 8px;
  background: #ffffff;
}

.admin-workflow-step strong {
  color: #102033;
  font-size: 14px;
  line-height: 1.25;
}

.admin-workflow-step span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-card-balanced {
  align-self: start;
  min-width: 0;
}

.media-storage-card {
  background: #f8fcff;
}

.media-storage-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.media-storage-steps span {
  padding: 10px 12px;
  border: 1px solid #cfdde8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand);
  font-weight: 800;
}

.media-storage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.media-storage-summary span {
  padding: 10px 12px;
  border: 1px solid #cfdde8;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
}

.media-storage-summary.warn span {
  border-color: #f4c7c7;
  background: #fff7f7;
  color: #a40000;
}

.media-storage-result {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #cfdde8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.media-storage-result.ok {
  border-color: #a7d8b2;
  background: #eef8f0;
  color: #166534;
}

.media-storage-result.warn {
  border-color: #f4c7c7;
  background: #fff1f1;
  color: #a40000;
}

.secure-media-card {
  border-color: #cfe0eb;
}

.secure-media-upload {
  margin-top: 12px;
}

.secure-media-list {
  margin-top: 16px;
  overflow-x: auto;
}

.secure-media-table {
  min-width: 980px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.secure-media-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 0.7fr) minmax(150px, 0.85fr) minmax(96px, 0.55fr) minmax(180px, 1fr) minmax(90px, 0.45fr);
  border-top: 1px solid var(--line);
}

.secure-media-row:first-child {
  border-top: 0;
}

.secure-media-row.head {
  background: #eaf4f8;
  color: var(--blue-dark);
  font-weight: 900;
}

.secure-media-row > * {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.secure-media-row > *:first-child {
  border-left: 0;
}

.secure-media-row a {
  color: var(--blue-dark);
  font-weight: 900;
  text-decoration: none;
}

.secure-media-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.recycle-bin-card {
  border-color: #d8e6ee;
}

.backup-note {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #d6e5ee;
  border-radius: 8px;
  background: #f7fbfd;
  color: var(--muted);
  font-weight: 800;
}

.backup-note strong {
  color: var(--blue-dark);
}

.recycle-bin-list {
  margin-top: 14px;
  overflow-x: auto;
}

.recycle-bin-table {
  min-width: 980px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.recycle-bin-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.45fr) minmax(220px, 1.25fr) minmax(90px, 0.45fr) minmax(150px, 0.7fr) minmax(220px, 1.2fr) minmax(92px, 0.45fr);
  border-top: 1px solid var(--line);
}

.recycle-bin-row:first-child {
  border-top: 0;
}

.recycle-bin-row.head {
  background: #eaf4f8;
  color: var(--blue-dark);
  font-weight: 900;
}

.recycle-bin-row > * {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.recycle-bin-row > *:first-child {
  border-left: 0;
}

.recycle-bin-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
  border-radius: 7px;
}

.admin-collapse summary::-webkit-details-marker {
  display: none;
}

.admin-collapse summary h2 {
  margin: 0;
}

.admin-collapse summary strong {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.admin-collapse summary:hover {
  background: var(--interactive-soft);
}

.admin-collapse[open] > summary {
  margin-bottom: 12px;
}

.admin-section-summary {
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center !important;
  padding: 10px 12px;
  background: #f5fafc;
}

.admin-section-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-section-actions button {
  min-width: 86px;
}

.company-admin-card .admin-collapse:not([open]) .admin-section-actions button,
.contact-admin-card .admin-collapse:not([open]) .admin-section-actions button {
  display: none;
}

.company-admin-card,
.contact-admin-card {
  background: #fbfdfe;
}

.company-admin-item,
.contact-admin-item {
  margin-top: 0;
}

.company-admin-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
}

.brand-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brand-media-grid h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.contact-admin-form {
  grid-template-columns: minmax(160px, 1fr) minmax(210px, 1.2fr);
}

.contact-method-panel {
  display: grid;
  gap: 8px;
}

.contact-method-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.contact-method-head button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.contact-method-list {
  display: grid;
  gap: 8px;
}

.contact-method-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.contact-method-row.wechat-contact-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.contact-method-row button {
  min-height: 38px;
  padding: 7px 10px;
}

.wechat-qr-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #b9d6e4;
  border-radius: 8px;
  background: #f7fbfd;
}

.wechat-qr-editor.hidden {
  display: none !important;
}

.wechat-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #c7dfea;
  border-radius: var(--radius);
  color: var(--brand);
  background: linear-gradient(180deg, #f7fbfd, var(--soft));
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.wechat-qr-preview {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px dashed #b9d6e4;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.wechat-qr-preview:hover,
.wechat-qr-preview.drop-ready {
  border-color: var(--brand);
  background: #eef8fc;
  box-shadow: inset 0 0 0 1px rgba(13, 95, 118, 0.08);
}

.wechat-qr-preview.empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.wechat-qr-preview img {
  width: min(168px, 100%);
  height: 168px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: var(--shadow-hairline);
}

.wechat-qr-preview .image-preview-placeholder {
  width: min(168px, 100%);
  min-height: 168px;
}

.admin-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.import-tabs {
  display: grid;
  gap: 12px;
}

.excel-drop {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 120px;
  margin: 12px 0;
  padding: 18px;
  border: 2px dashed #aac1cf;
  border-radius: 10px;
  color: var(--brand-dark);
  background: linear-gradient(180deg, #ffffff, #f5fafc);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.excel-drop:hover {
  border-color: var(--brand);
  background: #eef8fc;
  box-shadow: var(--shadow-hairline);
}

.excel-drop input {
  display: none;
}

.excel-drop span {
  color: var(--muted);
  font-size: 13px;
}

.import-status {
  min-height: 36px;
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfd;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.import-status.warn {
  border-color: #f1c27d;
  color: #b45309;
  background: #fff8ed;
}

.import-status.ok {
  border-color: #a7d8b2;
  color: #0f6b4c;
  background: #eef8f0;
}

.import-tabs textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 150px;
}

.spec-table-editor {
  padding: 12px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #f7fbfd;
}

.spec-table-editor textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 170px;
  background: #ffffff;
}

.product-spec-table-editor {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(300px, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-card);
  box-shadow: 0 8px 24px rgba(15, 72, 95, 0.06);
}

.product-spec-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-spec-editor-heading h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
}

.product-spec-editor-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-spec-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  padding: 8px;
  border: 1px solid #d2e1ea;
  border-radius: 9px;
  background: rgba(248, 251, 253, 0.96);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.product-spec-toolbar button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.product-spec-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-spec-toolbar select,
.product-spec-toolbar input[type="color"] {
  min-height: 30px;
}

.product-spec-file-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed #9dc7d8;
  border-radius: 9px;
  background: #f4fbfe;
  color: var(--brand-dark);
  cursor: pointer;
}

.product-spec-file-drop strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14px;
}

.product-spec-file-drop small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-spec-file-drop input[type="file"] {
  width: min(260px, 42%);
}

.product-spec-paste-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.product-spec-paste-tools textarea {
  min-height: 82px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.product-spec-paste-tools div {
  display: grid;
  gap: 8px;
  align-content: start;
}

.product-spec-selection-status {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.product-spec-table-scroll {
  overflow: auto;
  max-height: 70vh;
  min-height: 300px;
  border: 1px solid #d2e1ea;
  border-radius: 9px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.product-spec-grid {
  font-size: 12px;
}

.product-spec-cell-editor {
  min-height: 38px;
}

.parameter-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.parameter-import-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.parameter-import-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 72, 95, 0.06);
}

.parameter-import-card.needs-review {
  border-color: #f3bd77;
  background: #fffaf3;
}

.parameter-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.parameter-import-head h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.parameter-import-warnings {
  display: grid;
  gap: 6px;
}

.parameter-import-warnings span {
  display: block;
  padding: 8px 10px;
  border: 1px solid #f4cf97;
  border-radius: 7px;
  background: #fff7e8;
  color: #86540f;
  font-size: 13px;
  font-weight: 800;
}

.parameter-import-table-scroll {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #d2e1ea;
  border-radius: 8px;
  background: #ffffff;
}

.parameter-import-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.parameter-import-table td {
  padding: 8px 10px;
  border: 1px solid #dce8ef;
  vertical-align: top;
  color: var(--ink);
}

.config-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 260px));
  gap: 12px;
  margin: 12px 0;
}

.tech-doc-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.tech-doc-form,
.tech-doc-filters {
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card-strong);
}

.tech-doc-form h3,
.tech-doc-filters h3 {
  margin: 0 0 10px;
  color: var(--ink);
}

.tech-doc-drop {
  margin-top: 12px;
}

.tech-doc-list {
  margin-top: 14px;
}

.tech-doc-table td a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.tech-doc-table td a:hover {
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef8fb;
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 12px;
}

.table-actions {
  white-space: nowrap;
}

.bulk-classify-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 220px)) auto;
  gap: 12px;
  align-items: end;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card-strong);
}

.product-admin-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.product-select-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.product-admin-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.product-admin.collapsed .product-edit-body {
  display: none;
}

.product-photo-admin {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 12px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #f7fbfd;
}

.product-photo-admin.drop-ready {
  border-color: var(--brand);
  background: #eef8fc;
  box-shadow: inset 0 0 0 2px rgba(15, 95, 120, 0.12);
}

.product-photo-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-photo-admin-head h3 {
  margin: 0 0 4px;
}

.product-photo-upload {
  cursor: pointer;
  white-space: nowrap;
}

.product-photo-upload input {
  display: none;
}

.product-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-photo-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.product-photo-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(15, 95, 120, 0.12);
  background: #eef8fc;
}

.product-photo-card img {
  width: 100%;
  height: 170px;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.product-photo-card .image-preview-placeholder {
  width: 100%;
  min-height: 170px;
}

.product-photo-card figcaption {
  display: grid;
  gap: 2px;
  min-height: 38px;
}

.product-photo-card figcaption strong {
  color: var(--text);
}

.product-photo-card figcaption span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.product-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-photo-actions button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.product-photo-empty {
  grid-column: 1 / -1;
  min-height: 120px;
}

.media-admin-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.media-admin-preview {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.batch-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
}

#batchMediaPreview.media-admin-preview {
  grid-template-columns: 1fr;
  align-items: start;
}

#batchMediaPreview .batch-media-product {
  grid-column: 1 / -1;
}

.media-admin-thumb {
  display: grid;
  place-items: center;
  grid-column: span 4;
  min-height: 110px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.media-admin-thumb.media-small {
  grid-column: span 3;
}

.media-admin-thumb.media-large {
  grid-column: span 6;
}

.media-admin-thumb img {
  width: 100%;
  height: 100%;
  max-height: 140px;
  object-fit: contain;
}

.media-admin-thumb .image-preview-placeholder {
  width: 100%;
  min-height: 110px;
}

.media-admin-thumb img.fit-cover {
  object-fit: cover;
}

.batch-media-product {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-hairline);
}

.batch-media-head {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.batch-media-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.mini-admin-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.batch-media-head span,
.batch-media-head small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.batch-thumb {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(92px, auto) 1fr;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: grab;
}

.batch-thumb:hover {
  border-color: #a9cbd9;
  background: #f4fafc;
}

.batch-image-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.74);
  font-size: 18px;
  line-height: 1;
}

.batch-image-delete:hover {
  background: #b91c1c;
}

.batch-item-delete {
  min-height: 26px;
  padding: 3px 8px;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff5f5;
  font-size: 12px;
  justify-self: start;
  white-space: nowrap;
}

.batch-item-delete:hover {
  color: #ffffff;
  background: #b91c1c;
}

.batch-thumb[data-batch-image-target="true"] {
  cursor: grab;
}

.batch-thumb[data-batch-image-target="true"] .admin-placeholder {
  border: 1px dashed #b8c6d2;
}

.batch-thumb.drop-ready {
  border-color: var(--brand) !important;
  background: #eef8fc !important;
}

.batch-thumb.dragging {
  opacity: 0.45;
  border-color: var(--brand);
}

.batch-thumb img,
.batch-thumb .admin-placeholder {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
}

.batch-thumb.media-small img,
.batch-thumb.media-small .admin-placeholder {
  height: 76px;
}

.batch-thumb.media-small {
  grid-template-rows: auto minmax(76px, auto) 1fr;
}

.batch-thumb.media-large img,
.batch-thumb.media-large .admin-placeholder {
  height: 156px;
}

.batch-thumb.media-large {
  grid-template-rows: auto minmax(156px, auto) 1fr;
}

.batch-thumb img.fit-contain {
  object-fit: contain;
}

.batch-thumb figcaption {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}

.batch-thumb figcaption strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.batch-thumb figcaption span,
.batch-thumb figcaption small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.config-admin-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.config-admin-box h3 {
  margin: 0 0 10px;
}

.image-admin-collapse summary h3 {
  margin: 0;
}

.image-admin-collapse[open] summary {
  margin-bottom: 10px;
}

.config-drop {
  margin-top: 10px;
}

.admin-thumb {
  max-width: 160px;
  max-height: 110px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-thumb.product {
  max-width: 280px;
  max-height: 180px;
}

.admin-thumb.seal-thumb {
  max-width: 180px;
  max-height: 120px;
}

.seal-gallery .company-logo-select {
  min-height: 120px;
}

.company-logo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.company-logo-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.company-logo-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 95, 120, 0.14);
}

.company-logo-select {
  min-height: 96px;
  padding: 8px;
  border: 1px dashed #c4d1db;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.company-logo-select .image-preview-placeholder {
  min-height: 96px;
}

.company-logo-card.active .company-logo-select {
  border-style: solid;
  border-color: var(--brand);
  background: #eef8fc;
}

.company-logo-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-logo-card .small {
  padding: 6px 9px;
  font-size: 12px;
}

.admin-placeholder {
  display: grid;
  place-items: center;
  min-height: 84px;
  border: 1px dashed #b8c6d2;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 800;
}

.image-preview-placeholder {
  padding: 10px;
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.image-preview-placeholder[data-image-placeholder="failed"] {
  color: #b45309;
  border-color: #f1c27d;
  background: #fff8ed;
}

.database-summary {
  margin: 12px 0 16px;
  overflow-x: auto;
}

.database-collapse {
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.database-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.database-collapse summary::-webkit-details-marker {
  display: none;
}

.database-collapse summary span {
  font-weight: 800;
}

.database-collapse summary strong {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
}

.database-collapse .database-summary {
  margin: 0;
  padding: 0 12px 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #eef4f7;
  color: #213447;
  font-weight: 900;
}

.admin-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.field.full {
  grid-column: 1 / -1;
}

.module-order {
  display: grid;
  gap: 12px;
}

.module-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.module-row.dragging {
  opacity: 0.55;
}

.glossary-actions {
  justify-content: flex-start;
  margin: 10px 0;
}

.glossary-scan-result {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.glossary-prompt-output {
  min-height: 150px;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.glossary-candidates {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.glossary-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.glossary-candidate strong,
.glossary-candidate small {
  display: block;
}

.glossary-candidate small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  cursor: grab;
}

.module-row .order-field input {
  max-width: 110px;
}

.product-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.save-product-btn,
.delete-product-btn {
  min-width: 128px;
}

.drop-field {
  padding: 8px;
  border: 1px dashed #c4d1db;
  border-radius: 8px;
}

.batch-upload-field {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 96px;
  color: var(--brand);
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
}

.batch-upload-field span {
  font-size: 16px;
  font-weight: 900;
}

.batch-upload-field small {
  color: var(--muted);
}

.batch-upload-field input {
  display: none;
}

.quote-history-workbench {
  display: grid;
  gap: 14px;
}

.quote-history-head,
.quote-history-filter-actions,
.quote-history-result-toolbar,
.quote-history-stats-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quote-history-head h2,
.quote-history-stats-head h3,
.quote-history-status-form h3,
.quote-history-link-form h3 {
  margin: 0 0 4px;
}

.quote-history-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quote-history-kpis > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.quote-history-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-history-kpis strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-history-filter-panel,
.quote-history-stats-snapshot,
.quote-history-status-form,
.quote-history-link-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfd;
}

.quote-history-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}

.quote-history-filter-grid .field.wide {
  grid-column: span 2;
}

.quote-history-filter-actions {
  margin-top: 12px;
  justify-content: flex-start;
}

.quote-history-filter-actions button {
  max-width: 100%;
  white-space: normal;
}

.quote-history-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-collapse {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  overflow: hidden;
}

.history-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.history-collapse summary::-webkit-details-marker {
  display: none;
}

.history-collapse summary h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.history-collapse summary strong {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 900;
}

.history-count {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-collapse[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f5fafc;
}

.history-collapse .history-list {
  padding: 12px;
}

.quote-history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.quote-history-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 13px;
}

.quote-history-table th,
.quote-history-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.quote-history-table th {
  background: #eef5fb;
  color: var(--ink);
  font-weight: 900;
}

.quote-history-row.selected td {
  background: #f4fbfe;
}

.quote-history-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.link-like {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--brand);
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.link-like:hover {
  background: transparent;
  color: #0a5a70;
  transform: none;
}

.history-select-all,
.history-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.history-select-all {
  justify-self: start;
  padding: 4px 2px;
  font-size: 13px;
}

.history-select {
  flex: 0 0 auto;
}

.history-select input,
.history-select-all input {
  width: 18px;
  height: 18px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quote-history-more {
  position: relative;
}

.quote-history-more summary {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.quote-history-more summary::-webkit-details-marker {
  display: none;
}

.quote-history-more div {
  position: absolute;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 6px;
  min-width: 150px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.quote-history-more div button {
  justify-content: flex-start;
  width: 100%;
}

.quote-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #b9deea;
  border-radius: 999px;
  background: #eef9fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.quote-status-badge.won {
  border-color: #bbdfc6;
  background: #effaf2;
  color: #1f7a3a;
}

.quote-status-badge.lost,
.quote-status-badge.rejected {
  border-color: #f7b4ad;
  background: #fff4f2;
  color: var(--danger);
}

.quote-status-badge.pending_approval {
  border-color: #f5c26b;
  background: #fff8e8;
  color: #9a5500;
}

.quote-history-detail-panel {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.quote-history-detail-head,
.quote-history-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quote-history-detail-head {
  padding-bottom: 2px;
}

.quote-history-detail-head > div:first-child {
  min-width: min(100%, 260px);
}

.quote-history-detail-head-actions {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.quote-history-detail-head-actions .quote-history-detail-actions {
  justify-content: flex-end;
}

.quote-history-detail-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d9e7ee;
  border-radius: 12px;
  background: #f7fbfd;
}

.quote-history-detail-tab {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #cfe1ea;
  border-radius: 10px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 900;
}

.quote-history-detail-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(13, 111, 132, 0.14);
}

.quote-history-detail-tab-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.quote-history-detail-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
}

.quote-history-next-path {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #d7e4ea;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-history-next-path strong {
  padding: 4px 7px;
  border: 1px solid #c5dbe5;
  border-radius: 999px;
  background: #ffffff;
  color: #0c5b6d;
}

.quote-history-detail-head h3,
.quote-history-log h4 {
  margin: 0 0 4px;
}

.quote-history-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.quote-history-detail-list div {
  min-width: 0;
  padding: 9px;
  border: 1px solid #e3edf3;
  border-radius: 8px;
  background: #f8fbfd;
}

.quote-history-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-history-detail-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

.quote-history-detail-panel > .quote-history-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.customer-quote-history-item > .quote-history-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.quote-history-detail-section {
  display: grid;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  border: 1px solid #d9e7ee;
  border-radius: 10px;
  background: #fbfdfe;
}

.quote-history-detail-section header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quote-history-detail-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.quote-history-detail-section header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quote-history-config-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.quote-history-config-detail-list,
.quote-history-profit-grid {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.quote-history-config-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #e3edf3;
  border-radius: 8px;
  background: #ffffff;
}

.quote-history-config-detail-card,
.quote-history-profit-card {
  border-color: #d5e5ec;
  background: #ffffff;
}

.quote-history-config-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  min-width: 0;
}

.quote-history-config-columns > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e6eef3;
  border-radius: 8px;
  background: #f8fbfd;
}

.quote-history-config-columns b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.quote-history-option-list,
.quote-history-config-columns ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.quote-history-option-list li,
.quote-history-config-columns li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-history-profit-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d5e5ec;
  border-radius: 10px;
}

.quote-history-config-card strong,
.quote-history-config-card p,
.quote-history-config-card small {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.quote-history-config-card strong {
  color: var(--ink);
}

.quote-history-config-card span,
.quote-history-config-card small {
  color: var(--muted);
}

.quote-history-detail-section .quote-history-detail-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.quote-history-detail-panel .quote-history-detail-head h3,
.quote-history-detail-panel .quote-history-detail-head p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.quote-history-note {
  padding: 10px;
  border: 1px solid #f0d2a3;
  border-radius: 8px;
  background: #fffaf0;
}

.quote-history-note p {
  margin: 4px 0 0;
}

.quote-history-log {
  display: grid;
  gap: 8px;
}

.quote-history-log p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px;
  border-left: 3px solid #b9deea;
  background: #f7fbfd;
}

.quote-history-log span,
.quote-history-log small {
  color: var(--muted);
}

.quote-history-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quote-history-stats-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.quote-history-stats-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.quote-history-action-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.quote-history-status-form,
.quote-history-link-form {
  display: grid;
  gap: 10px;
  align-content: start;
}

.quote-history-integrated-stats {
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfd;
}

.quote-history-integrated-stats .admin-collapse > summary {
  min-height: 54px;
  padding: 12px 0;
  border: 0;
  background: transparent;
}

.quote-history-integrated-stats .section-heading {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.analysis-result {
  margin-top: 14px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.analysis-summary-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.analysis-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.analysis-summary-grid strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analysis-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.analysis-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.analysis-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.analysis-detail-head h3 {
  margin: 0;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analysis-table th,
.analysis-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.analysis-table th {
  background: #eef5fb;
  color: var(--ink);
}

.analysis-table .select-col {
  width: 36px;
  text-align: center;
}

.sales-dashboard-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}

.audit-log-card {
  background: #fff;
}

.audit-log-filters {
  align-items: end;
  margin-top: 12px;
}

.audit-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.audit-log-result {
  min-height: 72px;
}

.audit-log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.audit-log-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-log-table th,
.audit-log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.audit-log-table th {
  background: #eef5fb;
  color: var(--ink);
  font-weight: 800;
}

.audit-log-table code {
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.audit-log-json {
  display: grid;
  gap: 4px;
  max-width: 340px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

.audit-log-status {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid #b9deea;
  border-radius: 999px;
  background: #eef9fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.audit-log-status.archived {
  border-color: #d9e1ea;
  background: #f3f6f8;
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

.dashboard-actions {
  align-items: end;
}

.field.compact {
  min-width: 150px;
}

.field.compact input,
.field.compact select {
  min-height: 44px;
  padding: 10px 12px;
}

.sales-dashboard-result {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.dashboard-scope-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-kpi-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-kpi-grid strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-panel.wide {
  grid-column: 1 / -1;
}

.dashboard-panel h3,
.dashboard-panel h4 {
  margin: 0 0 10px;
}

.dashboard-panel h4 {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-panel ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.dashboard-panel li {
  padding-bottom: 6px;
  border-bottom: 1px solid #edf2f6;
}

.dashboard-panel li span {
  display: inline-block;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.dashboard-panel li strong {
  float: right;
  color: var(--brand);
}

.dashboard-sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-sales-table th,
.dashboard-sales-table td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dashboard-sales-table th {
  background: #eef5fb;
  color: var(--ink);
}

.sales-target-admin-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.sales-target-default-form,
.sales-target-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(110px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.sales-target-default-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sales-target-team-list {
  display: grid;
  gap: 10px;
}

.sales-target-user-row {
  padding: 10px;
  border: 1px solid #d8e4ea;
  border-left: 4px solid #7aa2b7;
  border-radius: 8px;
  background: #ffffff;
}

.sales-target-user-row.status-behind {
  border-left-color: #c47a28;
}

.sales-target-user-row.status-done {
  border-left-color: #2f7f4f;
}

.sales-target-user-row strong,
.sales-target-user-row span,
.sales-target-user-row small {
  overflow-wrap: anywhere;
}

.sales-target-user-row span,
.sales-target-user-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.sales-target-user-row label,
.sales-target-default-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sales-target-user-row label span,
.sales-target-default-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sales-target-user-row input,
.sales-target-default-form input {
  width: 100%;
  min-height: 34px;
}

@media (max-width: 1120px) {
  .app-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-group {
    flex-wrap: wrap;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .editor-panel,
  .quote-panel {
    max-height: none;
    overflow: visible;
  }

  .customer-manager-grid,
  .duplicate-alert-summary,
  .duplicate-customer-detail,
  .customer-stats,
  .customer-source-panel,
  .customer-tag-panel {
    grid-template-columns: 1fr;
  }

  .customer-list {
    max-height: none;
    min-height: 0;
  }

  .order-admin-split,
  .order-admin-workspace,
  .all-template-editors {
    grid-template-columns: 1fr;
  }

  .order-admin-workspace.template-edit-expanded {
    grid-template-columns: 1fr;
  }

  .order-admin-edit-panel {
    position: static;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-edit-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-preview-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .order-admin-preview {
    min-height: 620px;
    max-height: none;
  }

  .order-template-import-preview {
    max-height: 48vh;
  }

  .order-template-visual-editor {
    min-height: 420px;
    max-height: 58vh;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-editor,
  .order-admin-workspace.template-edit-expanded .all-template-editors {
    min-height: 520px;
    max-height: 68vh;
  }

  .order-admin-workspace.template-edit-expanded .order-template-visual-editor {
    min-height: 520px;
    max-height: 68vh;
  }

  .admin-section-summary,
  .admin-workflow-steps,
  .brand-media-grid,
  .company-admin-form,
  .contact-admin-form {
    grid-template-columns: 1fr;
  }

  .admin-workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-section-actions {
    justify-content: start;
  }

  .quote-panel {
    position: static;
  }

  .workspace,
  .customer-manager-grid,
  .order-admin-workbench,
  .quote-history-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  button:hover,
  .admin-link:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  button,
  .admin-link,
  .secondary,
  .ghost {
    max-width: 100%;
    white-space: normal;
  }

  .backend-sidebar {
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  body.backend-shell-active .admin-table,
  body.backend-shell-active .quote-history-table,
  body.backend-shell-active .dashboard-sales-table,
  body.backend-shell-active .order-stats-table {
    min-width: 720px;
  }

  .order-import-summary,
  .order-workflow-section .order-fields-grid,
  .order-document-items,
  .order-invoice-items,
  .order-packing-items {
    grid-template-columns: 1fr;
  }

  .order-checklist-items button,
  .order-actions button,
  .order-actions .admin-link {
    width: 100%;
  }

  .section-heading,
  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-heading-actions {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .quote-heading-language-slot {
    justify-content: stretch;
  }

  .quote-heading-language-slot .language-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .quote-heading-language-slot .language-tool::after {
    grid-column: 1 / -1;
  }

  .admin-shell {
    padding: 12px;
  }

  .admin-panel,
  .admin-card,
  .order-admin-workbench {
    padding: 14px;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .admin-topbar .header-actions {
    max-width: none;
  }

  .admin-workflow-guide .section-heading {
    align-items: stretch;
  }

  .admin-guide-return {
    width: 100%;
    justify-content: center;
  }

  .admin-workflow-steps {
    grid-template-columns: 1fr;
  }

  .app-header {
    padding: 12px;
  }

  .brand-header {
    min-width: 0;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .edit-mode-tabs {
    grid-template-columns: 1fr;
  }

  .customer-combined-inputs {
    grid-template-columns: 1fr;
  }

  .customer-address-inline-field,
  .customer-country-inline-field {
    grid-column: 1 / -1;
  }

  .order-admin-preview {
    min-height: 360px;
    max-height: 58vh;
    padding: 18px;
  }

  .order-admin-editor,
  .all-template-editors {
    max-height: 54vh;
  }

  .order-template-visual-editor {
    max-height: 54vh;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-edit-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-preview-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .order-admin-workspace.template-edit-expanded .order-admin-editor,
  .order-admin-workspace.template-edit-expanded .all-template-editors,
  .order-admin-workspace.template-edit-expanded .order-template-visual-editor {
    min-height: 440px;
    max-height: 62vh;
  }

  .order-template-preview-button {
    width: 100%;
  }

  .order-template-preview-dialog {
    padding: 10px;
  }

  .order-template-preview-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .order-template-preview-head {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .order-template-preview-head h2 {
    font-size: 18px;
  }

  .order-template-preview-head button {
    width: 100%;
  }

  .order-template-preview-scroll {
    padding: 10px;
  }

  .order-template-preview-sheet {
    width: 100%;
    min-height: 68vh;
    overflow: auto;
  }

  .order-template-import-panel,
  .order-admin-edit-pane {
    padding: 12px;
  }

  .order-template-import-preview,
  .template-import-preview-sheet {
    max-height: 48vh;
  }

  .template-visual-edit-tabs {
    grid-template-columns: 1fr;
  }

  .template-import-card-head,
  .template-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .template-import-actions button,
  .template-placeholder-bar button {
    width: 100%;
  }

  .order-document-parties {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .header-group {
    align-items: stretch;
    justify-content: flex-start;
  }

  .header-actions {
    gap: 12px;
  }

  .header-group {
    width: 100%;
    gap: 8px;
    padding: 8px;
  }

  .header-group .field,
  .header-group .field.compact {
    width: 100%;
    min-width: 0;
  }

  .header-group select {
    width: 100%;
  }

  .header-group button,
  .header-group .admin-link,
  .header-more-actions,
  .header-more-actions summary {
    width: 100%;
  }

  .header-more-menu {
    left: 0;
    right: auto;
    width: 100%;
    top: calc(100% + 6px);
    z-index: 40;
  }

  .preview-toolbar .status-pill {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
  }

  .customer-list-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .customer-list-toolbar .muted,
  .customer-list-toolbar .danger {
    justify-self: stretch;
  }

  body.customer-management-mode .customer-list-panel,
  body.customer-management-mode .customer-detail-panel {
    max-height: none;
    overflow: visible;
  }

  .customer-overview-bar .customer-stats,
  .customer-filter-primary,
  .customer-advanced-filters .form-grid,
  .customer-detail-summary,
  .customer-detail-summary dl {
    grid-template-columns: 1fr;
  }

  .customer-detail-nav {
    position: static;
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow: hidden;
  }

  .customer-detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    overscroll-behavior-x: contain;
  }

  .customer-detail-tabs button {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .customer-detail-save-status {
    flex: 1 1 auto;
  }

  .customer-status-summary,
  .customer-quick-actions,
  .quote-wizard-summary,
  .order-status-summary,
  .order-import-summary {
    grid-template-columns: 1fr;
  }

  .customer-detail-nav .customer-quick-actions {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .quote-history-workbench,
  .quote-history-filter-grid,
  .quote-history-detail-grid {
    grid-template-columns: 1fr;
  }

  .quote-history-kpis,
  .quote-history-stats-grid,
  .quote-history-action-panels,
  .quote-history-detail-list {
    grid-template-columns: 1fr;
  }

  .quote-history-head,
  .quote-history-filter-actions,
  .quote-history-detail-head,
  .quote-history-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-history-head .header-actions,
  .quote-history-filter-actions button,
  .quote-history-detail-actions button,
  .quote-history-detail-actions a,
  .quote-history-status-form button,
  .quote-history-link-form button {
    width: 100%;
  }

  .order-workflow-section {
    padding: 12px;
  }

  .order-checklist-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-checklist-items {
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-action-bar,
  .quote-wizard-actions {
    position: static;
  }

  .order-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .order-actions button,
  .order-actions .admin-link {
    width: 100%;
    white-space: normal;
  }

  .order-actions #orderExportAllBtn {
    margin-left: 0;
  }

  .customer-followup-section-head,
  .follow-workflow-card,
  .customer-follow-entry-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .follow-workflow-meta {
    grid-template-columns: 1fr;
  }

  .customer-followup-section-head button,
  .customer-follow-entry-actions,
  .customer-follow-entry-actions button {
    width: 100%;
  }

  .customer-follow-entry-actions {
    justify-content: stretch;
  }

  .customer-website-row,
  .customer-contact-row,
  .customer-meeting-row,
  .customer-follow-row,
  .customer-manual-quote-row {
    grid-template-columns: 1fr;
  }

  .admin-section-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .admin-section-actions button {
    width: 100%;
  }

  .field.compact {
    min-width: min(100%, 160px);
  }

  .workspace {
    padding: 10px;
  }

  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .form-grid.five,
  .config-layout,
  .config-gallery,
  .config-image-grid,
  .config-text-list,
  .media-gallery,
  .batch-media-grid,
  .profit-analysis,
  .summary-grid,
  .analysis-summary-grid,
  .analysis-grid,
  .quote-head,
  .terms-list {
    grid-template-columns: 1fr;
  }

  .custom-item {
    grid-template-columns: 1fr 1fr;
  }

  .quote-items-summary,
  .quote-item-row {
    grid-template-columns: 1fr;
  }

  .pricing-summary-grid {
    grid-template-columns: 1fr;
  }

  .quote-pricing-head,
  .pricing-section-head {
    display: grid;
  }

  .quote-pricing-actions {
    align-items: stretch;
  }

  .quote-pricing-actions button,
  .quote-pricing-actions .checkbox-field {
    flex: 1 1 150px;
  }

  .quote-pricing-matrix,
  .pricing-section {
    padding: 12px;
  }

  .quote-item-actions {
    justify-content: stretch;
  }

  .quote-item-actions button {
    flex: 1 1 120px;
  }

  .quote-company-details,
  .quote-title-block {
    grid-column: 1;
    grid-row: auto;
    text-align: center;
    justify-content: center;
  }

  .quote-brand {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(84px, 112px) minmax(0, 1fr);
    text-align: center;
    min-height: 58px;
    padding: 0;
    column-gap: 10px;
  }

  .quote-logo {
    --quote-logo-width: 96px;
    --quote-logo-height: 54px;
  }

  .quote-logo.logo-ultrawide,
  .quote-logo.logo-wide {
    --quote-logo-width: 106px;
    --quote-logo-height: 48px;
  }

  .quote-logo.logo-square {
    --quote-logo-width: 56px;
    --quote-logo-height: 56px;
  }

  .quote-logo.logo-tall {
    --quote-logo-width: 48px;
    --quote-logo-height: 62px;
  }

  .quote-brand > div:not(.quote-logo) {
    grid-column: 2;
  }

  .quote-brand.quote-brand-no-logo > div:not(.quote-logo) {
    grid-column: 1;
  }

  .company-title {
    white-space: normal;
  }

  .quote-sheet {
    width: 100%;
    min-width: 0;
    padding: 20px 14px;
    font-size: 12px;
  }

  .quote-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quote-table {
    min-width: 620px;
  }

  .quote-table th,
  .quote-table td {
    padding: 8px 9px;
  }

  .buyer-strip {
    grid-template-columns: 1fr;
  }

  .config-image-grid,
  .media-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-image-grid .config-card,
  .config-image-grid .config-card.media-small,
  .media-gallery figure,
  .media-gallery figure.media-small {
    grid-column: span 1;
  }

  .config-image-grid .config-card.media-large,
  .media-gallery figure.media-large {
    grid-column: 1 / -1;
  }
}

/* Backend operations polish v2 */
body.backend-shell-active:not(.public-site) {
  --ops-panel-gap: 14px;
  --ops-section-gap: 16px;
  --ops-card-shadow: 0 10px 26px rgba(18, 49, 68, 0.055);
}

body.backend-shell-active:not(.public-site) .backend-main {
  background:
    linear-gradient(180deg, rgba(238, 248, 251, 0.78), rgba(247, 250, 252, 0.94) 260px),
    var(--backend-bg);
}

body.backend-shell-active:not(.public-site) .backend-content {
  gap: var(--ops-section-gap);
}

body.backend-shell-active:not(.public-site) .section-heading:not(.small),
body.backend-shell-active:not(.public-site) .admin-card > .section-heading:first-child,
body.backend-shell-active:not(.public-site) .customer-management-panel > .section-heading:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 18px 20px;
  border: 1px solid var(--backend-line);
  border-radius: var(--backend-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--ops-card-shadow);
}

body.backend-shell-active:not(.public-site) .section-heading:not(.small) > *,
body.backend-shell-active:not(.public-site) .admin-card > .section-heading:first-child > *,
body.backend-shell-active:not(.public-site) .customer-management-panel > .section-heading:first-child > * {
  min-width: 0;
}

body.backend-shell-active:not(.public-site) .section-heading:not(.small) h2,
body.backend-shell-active:not(.public-site) .admin-card > h2:first-child,
body.backend-shell-active:not(.public-site) .admin-card .section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

body.backend-shell-active:not(.public-site) .section-heading:not(.small) .muted,
body.backend-shell-active:not(.public-site) .admin-card > .section-heading:first-child p,
body.backend-shell-active:not(.public-site) .customer-management-panel > .section-heading:first-child p {
  max-width: 760px;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

body.backend-shell-active:not(.public-site) .quick-actions,
body.backend-shell-active:not(.public-site) .dashboard-actions,
body.backend-shell-active:not(.public-site) .admin-section-actions,
body.backend-shell-active:not(.public-site) .customer-quick-actions,
body.backend-shell-active:not(.public-site) .quote-wizard-actions {
  gap: 8px;
}

body.backend-shell-active:not(.public-site) button,
body.backend-shell-active:not(.public-site) .button,
body.backend-shell-active:not(.public-site) .secondary,
body.backend-shell-active:not(.public-site) .ghost {
  min-height: 38px;
  border-radius: 8px;
}

body.backend-shell-active:not(.public-site) button.primary,
body.backend-shell-active:not(.public-site) .primary,
body.backend-shell-active:not(.public-site) .customer-quick-actions .primary {
  box-shadow: 0 8px 18px rgba(14, 116, 139, 0.16);
}

body.backend-shell-active:not(.public-site) .danger,
body.backend-shell-active:not(.public-site) .danger-btn,
body.backend-shell-active:not(.public-site) button.danger {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff4f2;
  color: #b42318;
}

body.backend-shell-active:not(.public-site) .field > span,
body.backend-shell-active:not(.public-site) .field > label,
body.backend-shell-active:not(.public-site) .form-grid > label > span {
  font-size: 12px;
  color: var(--ink-soft);
}

body.backend-shell-active:not(.public-site) .admin-card,
body.backend-shell-active:not(.public-site) .workbench-panel,
body.backend-shell-active:not(.public-site) .customer-list-panel,
body.backend-shell-active:not(.public-site) .customer-detail-panel,
body.backend-shell-active:not(.public-site) .order-status-summary,
body.backend-shell-active:not(.public-site) .quote-history-workbench,
body.backend-shell-active:not(.public-site) .sales-dashboard-card,
body.backend-shell-active:not(.public-site) .order-stats-card {
  border-color: var(--backend-line);
  border-radius: 10px;
  box-shadow: var(--ops-card-shadow);
}

/* Backend overflow guard: keep cards, tables, toolbars, and floating notices inside their module columns. */
body.backend-shell-active:not(.public-site) .admin-card,
body.backend-shell-active:not(.public-site) .workbench-panel,
body.backend-shell-active:not(.public-site) .customer-list-panel,
body.backend-shell-active:not(.public-site) .customer-detail-panel,
body.backend-shell-active:not(.public-site) .customer-management-panel,
body.backend-shell-active:not(.public-site) .quote-history-workbench,
body.backend-shell-active:not(.public-site) .order-panel,
body.backend-shell-active:not(.public-site) .order-stats-card,
body.backend-shell-active:not(.public-site) .sales-dashboard-card,
body.backend-shell-active:not(.public-site) .temporary-product-panel,
body.backend-shell-active:not(.public-site) .quote-wizard,
body.backend-shell-active:not(.public-site) .backend-main {
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .quote-history-table-wrap,
body.backend-shell-active:not(.public-site) .order-stats-table-wrap,
body.backend-shell-active:not(.public-site) .product-spec-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

body.backend-shell-active:not(.public-site) .workbench-panel,
body.backend-shell-active:not(.public-site) .customer-card,
body.backend-shell-active:not(.public-site) .quote-history-detail-card,
body.backend-shell-active:not(.public-site) .order-stats-card,
body.backend-shell-active:not(.public-site) .order-stats-rankings li,
body.backend-shell-active:not(.public-site) .spec-toolbar-group,
body.backend-shell-active:not(.public-site) .product-spec-toolbar-group {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.backend-shell-active:not(.public-site) .backend-ops-home {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-dashboard-hero {
  order: 1;
  padding: 16px 18px;
  border: 1px solid var(--backend-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--ops-card-shadow);
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-dashboard-hero h2 {
  margin: 2px 0 5px;
  font-size: clamp(24px, 2.2vw, 34px);
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-path-panel {
  order: 2;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-opportunity-panel {
  order: 3;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-main-grid:first-of-type {
  order: 4;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-resume-panel {
  order: 5;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-stats-toolbar {
  order: 6;
}

body.backend-shell-active:not(.public-site) .backend-ops-home #workbenchKpiGrid {
  order: 7;
}

body.backend-shell-active:not(.public-site) .backend-ops-home #workbenchRankingPanel {
  order: 8;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-panel[aria-label="我的客户资产"] {
  order: 9;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-main-grid:nth-of-type(2) {
  order: 10;
}

body.backend-shell-active:not(.public-site) .backend-ops-home .workbench-panel[aria-label="高频业务入口"] {
  order: 11;
}

body.backend-shell-active:not(.public-site) .workbench-panel {
  padding: 16px;
}

body.backend-shell-active:not(.public-site) .workbench-panel-head {
  align-items: start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--backend-line);
}

body.backend-shell-active:not(.public-site) .workbench-panel-head h3 {
  margin: 0;
  font-size: 18px;
}

body.backend-shell-active:not(.public-site) .workbench-main-grid {
  gap: 12px;
}

body.backend-shell-active:not(.public-site) .workbench-todo-form {
  grid-template-columns: minmax(120px, 0.7fr) minmax(150px, 0.8fr) minmax(260px, 1.5fr) auto;
  gap: 8px;
  align-items: end;
}

body.backend-shell-active:not(.public-site) .workbench-kpi-grid {
  gap: 8px;
}

body.backend-shell-active:not(.public-site) .workbench-kpi-card {
  min-height: 86px;
  padding: 12px;
}

body.backend-shell-active:not(.public-site) .workbench-kpi-card strong {
  font-size: 21px;
}

body.backend-shell-active:not(.public-site) .workbench-dashboard-controls {
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--backend-panel-muted);
}

body.backend-shell-active:not(.public-site) .workbench-path-actions,
body.backend-shell-active:not(.public-site) .workbench-quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

/* Backend layout safety patch: display-only guards for narrow screens, zoom, long names, and floating panels. */
body.backend-shell-active:not(.public-site) {
  overflow-x: clip;
}

body.backend-shell-active:not(.public-site) .backend-topbar,
body.backend-shell-active:not(.public-site) .backend-topbar-main,
body.backend-shell-active:not(.public-site) .backend-topbar-actions,
body.backend-shell-active:not(.public-site) .backend-legacy-actions-slot,
body.backend-shell-active:not(.public-site) .backend-legacy-actions-slot .header-actions,
body.backend-shell-active:not(.public-site) .section-heading,
body.backend-shell-active:not(.public-site) .workbench-panel-head,
body.backend-shell-active:not(.public-site) .product-admin-head,
body.backend-shell-active:not(.public-site) .history-actions,
body.backend-shell-active:not(.public-site) .table-actions {
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .backend-topbar-actions,
body.backend-shell-active:not(.public-site) .backend-legacy-actions-slot .header-actions,
body.backend-shell-active:not(.public-site) .history-actions,
body.backend-shell-active:not(.public-site) .table-actions {
  flex-wrap: wrap;
}

body.backend-shell-active:not(.public-site) .table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: normal;
}

body.backend-shell-active:not(.public-site) .table-actions button,
body.backend-shell-active:not(.public-site) .table-actions .secondary,
body.backend-shell-active:not(.public-site) .table-actions .admin-link,
body.backend-shell-active:not(.public-site) .history-actions button,
body.backend-shell-active:not(.public-site) .history-actions .secondary,
body.backend-shell-active:not(.public-site) .history-actions .admin-link {
  max-width: 100%;
  white-space: normal;
}

body.backend-shell-active:not(.public-site) .status-pill,
body.backend-shell-active:not(.public-site) .approval-status,
body.backend-shell-active:not(.public-site) .quote-status-badge,
body.backend-shell-active:not(.public-site) .audit-log-status,
body.backend-shell-active:not(.public-site) .backend-status-label {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

body.backend-shell-active:not(.public-site) .admin-table td,
body.backend-shell-active:not(.public-site) .quote-history-table td,
body.backend-shell-active:not(.public-site) .analysis-table td,
body.backend-shell-active:not(.public-site) .dashboard-sales-table td,
body.backend-shell-active:not(.public-site) .order-stats-table td,
body.backend-shell-active:not(.public-site) .audit-log-table td,
body.backend-shell-active:not(.public-site) .secure-media-table,
body.backend-shell-active:not(.public-site) .recycle-bin-table,
body.backend-shell-active:not(.public-site) .quotation-link-table,
body.backend-shell-active:not(.public-site) .customer-media-gallery,
body.backend-shell-active:not(.public-site) .customer-file-list,
body.backend-shell-active:not(.public-site) .technical-documents-center {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.backend-shell-active:not(.public-site) .admin-table-wrap,
body.backend-shell-active:not(.public-site) .responsive-table-shell,
body.backend-shell-active:not(.public-site) .analysis-table-wrap,
body.backend-shell-active:not(.public-site) .quote-history-table-wrap,
body.backend-shell-active:not(.public-site) .order-stats-table-wrap,
body.backend-shell-active:not(.public-site) .audit-log-table-wrap,
body.backend-shell-active:not(.public-site) .parameter-import-table-scroll,
body.backend-shell-active:not(.public-site) .product-spec-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.backend-shell-active:not(.public-site) .field,
body.backend-shell-active:not(.public-site) .form-grid,
body.backend-shell-active:not(.public-site) .customer-media-workbench,
body.backend-shell-active:not(.public-site) .customer-commerce-upload,
body.backend-shell-active:not(.public-site) .excel-drop,
body.backend-shell-active:not(.public-site) .tech-doc-drop,
body.backend-shell-active:not(.public-site) .file-drop-zone,
body.backend-shell-active:not(.public-site) .batch-upload-field,
body.backend-shell-active:not(.public-site) .image-upload,
body.backend-shell-active:not(.public-site) .product-photo-upload {
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .field > span,
body.backend-shell-active:not(.public-site) label > span,
body.backend-shell-active:not(.public-site) .muted,
body.backend-shell-active:not(.public-site) small,
body.backend-shell-active:not(.public-site) strong,
body.backend-shell-active:not(.public-site) em,
body.backend-shell-active:not(.public-site) b {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.backend-shell-active:not(.public-site) input,
body.backend-shell-active:not(.public-site) select,
body.backend-shell-active:not(.public-site) textarea,
body.backend-shell-active:not(.public-site) button,
body.backend-shell-active:not(.public-site) .admin-link,
body.backend-shell-active:not(.public-site) .secondary,
body.backend-shell-active:not(.public-site) .ghost {
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .backend-search-results,
body.backend-shell-active:not(.public-site) .header-more-menu,
body.backend-shell-active:not(.public-site) .quote-history-more div,
body.backend-shell-active:not(.public-site) .field-quick-results,
body.backend-shell-active:not(.public-site) .customer-lookup-panel {
  z-index: 120;
  max-width: min(520px, calc(100vw - 32px));
  overflow-wrap: anywhere;
}

body.backend-shell-active:not(.public-site) .quote-history-more[open] {
  z-index: 121;
}

body.backend-shell-active:not(.public-site) .quote-history-more div {
  max-height: min(360px, calc(100vh - 160px));
  overflow: auto;
}

.shared-login-overlay,
.wechat-qr-dialog {
  overflow: auto;
  align-items: start;
  padding-block: min(32px, 5vh);
}

.shared-login-card,
.wechat-qr-modal {
  max-height: min(82vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
}

.shared-login-card form,
.shared-login-card .login-actions {
  min-width: 0;
}

.wechat-qr-modal img {
  height: min(260px, 46vh);
}

@media (max-width: 1024px) {
  body.backend-shell-active:not(.public-site) .admin-shell,
  body.backend-shell-active:not(.public-site) .workspace {
    width: 100%;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .backend-topbar {
    max-height: 42vh;
    overflow: visible;
  }

  body.backend-shell-active:not(.public-site) .backend-topbar-main,
  body.backend-shell-active:not(.public-site) .product-admin-head,
  body.backend-shell-active:not(.public-site) .bulk-classify-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  body.backend-shell-active:not(.public-site) .backend-topbar {
    max-height: 48vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.backend-shell-active:not(.public-site) .backend-search-results {
    top: min(142px, 24vh);
    max-height: calc(100vh - 170px);
  }

  body.backend-shell-active:not(.public-site) .backend-topbar-actions,
  body.backend-shell-active:not(.public-site) .backend-legacy-actions-slot .header-actions,
  body.backend-shell-active:not(.public-site) .table-actions,
  body.backend-shell-active:not(.public-site) .history-actions {
    align-items: stretch;
    justify-content: flex-start;
  }
}

/* Layout display audit patch: display-only safeguards for overlap, overflow, scrolling, dialogs, long text, and 768px/1024px layouts. */
body.backend-shell-active:not(.public-site) .backend-sidebar,
body.backend-shell-active:not(.public-site) .backend-main,
body.backend-shell-active:not(.public-site) .workspace,
body.backend-shell-active:not(.public-site) .admin-shell {
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .admin-table-wrap,
body.backend-shell-active:not(.public-site) .quote-history-table-wrap,
body.backend-shell-active:not(.public-site) .order-stats-table-wrap,
body.backend-shell-active:not(.public-site) .customer-file-list,
body.backend-shell-active:not(.public-site) .technical-documents-center {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

body.backend-shell-active:not(.public-site) .header-actions,
body.backend-shell-active:not(.public-site) .admin-section-actions,
body.backend-shell-active:not(.public-site) .customer-commerce-actions,
body.backend-shell-active:not(.public-site) .template-import-actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .customer-commerce-file-list,
body.backend-shell-active:not(.public-site) .customer-file-records,
body.backend-shell-active:not(.public-site) .template-import-file-name,
body.backend-shell-active:not(.public-site) .media-file-name {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .file-drop-zone,
body.backend-shell-active:not(.public-site) .customer-media-drop,
body.backend-shell-active:not(.public-site) .tech-doc-drop,
body.backend-shell-active:not(.public-site) .template-import-drop {
  display: grid;
  place-items: center;
  min-height: 96px;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

body.backend-shell-active:not(.public-site) .order-template-preview-modal,
body.backend-shell-active:not(.public-site) .shared-login-card,
body.backend-shell-active:not(.public-site) .wechat-qr-modal {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 920px);
  min-height: 0;
  overflow: hidden;
}

body.backend-shell-active:not(.public-site) .order-template-preview-head,
body.backend-shell-active:not(.public-site) .template-import-card-head,
body.backend-shell-active:not(.public-site) .modal-actions {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .order-template-preview-scroll,
body.backend-shell-active:not(.public-site) .template-import-preview,
body.backend-shell-active:not(.public-site) .approval-detail-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

body.backend-shell-active:not(.public-site) .header-more-menu,
body.backend-shell-active:not(.public-site) .field-quick-results,
body.backend-shell-active:not(.public-site) .customer-lookup-panel,
body.backend-shell-active:not(.public-site) .backend-search-results {
  z-index: 180;
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
  overscroll-behavior: contain;
}

body.backend-shell-active:not(.public-site) .admin-table,
body.backend-shell-active:not(.public-site) .quote-history-table,
body.backend-shell-active:not(.public-site) .order-stats-table,
body.backend-shell-active:not(.public-site) .analysis-table {
  table-layout: auto;
}

body.backend-shell-active:not(.public-site) .admin-table th,
body.backend-shell-active:not(.public-site) .admin-table td,
body.backend-shell-active:not(.public-site) .quote-history-table th,
body.backend-shell-active:not(.public-site) .quote-history-table td,
body.backend-shell-active:not(.public-site) .order-stats-table th,
body.backend-shell-active:not(.public-site) .order-stats-table td,
body.backend-shell-active:not(.public-site) .analysis-table th,
body.backend-shell-active:not(.public-site) .analysis-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.backend-shell-active:not(.public-site) .customer-follow-entry-card,
body.backend-shell-active:not(.public-site) .customer-meeting-row,
body.backend-shell-active:not(.public-site) .customer-follow-row,
body.backend-shell-active:not(.public-site) .customer-manual-quote-row,
body.backend-shell-active:not(.public-site) .customer-contact-row,
body.backend-shell-active:not(.public-site) .customer-website-row {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  body.backend-shell-active:not(.public-site) .admin-shell,
  body.backend-shell-active:not(.public-site) .workspace,
  body.backend-shell-active:not(.public-site) .order-admin-workspace {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site) .backend-sidebar {
    max-width: min(320px, calc(100vw - 24px));
  }

  body.backend-shell-active:not(.public-site) .order-admin-preview,
  body.backend-shell-active:not(.public-site) .quote-panel,
  body.backend-shell-active:not(.public-site) .editor-panel {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body.backend-shell-active:not(.public-site) .admin-table,
  body.backend-shell-active:not(.public-site) .quote-history-table,
  body.backend-shell-active:not(.public-site) .order-stats-table,
  body.backend-shell-active:not(.public-site) .analysis-table {
    min-width: 760px;
  }

  body.backend-shell-active:not(.public-site) .header-actions > *,
  body.backend-shell-active:not(.public-site) .table-actions > *,
  body.backend-shell-active:not(.public-site) .history-actions > * {
    flex: 1 1 min(100%, 180px);
  }

  body.backend-shell-active:not(.public-site) .header-actions,
  body.backend-shell-active:not(.public-site) .table-actions,
  body.backend-shell-active:not(.public-site) .history-actions,
  body.backend-shell-active:not(.public-site) .customer-commerce-actions,
  body.backend-shell-active:not(.public-site) .template-import-actions {
    align-items: stretch;
  }
}

body.backend-shell-active:not(.public-site) .quote-workbench-section {
  margin-bottom: 12px;
}

/* RMB statistics display patch: keep longer CNY totals readable without changing business data or table structure. */
body.backend-shell-active:not(.public-site) .quote-history-kpis > div,
body.backend-shell-active:not(.public-site) .dashboard-kpi-grid > div,
body.backend-shell-active:not(.public-site) .workbench-kpi-card,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric,
body.backend-shell-active:not(.public-site) .order-stats-kpi,
body.backend-shell-active:not(.public-site) .order-stats-analysis-card {
  min-width: 0;
}

body.backend-shell-active:not(.public-site) .quote-history-kpis strong,
body.backend-shell-active:not(.public-site) .dashboard-kpi-grid strong,
body.backend-shell-active:not(.public-site) .workbench-kpi-card strong,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric > strong,
body.backend-shell-active:not(.public-site) .order-stats-kpi strong,
body.backend-shell-active:not(.public-site) .order-stats-analysis-card > strong {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.backend-shell-active:not(.public-site) .dashboard-panel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.backend-shell-active:not(.public-site) .dashboard-panel li,
body.backend-shell-active:not(.public-site) .order-stats-analysis-card li,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric li {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.backend-shell-active:not(.public-site) .dashboard-panel li span,
body.backend-shell-active:not(.public-site) .dashboard-panel li strong,
body.backend-shell-active:not(.public-site) .order-stats-analysis-card li span,
body.backend-shell-active:not(.public-site) .order-stats-analysis-card li em,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric li strong,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric li b,
body.backend-shell-active:not(.public-site) .workbench-ranking-metric li em {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.backend-shell-active:not(.public-site) .dashboard-panel li strong {
  float: none;
  display: inline-block;
  margin-left: 8px;
}

body.backend-shell-active:not(.public-site) .analysis-table td,
body.backend-shell-active:not(.public-site) .dashboard-sales-table td,
body.backend-shell-active:not(.public-site) .order-stats-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1180px) {
  body.backend-shell-active:not(.public-site) .quote-history-kpis,
  body.backend-shell-active:not(.public-site) .dashboard-kpi-grid,
  body.backend-shell-active:not(.public-site) .workbench-kpi-grid,
  body.backend-shell-active:not(.public-site) .workbench-ranking-list,
  body.backend-shell-active:not(.public-site) .order-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.backend-shell-active:not(.public-site) .quote-history-kpis,
  body.backend-shell-active:not(.public-site) .dashboard-kpi-grid,
  body.backend-shell-active:not(.public-site) .workbench-kpi-grid,
  body.backend-shell-active:not(.public-site) .workbench-ranking-list,
  body.backend-shell-active:not(.public-site) .order-stats-kpis {
    grid-template-columns: 1fr;
  }
}

body.backend-shell-active:not(.public-site) .quote-heading-language-slot {
  max-width: 520px;
}

body.backend-shell-active:not(.public-site) .quote-wizard {
  padding: 14px;
  border-radius: 10px;
}

body.backend-shell-active:not(.public-site) .quote-wizard-progress {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 126px), 1fr));
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.backend-shell-active:not(.public-site) .quote-wizard-step {
  min-height: 46px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.25;
}

body.backend-shell-active:not(.public-site) .quote-wizard-summary {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

body.backend-shell-active:not(.public-site) .quote-wizard-actions {
  position: sticky;
  bottom: 12px;
  z-index: 9;
  padding: 10px;
  border: 1px solid var(--backend-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(18, 49, 68, 0.12);
}

body.backend-shell-active:not(.public-site) .spec-toolbar-shell,
body.backend-shell-active:not(.public-site) .product-spec-toolbar,
body.backend-shell-active:not(.public-site) .quote-spec-toolbar,
body.backend-shell-active:not(.public-site) .spec-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--backend-line);
  border-radius: 10px;
  background: var(--backend-panel-muted);
}

body.backend-shell-active:not(.public-site) .spec-toolbar-group,
body.backend-shell-active:not(.public-site) .product-spec-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(185, 212, 225, 0.68);
  border-radius: 8px;
  background: #fff;
}

body.backend-shell-active:not(.public-site) .customer-management-panel {
  gap: 14px;
}

body.backend-shell-active:not(.public-site) .customer-manager-grid {
  grid-template-columns: minmax(320px, 0.74fr) minmax(0, 1.26fr);
  gap: 14px;
  align-items: start;
}

body.backend-shell-active:not(.public-site) .customer-list-panel,
body.backend-shell-active:not(.public-site) .customer-detail-panel {
  max-height: calc(100vh - 156px);
  overflow: auto;
  overflow-x: hidden;
}

body.backend-shell-active:not(.public-site) .customer-list-panel {
  padding: 14px;
}

body.backend-shell-active:not(.public-site) .customer-detail-panel {
  padding: 14px;
}

body.backend-shell-active:not(.public-site) .customer-status-summary,
body.backend-shell-active:not(.public-site) .customer-detail-summary,
body.backend-shell-active:not(.public-site) .customer-filter-panel,
body.backend-shell-active:not(.public-site) .customer-list-toolbar {
  border-radius: 10px;
}

body.backend-shell-active:not(.public-site) .customer-detail-nav {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--backend-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(18, 49, 68, 0.07);
}

body.backend-shell-active:not(.public-site) .customer-detail-tabs {
  gap: 6px;
}

body.backend-shell-active:not(.public-site) .customer-detail-tabs button {
  min-height: 38px;
  padding: 8px 12px;
}

body.backend-shell-active:not(.public-site) .customer-detail-tab-panel {
  padding-top: 12px;
}

body.backend-shell-active:not(.public-site) .customer-photo-upload-panel,
body.backend-shell-active:not(.public-site) .customer-unified-upload-panel,
body.backend-shell-active:not(.public-site) .customer-commerce-progress-panel,
body.backend-shell-active:not(.public-site) .customer-followup-panel {
  border-radius: 10px;
  background: #fbfdfe;
}

body.backend-shell-active:not(.public-site) .quote-history-filter-panel,
body.backend-shell-active:not(.public-site) .sales-dashboard-filters,
body.backend-shell-active:not(.public-site) .order-stats-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

body.backend-shell-active:not(.public-site) .quote-history-filter-panel {
  grid-template-columns: 1fr;
  align-items: stretch;
}

body.backend-shell-active:not(.public-site) .quote-history-filter-grid,
body.backend-shell-active:not(.public-site) .quote-history-filter-actions {
  min-width: 0;
}

body.backend-shell-active:not(.public-site) .quote-history-kpi-grid,
body.backend-shell-active:not(.public-site) .sales-dashboard-kpis,
body.backend-shell-active:not(.public-site) .order-stats-kpis,
body.backend-shell-active:not(.public-site) .approval-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

body.backend-shell-active:not(.public-site) .quote-history-result-grid,
body.backend-shell-active:not(.public-site) .sales-dashboard-layout,
body.backend-shell-active:not(.public-site) .order-stats-analysis-grid {
  gap: 12px;
}

body.backend-shell-active:not(.public-site) .admin-card .empty-state,
body.backend-shell-active:not(.public-site) .workbench-empty,
body.backend-shell-active:not(.public-site) .customer-empty-state {
  padding: 18px;
  border: 1px dashed #c6dce6;
  border-radius: 10px;
  background: #f8fcfd;
  color: var(--ink-soft);
}

body.backend-shell-active:not(.public-site) .excel-drop,
body.backend-shell-active:not(.public-site) .tech-doc-drop,
body.backend-shell-active:not(.public-site) .batch-upload-field,
body.backend-shell-active:not(.public-site) .product-spec-file-drop,
body.backend-shell-active:not(.public-site) .customer-media-drop {
  min-height: 84px;
  border-width: 1px;
  background: #f8fcfd;
}

body.backend-shell-active:not(.public-site) .admin-card details.admin-collapse > summary,
body.backend-shell-active:not(.public-site) .system-settings-panel details > summary,
body.backend-shell-active:not(.public-site) .config-fold > summary {
  min-height: 46px;
  border-radius: 8px;
  background: var(--backend-panel-muted);
}

/* Split preview guard: editor and preview columns must scroll independently without painting over each other. */
body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel),
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) {
  --split-preview-scroll-height: calc(100vh - 112px);
  grid-template-columns: minmax(0, 0.92fr) minmax(520px, 1.08fr);
  align-items: stretch;
  overflow: hidden;
}

body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .editor-panel,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .editor-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
  max-height: var(--split-preview-scroll-height);
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  isolation: isolate;
}

body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .editor-panel > *,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .editor-panel > * {
  max-width: 100%;
  box-sizing: border-box;
}

body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .quote-panel,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .quote-panel {
  position: relative;
  top: auto;
  z-index: 4;
  min-width: 0;
  max-width: 100%;
  max-height: var(--split-preview-scroll-height);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .quote-wizard-actions,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .quote-wizard-actions,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .order-action-bar {
  position: static;
  z-index: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .quote-wizard-actions,
body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .quote-wizard-actions {
  margin-top: 4px;
}

@media (max-width: 1180px) {
  body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel),
  body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) {
    overflow: visible;
  }

  body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .editor-panel,
  body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .editor-panel,
  body.backend-shell-active:not(.public-site).sales-mode:is([data-quote-wizard-step="5"], [data-quote-wizard-step="6"]) .workspace:has(.quote-panel) .quote-panel,
  body.backend-shell-active:not(.public-site).order-mode .workspace:has(.quote-panel) .quote-panel {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  body.backend-shell-active:not(.public-site) .quote-wizard-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.backend-shell-active:not(.public-site) .customer-manager-grid {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site) .customer-list-panel,
  body.backend-shell-active:not(.public-site) .customer-detail-panel {
    max-height: none;
  }
}

@media (max-width: 1320px) {
  body.backend-shell-active:not(.public-site) .customer-manager-grid {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site) .customer-list-panel,
  body.backend-shell-active:not(.public-site) .customer-detail-panel {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body.backend-shell-active:not(.public-site) .section-heading:not(.small),
  body.backend-shell-active:not(.public-site) .admin-card > .section-heading:first-child,
  body.backend-shell-active:not(.public-site) .customer-management-panel > .section-heading:first-child {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  body.backend-shell-active:not(.public-site) .workbench-todo-form,
  body.backend-shell-active:not(.public-site) .workbench-stats-toolbar,
  body.backend-shell-active:not(.public-site) .workbench-dashboard-controls {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site) .quote-wizard-progress {
    grid-template-columns: 1fr 1fr;
  }

  body.backend-shell-active:not(.public-site) .quote-wizard-actions {
    position: static;
  }

  body.backend-shell-active:not(.public-site) .customer-manager-grid,
  body.backend-shell-active:not(.public-site) .quote-history-filter-panel,
  body.backend-shell-active:not(.public-site) .sales-dashboard-filters,
  body.backend-shell-active:not(.public-site) .order-stats-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .product-selection-layout,
  .product-selection-results {
    grid-template-columns: 1fr;
  }

  .product-selection-assistant > summary,
  .product-selection-card-head,
  .product-selection-actions {
    align-items: stretch;
  }

  .product-selection-assistant > summary,
  .product-selection-actions {
    flex-direction: column;
  }

  .product-selection-actions button {
    width: 100%;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  @page orderCompact {
    size: A4;
    margin: 0;
  }

  html,
  body {
    margin: 0;
    padding: 0;
  }

  body {
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-header,
  .skip-link,
  .editor-panel,
  .preview-toolbar,
  .translation-check {
    display: none !important;
  }

  .workspace {
    display: block;
    padding: 0;
    max-width: none;
  }

  .quote-panel,
  .quote-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .quote-panel {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  .quote-sheet {
    position: relative;
    box-sizing: border-box;
    min-height: 297mm;
    padding: 12mm 12mm 28mm;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 0;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .quote-sheet .order-fill-field,
  .quote-sheet .order-fill-field.missing,
  .quote-sheet.order-draft-fields .order-fill-field,
  .quote-sheet.order-draft-fields .order-fill-field.missing {
    color: inherit !important;
    text-decoration: none !important;
    background: transparent !important;
  }

  .quote-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .quote-product-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .quote-product-hero-card {
    min-height: 58mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .quote-product-hero-card img {
    max-width: 100%;
    max-height: 72mm;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
  }

  .quote-section h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .quote-section h4,
  .buyer-strip,
  .terms-list,
  .total-box,
  .quote-grouped-card,
  .quote-spec-by-model,
  .config-card,
  .media-gallery figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .config-gallery,
  .config-image-grid,
  .config-text-list,
  .media-gallery {
    break-inside: auto;
    page-break-inside: auto;
  }

  .quote-head {
    grid-template-columns: 1fr;
    margin-bottom: 14px;
  }

  .buyer-strip,
  .terms-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-brand {
    grid-template-columns: 34mm 1fr 34mm;
    column-gap: 5mm;
    min-height: 19mm;
  }

  .quote-brand.quote-brand-no-logo {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .quote-logo {
    --quote-logo-width: 34mm;
    --quote-logo-height: 15mm;
  }

  .quote-logo.logo-ultrawide {
    --quote-logo-width: 36mm;
    --quote-logo-height: 12mm;
  }

  .quote-logo.logo-wide {
    --quote-logo-width: 34mm;
    --quote-logo-height: 13mm;
  }

  .quote-logo.logo-square {
    --quote-logo-width: 17mm;
    --quote-logo-height: 17mm;
  }

  .quote-logo.logo-tall {
    --quote-logo-width: 14mm;
    --quote-logo-height: 18mm;
  }

  .company-title {
    font-size: 16px;
  }

  .quote-title {
    font-size: 25px;
  }

  .quote-footer {
    position: fixed !important;
    right: 12mm;
    bottom: 8mm;
    left: 12mm;
    z-index: 20;
    box-sizing: border-box;
    break-inside: avoid;
    margin: 0;
    padding: 4mm 0 0;
    border-top: 2px solid #d6e0e8;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5mm 8mm;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .quote-footer .quote-contact-link,
  .quote-footer a.quote-contact-link,
  .quote-footer button.quote-contact-link {
    width: 45mm;
    min-width: 45mm;
    margin: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    filter: none !important;
  }

  .quote-home-return {
    position: fixed;
    left: 12mm;
    bottom: 8mm;
    z-index: 19;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 24mm;
    min-height: 8mm;
    padding: 1.8mm 4mm;
    border: 1px solid #c7dfea;
    border-radius: 999px;
    color: #0d5f76;
    background: #eef8fc;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow: none !important;
  }

  .quote-home-return-first-page-mask {
    position: absolute;
    top: calc(297mm - 21mm);
    left: 0;
    z-index: 20;
    display: block !important;
    width: 43mm;
    height: 14mm;
    background: #ffffff;
    pointer-events: none;
  }

  .quote-sheet.order-pdf-fit {
    page: orderCompact;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 297mm;
    padding: 8mm 8mm 28mm;
    font-size: 11.2px;
    line-height: 1.25;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .quote-sheet.order-document-contract-en .quote-section,
  .quote-sheet.order-document-contract-ru .quote-section,
  .quote-sheet.order-document-contract-en .contract-clauses,
  .quote-sheet.order-document-contract-ru .contract-clauses,
  .quote-sheet.order-document-contract-en .terms-list,
  .quote-sheet.order-document-contract-ru .terms-list,
  .quote-sheet.order-document-contract-en .terms-list li,
  .quote-sheet.order-document-contract-ru .terms-list li {
    break-inside: auto;
    page-break-inside: auto;
  }

  .quote-sheet.order-document-contract-en .order-signature-section,
  .quote-sheet.order-document-contract-ru .order-signature-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .quote-sheet.order-document-contract-en .order-signature-row.seller,
  .quote-sheet.order-document-contract-ru .order-signature-row.seller {
    min-height: auto;
  }

  .quote-sheet.order-document-contract-en .order-signature-row.seller .order-seal-box,
  .quote-sheet.order-document-contract-ru .order-signature-row.seller .order-seal-box {
    position: static;
    z-index: auto;
    width: auto;
    min-height: 0;
    margin: -6px 0 0;
    transform: none;
    place-items: start;
  }

  .quote-sheet.order-document-contract-en .order-signature-row.seller .order-seal,
  .quote-sheet.order-document-contract-ru .order-signature-row.seller .order-seal {
    max-width: 56mm;
    max-height: 34mm;
  }

  .quote-sheet.order-pdf-fit .quote-head {
    gap: 3px;
    margin-bottom: 5px;
    padding: 0 0 5px;
    border-bottom-width: 1px;
  }

  .quote-sheet.order-pdf-fit .quote-brand {
    grid-template-columns: 32mm 1fr 32mm;
    column-gap: 4mm;
    min-height: 16mm;
  }

  .quote-sheet.order-pdf-fit .quote-brand.quote-brand-no-logo {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .quote-sheet.order-pdf-fit .quote-logo {
    --quote-logo-width: 32mm;
    --quote-logo-height: 14mm;
  }

  .quote-sheet.order-pdf-fit .company-title {
    margin-bottom: 2px;
    color: #4f6072;
    font-size: 14px;
    line-height: 1.08;
  }

  .quote-sheet.order-pdf-fit .company-title.company-title-short {
    font-size: 20px;
  }

  .quote-sheet.order-pdf-fit .company-title.company-title-medium {
    font-size: 16px;
  }

  .quote-sheet.order-pdf-fit .company-address-line {
    color: #7b8796;
    font-size: 10px;
    line-height: 1.12;
  }

  .quote-sheet.order-pdf-fit .quote-title {
    margin: 7px 0 8px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 0.03em;
  }

  .quote-sheet.order-pdf-fit .quote-title-block {
    width: 100%;
    text-align: center;
    justify-content: stretch;
    justify-items: stretch;
  }

  .quote-sheet.order-pdf-fit .quote-title {
    justify-self: stretch;
  }

  .quote-sheet.order-pdf-fit .quote-meta {
    gap: 1px;
    font-size: 10.5px;
  }

  .quote-sheet.order-pdf-fit .quote-meta.document-meta {
    justify-self: end;
    margin-left: auto;
    margin-right: 0;
    padding: 1px 3px;
    border-radius: 6px;
  }

  .quote-sheet.order-pdf-fit .quote-meta.document-meta div {
    column-gap: 8px;
    padding: 2px 4px;
  }

  .quote-sheet.order-pdf-fit .quote-meta.document-meta strong {
    font-size: 9.5px;
    letter-spacing: 0.03em;
  }

  .quote-sheet.order-pdf-fit .quote-meta.document-meta span {
    font-size: 14px;
  }

  .quote-sheet.order-pdf-fit .quote-section {
    margin: 5px 0;
    break-inside: auto;
    page-break-inside: auto;
  }

  .quote-sheet.order-pdf-fit .order-document-main-section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .quote-sheet.order-pdf-fit .order-document-parties {
    max-width: 48%;
    margin-top: 5px;
  }

  .quote-sheet.order-pdf-fit .order-address-card {
    gap: 1px;
    padding: 5px 8px;
    border-radius: 6px;
  }

  .quote-sheet.order-pdf-fit .order-address-card span {
    font-size: 9.5px;
    letter-spacing: 0.03em;
  }

  .quote-sheet.order-pdf-fit .order-address-card strong,
  .quote-sheet.order-pdf-fit .order-address-card p {
    font-size: 11px;
    line-height: 1.18;
  }

  .quote-sheet.order-pdf-fit .quote-table {
    font-size: 10.6px;
    line-height: 1.22;
  }

  .quote-sheet.order-pdf-fit .quote-table th,
  .quote-sheet.order-pdf-fit .quote-table td {
    padding: 4px 5px;
  }

  .quote-sheet.order-pdf-fit .total-box {
    width: 38%;
    min-width: 210px;
    margin-top: 8px;
    font-size: 10.5px;
  }

  .quote-sheet.order-pdf-fit .total-row {
    gap: 8px;
    padding: 4px 7px;
  }

  .quote-sheet.order-pdf-fit .total-row.grand {
    border-top-width: 2px;
    font-size: 13px;
  }

  .quote-sheet.order-pdf-fit .order-document-stamp {
    max-width: var(--order-document-seal-width);
    margin-top: 10mm;
    margin-bottom: 34mm;
    padding-right: 4mm;
    transform: none;
  }

  .quote-sheet.order-pdf-fit .order-document-main-section .order-document-stamp {
    margin-top: auto;
    margin-bottom: 34mm;
  }

  .quote-sheet.order-pdf-fit .order-seal.document {
    display: block;
    max-width: var(--order-document-seal-width);
    max-height: var(--order-document-seal-height);
    object-fit: contain;
  }

  .quote-sheet.order-pdf-fit .order-document-footer {
    position: static !important;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    margin-top: 4mm;
    padding-top: 6px;
    border-top-width: 1px;
    box-shadow: none !important;
  }

  .quote-sheet.order-pdf-fit .order-document-footer strong {
    font-size: 11px;
  }

  .quote-sheet.order-pdf-fit .order-document-footer span {
    font-size: 9px;
  }

  .quote-sheet.order-pdf-fit-spacious {
    font-size: 12.4px;
    line-height: 1.36;
  }

  .quote-sheet.order-pdf-fit-spacious .order-document-main-section {
    gap: 4px;
  }

  .quote-sheet.order-pdf-fit-spacious .quote-table {
    font-size: 12px;
    line-height: 1.38;
  }

  .quote-sheet.order-pdf-fit-spacious .quote-table th,
  .quote-sheet.order-pdf-fit-spacious .quote-table td {
    padding: 7px 7px;
  }

  .quote-sheet.order-pdf-fit-spacious .total-box {
    font-size: 12px;
  }

  .quote-sheet.order-pdf-fit-spacious .total-row {
    padding: 6px 9px;
  }

  .quote-sheet.order-pdf-fit-spacious .total-row.grand {
    font-size: 14.5px;
  }

  .quote-sheet.order-pdf-fit-compact {
    font-size: 11.2px;
    line-height: 1.25;
  }

  .quote-sheet.order-pdf-fit-compact .quote-table {
    font-size: 10.6px;
  }

  .quote-sheet.order-pdf-fit-compact .quote-table th,
  .quote-sheet.order-pdf-fit-compact .quote-table td {
    padding: 4px 5px;
  }

  .quote-sheet.order-pdf-fit-compact .quote-title {
    margin: 7px 0 8px;
    font-size: 24px;
  }

  .quote-sheet.order-pdf-fit-compact .order-document-stamp,
  .quote-sheet.order-pdf-fit-compact .order-seal.document {
    max-width: var(--order-document-seal-width);
    max-height: var(--order-document-seal-height);
  }

  .quote-sheet.order-pdf-fit-tight {
    font-size: 11.2px;
    line-height: 1.25;
  }

  .quote-sheet.order-pdf-fit-tight .quote-head {
    margin-bottom: 3px;
    padding-bottom: 3px;
  }

  .quote-sheet.order-pdf-fit-tight .quote-table {
    font-size: 10.6px;
    line-height: 1.22;
  }

  .quote-sheet.order-pdf-fit-tight .quote-table th,
  .quote-sheet.order-pdf-fit-tight .quote-table td {
    padding: 4px 5px;
  }

  .quote-sheet.order-pdf-fit-tight .total-row {
    padding: 4px 7px;
  }

  .quote-sheet.order-pdf-fit-tight .order-document-stamp,
  .quote-sheet.order-pdf-fit-tight .order-seal.document {
    max-width: var(--order-document-seal-width);
    max-height: var(--order-document-seal-height);
  }

  .screen-only-fee {
    display: none !important;
  }

  .config-image-grid,
  .media-gallery {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .config-text-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-image-grid .config-card {
    grid-column: span 4;
  }

  .config-image-grid .config-card.media-small {
    grid-column: span 3;
  }

  .config-image-grid .config-card.media-large {
    grid-column: span 6;
  }

  .media-gallery figure {
    grid-column: span 4;
  }

  .media-gallery figure.media-small {
    grid-column: span 3;
  }

  .media-gallery figure.media-large {
    grid-column: span 6;
  }

  .config-image {
    min-height: 86px;
  }

  .config-image img {
    max-width: 100%;
    max-height: 120px;
    object-fit: cover;
    object-position: center;
    background: #ffffff;
  }

  .config-image img.fit-contain,
  .media-gallery img.fit-contain {
    object-fit: contain;
  }

  .media-gallery img {
    max-width: 100%;
    object-position: center;
    background: #ffffff;
  }
}

.quotation-link-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbfd;
}

.quotation-link-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.quotation-link-head h3,
.quotation-link-head p {
  margin: 0;
}

.quotation-link-table {
  display: grid;
  gap: 8px;
}

.quotation-link-row {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 0.8fr 1fr 0.9fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.quotation-link-row.head {
  color: var(--primary);
  background: #eef7fb;
}

.quote-history-interaction-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.quote-history-contact-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.quote-history-contact-channels span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #d6e6ee;
  border-radius: 999px;
  background: #f8fbfd;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.quote-history-contact-channels span.active {
  border-color: #cce9d8;
  background: #effaf3;
  color: #146b3a;
}

.quote-history-interaction-badges.muted span {
  color: var(--muted);
  background: #f5f7fa;
}

.quote-history-interaction {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #d6e6ee;
  border-radius: 999px;
  background: #eef8fb;
  color: #15536a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.quote-history-interaction.downloaded,
.quote-history-interaction.inquiry {
  border-color: #d7e7c8;
  background: #f1faec;
  color: #2f6b24;
}

.quote-history-interaction.whatsapp,
.quote-history-interaction.wechat {
  border-color: #cce9d8;
  background: #effaf3;
  color: #146b3a;
}

.quote-history-visit-dynamic {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.quote-history-visit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.quote-history-visit-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.quote-visit-heat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef8fb;
  color: #15536a;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.quote-visit-heat.hot {
  background: #ffedd5;
  color: #9a3412;
}

.quote-visit-heat.downloaded,
.quote-visit-heat.repeat {
  background: #fef3c7;
  color: #8a4b12;
}

.quote-visit-heat.none {
  background: #f3f6f8;
  color: #64748b;
}

.quote-history-visit-link {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #ffffff;
}

.quote-history-visit-link > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.quote-history-visit-link dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.quote-history-visit-link dl span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #536575;
  font-size: 12px;
  font-weight: 800;
}

.quote-history-visit-link dl b {
  color: var(--muted);
  font-size: 11px;
}

.quote-history-visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-history-visit-actions span {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #d7e5dc;
  border-radius: 999px;
  background: #f4faf6;
  color: #1f5f45;
  font-size: 12px;
  font-weight: 900;
}

.quote-history-visit-timeline {
  display: grid;
  gap: 6px;
}

.quote-history-visit-timeline p {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid #edf2f5;
  color: #354656;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.quote-history-visit-timeline p span {
  color: var(--muted);
}

.quotation-access-log {
  margin-top: 14px;
}

.quotation-access-log h4 {
  margin: 0 0 10px;
}

.quotation-access-item {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 2fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.quotation-access-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.quotation-public-page {
  margin: 0;
  color: #142033;
  background: #eef4f8;
}

.quotation-public-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
}

.quotation-public-card {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid #cbd9e3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(16, 64, 86, 0.12);
}

.quotation-public-card.notice {
  max-width: 720px;
  margin: 12vh auto;
  text-align: center;
}

.quotation-public-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 2px solid #d7e1e8;
}

.quotation-public-header h1 {
  margin: 4px 0;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: 0;
}

.quotation-public-total {
  padding: 14px 18px;
  border: 1px solid #a7cfdd;
  border-radius: 10px;
  color: #0c6378;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  white-space: nowrap;
}

.quotation-public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 26px 0;
}

.quotation-public-grid > div {
  padding: 18px;
  border: 1px solid #d4e0e8;
  border-radius: 10px;
  background: #fbfdfe;
}

.quotation-public-grid h2,
.quotation-public-card h2 {
  margin: 0 0 12px;
  color: #0e6175;
}

.quotation-public-next-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 24px 0;
  padding: 18px;
  border: 1px solid #c9dce6;
  border-radius: 12px;
  background: #f6fbfd;
}

.quotation-public-next-step p {
  margin: 0;
  color: #607086;
  font-weight: 700;
  line-height: 1.55;
}

.quotation-public-sales {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: #243449;
  font-weight: 800;
}

.quotation-public-sales a,
.quotation-public-contact {
  color: #0b5f73;
  font-weight: 900;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.quotation-public-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #0b6678;
  border-radius: 10px;
  background: #0b6678;
  color: #ffffff;
  white-space: nowrap;
}

.quotation-public-review {
  display: grid;
  gap: 10px;
}

.quotation-public-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.quotation-public-review-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dce7ef;
  border-radius: 8px;
  background: #ffffff;
}

.quotation-public-review-grid span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.quotation-public-review-grid strong {
  color: #102033;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quotation-public-table-wrap {
  overflow-x: auto;
  border: 1px solid #cbd9e3;
  border-radius: 10px;
}

.quotation-public-table {
  width: 100%;
  border-collapse: collapse;
}

.quotation-public-table th,
.quotation-public-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #dce6ec;
  text-align: left;
  vertical-align: top;
}

.quotation-public-table th {
  color: #123244;
  background: #edf5f8;
}

.quotation-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.quotation-public-actions a,
.quotation-public-actions button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #a7cfdd;
  border-radius: 10px;
  color: #0b5f73;
  background: #edf8fb;
  font-weight: 800;
  text-decoration: none;
}

.customer-contact-icons,
.customer-data-badges,
.customer-contact-action-row,
.customer-asset-dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.customer-contact-icon,
.customer-data-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 6px;
  border: 1px solid #d6e1e8;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.customer-contact-icon {
  width: 26px;
}

.customer-contact-icon.active {
  border-color: #9ccfb8;
  background: #edf8f1;
  color: #166534;
}

.customer-contact-icon.missing {
  color: #94a3b8;
}

.customer-data-badge {
  padding: 3px 8px;
}

.customer-contact-status-panel {
  padding: 0;
  border: 0;
}

.customer-contact-status-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
}

.customer-contact-status-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.customer-contact-status-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.customer-contact-status-head strong {
  color: #1e293b;
}

.customer-contact-status-card p,
.customer-contact-status-card ul {
  margin: 0;
  color: #475569;
}

.customer-contact-status-head p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.customer-contact-status-card ul {
  padding-left: 18px;
}

.customer-contact-status-card li.warn {
  color: #9a3412;
}

.customer-ownership-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.customer-ownership-summary span {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-ownership-summary--compact span {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  min-height: 48px;
  font-size: 12px;
  line-height: 1.35;
}

.customer-ownership-summary--compact b {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.customer-contact-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-contact-insights span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #d9e5ea;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.customer-contact-insights span.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.customer-contact-insights span.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.customer-interaction-timeline {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #d9e5ea;
}

.customer-interaction-timeline strong {
  color: #0f172a;
}

.customer-interaction-timeline p {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  color: #475569;
  font-size: 13px;
}

.customer-interaction-timeline p span {
  flex: 0 0 auto;
  color: #64748b;
  font-weight: 800;
}

.customer-contact-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.customer-contact-meta label {
  min-width: 0;
}

.customer-contact-meta label:not(.checkbox-inline) {
  display: inline-grid;
  grid-template-columns: auto minmax(120px, 180px);
  gap: 6px;
  align-items: center;
}

.customer-contact-meta .checkbox-inline {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.customer-contact-meta select {
  min-height: 32px;
  padding: 4px 8px;
}

.quote-contact-benefit-notice {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #f8fbfc;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.quote-contact-benefit-notice span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #d7e5ea;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
}

.customer-asset-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
}

.customer-asset-card,
.customer-protection-reminder {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.customer-asset-card strong {
  font-size: 22px;
}

.customer-asset-card small,
.customer-protection-reminder small {
  color: #64748b;
}

.customer-protection-dashboard {
  margin-top: 12px;
}

.customer-interaction-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.customer-interaction-stats div {
  min-width: 0;
  padding: 9px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
}

.customer-interaction-stats span,
.customer-interaction-stats small {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.customer-interaction-stats strong {
  display: block;
  margin: 3px 0;
  color: #0f172a;
  font-size: 20px;
}

@media (max-width: 760px) {
  .public-hero,
  .public-section,
  .quotation-public-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .public-inquiry-strip {
    margin-left: 16px;
    margin-right: 16px;
  }

  .public-product-actions a,
  .quotation-public-actions a,
  .quotation-public-actions button {
    width: 100%;
  }

  .customer-status-summary,
  .customer-quick-actions,
  .quote-wizard-summary,
  .order-status-summary {
    grid-template-columns: 1fr;
  }

  .customer-contact-status-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-contact-insights span,
  .customer-contact-action-row > * {
    flex: 1 1 100%;
    justify-content: center;
  }

  .order-stats-filters,
  .order-manual-form {
    grid-template-columns: 1fr;
  }

  .order-stats-batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .order-stats-batch-toolbar .muted {
    margin-left: 0;
  }

  .order-stats-batch-toolbar button {
    width: 100%;
  }

  .order-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-stats-kpi strong {
    font-size: 16px;
  }

  .order-stats-analysis-grid,
  .order-stats-insight-grid,
  .order-stats-rankings {
    grid-template-columns: 1fr;
  }

  .spec-editor-toolbar,
  .product-spec-toolbar {
    align-items: stretch;
    overflow-x: visible;
  }

  .spec-toolbar-group,
  .spec-toolbar-group[data-spec-toolbar-group="历史"],
  .spec-toolbar-group[data-spec-toolbar-group="行列"],
  .spec-toolbar-group[data-spec-toolbar-group="单元格"],
  .spec-toolbar-group[data-spec-toolbar-group="文字样式"],
  .spec-toolbar-group[data-spec-toolbar-group="数据导入导出"] {
    flex: 1 1 100%;
  }

  .quotation-link-row,
  .quotation-access-item,
  .quote-history-visit-link dl,
  .quote-history-visit-timeline p,
  .workbench-quote-visit-card,
  .quotation-public-header,
  .quotation-public-grid,
  .quotation-public-next-step {
    grid-template-columns: 1fr;
  }

  .quotation-link-head,
  .quote-history-visit-head,
  .quotation-public-header {
    flex-direction: column;
  }

  .workbench-quote-visit-metrics,
  .workbench-quote-visit-next {
    justify-items: start;
    text-align: left;
  }

  .customer-contact-meta,
  .customer-ownership-summary,
  .customer-asset-dashboard,
  .customer-interaction-stats {
    grid-template-columns: 1fr;
  }

  .quotation-public-total {
    white-space: normal;
  }

  .quotation-public-contact {
    width: 100%;
  }

  .product-spec-table-editor {
    min-height: 420px;
    padding: 10px;
  }

  .product-spec-editor-heading {
    flex-direction: column;
  }

  .product-spec-toolbar {
    position: static;
  }

  .product-spec-file-drop {
    flex-direction: column;
    align-items: stretch;
  }

  .product-spec-file-drop input[type="file"] {
    width: 100%;
  }

  .product-spec-paste-tools {
    grid-template-columns: 1fr;
  }

  .product-spec-table-scroll {
    max-height: 62vh;
  }

  .parameter-import-head {
    flex-direction: column;
  }

  .parameter-import-table {
    min-width: 620px;
  }
}

.quote-history-deal-review-panel,
.quote-history-deal-review-card,
.customer-quote-deal-review {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 14px;
}

.deal-review-reason-list,
.deal-review-tags,
.customer-quote-deal-review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deal-review-reason-option,
.deal-review-tag,
.customer-quote-deal-review-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9e4ec;
  border-radius: 999px;
  background: #ffffff;
  color: #243746;
  font-size: 12px;
  line-height: 1.35;
  padding: 5px 9px;
}

.deal-review-insight-panel h4 {
  margin: 12px 0 8px;
  color: var(--text);
}

.deal-review-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.deal-review-insight-grid > div,
.deal-review-warning-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.deal-review-warning-list p {
  margin: 6px 0;
  color: #7a4a11;
}

.phrase-template-picker {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 32, 44, 0.36);
  overflow: auto;
}

.phrase-template-picker.hidden {
  display: none;
}

.phrase-template-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  width: min(1080px, 100%);
  max-height: min(86vh, 820px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 32, 44, 0.24);
  padding: 18px;
}

.phrase-template-panel > header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -18px -18px 0;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.phrase-template-panel > header,
.phrase-template-toolbar,
.phrase-template-actions,
.phrase-library-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.phrase-template-toolbar {
  margin: 14px 0;
  min-width: 0;
}

.phrase-template-toolbar select,
.phrase-template-toolbar input {
  min-width: 180px;
  max-width: 100%;
}

.phrase-template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.phrase-template-list,
.phrase-library-admin-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.phrase-template-card,
.phrase-library-admin-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 12px;
}

.phrase-template-card header,
.phrase-library-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.phrase-template-card header > *,
.phrase-library-admin-item > * {
  min-width: 0;
}

.phrase-template-card p,
.phrase-library-admin-item p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.phrase-template-card span,
.phrase-library-admin-item span,
.phrase-library-admin-item small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.phrase-template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.phrase-template-tags span {
  max-width: 100%;
  border: 1px solid #d9e4ec;
  border-radius: 999px;
  background: #ffffff;
  color: #243746;
  font-size: 12px;
  padding: 3px 8px;
}

.phrase-template-preview {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.phrase-template-preview pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: inherit;
}

.phrase-personal-form {
  min-width: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.phrase-personal-form .form-grid,
.phrase-library-filters,
.phrase-library-admin-card .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.phrase-personal-form label,
.phrase-library-admin-card label {
  min-width: 0;
}

.phrase-personal-form input,
.phrase-personal-form select,
.phrase-personal-form textarea,
.phrase-library-admin-card input,
.phrase-library-admin-card select,
.phrase-library-admin-card textarea {
  min-width: 0;
  max-width: 100%;
}

.phrase-template-actions,
.phrase-library-admin-actions {
  justify-content: flex-start;
}

.phrase-template-actions button,
.phrase-library-admin-actions button {
  white-space: normal;
}

.phrase-library-admin-item.global {
  border-left: 4px solid #2f8f83;
}

.phrase-library-admin-item.team {
  border-left: 4px solid #517ea8;
}

@media (max-width: 900px) {
  .phrase-library-admin-item,
  .phrase-template-card header {
    grid-template-columns: 1fr;
  }

  .phrase-library-admin-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .deal-review-insight-grid {
    grid-template-columns: 1fr;
  }

  .phrase-template-picker {
    padding: 10px;
  }

  .phrase-template-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .phrase-template-panel > header {
    margin: -14px -14px 0;
    padding: 14px;
  }

  .phrase-template-layout,
  .phrase-template-card header,
  .phrase-library-admin-item {
    grid-template-columns: 1fr;
  }

  .phrase-template-toolbar select,
  .phrase-template-toolbar input {
    width: 100%;
    min-width: 0;
  }

  .phrase-template-actions,
  .phrase-library-admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .phrase-template-actions button,
  .phrase-library-admin-actions button {
    width: 100%;
  }
}

@media print {
  .quotation-public-page {
    background: #ffffff;
  }

  .quotation-public-shell {
    width: 100%;
    margin: 0;
  }

  .quotation-public-card {
    border: 0;
    box-shadow: none;
  }

  .quotation-public-actions {
    display: none;
  }
}
