:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #202225;
  background: #f4f3ef;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1080px;
  margin: 0;
  background: #f4f3ef;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.eyebrow {
  margin-bottom: 6px;
  color: #a14b11;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.muted {
  color: #6f7378;
}

.login-shell {
  min-height: calc(100vh - 46px);
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: 420px;
  padding: 42px;
  border-top: 5px solid #ef7f2d;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(32 34 37 / 12%);
}

.login-card h1 {
  font-size: 34px;
}

.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

label {
  display: grid;
  gap: 7px;
  color: #484c50;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfd1d3;
  border-radius: 7px;
  color: #202225;
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #d7651a;
  box-shadow: 0 0 0 3px rgb(239 127 45 / 15%);
}

input:disabled {
  color: #6f7378;
  background: #f1f1ef;
}

textarea {
  resize: vertical;
}

.multi-select {
  min-height: 150px;
}

.app-shell {
  min-height: calc(100vh - 46px);
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: #fff;
  background: #25292d;
}

/* Some newer modules use app-header inside a shell instead of app-shell.
   Keep both header variants visually and structurally identical. */
.app-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 20px;
  color: #fff;
  background: #25292d;
}

.app-header .eyebrow {
  color: #f2a068;
}

.app-header .muted,
.topbar .muted {
  color: #c8cdd2;
}

.app-header .user-area,
.topbar .user-area {
  margin-left: auto;
  justify-content: flex-end;
}

.topbar .eyebrow {
  color: #f2a068;
}

.user-area,
.toolbar,
.toolbar-actions,
.detail-heading,
.detail-actions,
.dialog-heading,
.dialog-actions,
.section-heading,
.pagination {
  display: flex;
  align-items: center;
}

.user-area {
  gap: 18px;
}

.module-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-nav a {
  text-decoration: none;
}

.grouped-module-nav {
  align-items: stretch;
  gap: 6px;
}

.module-group {
  position: relative;
}

.module-group summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 7px;
  color: #fff;
  background: rgb(255 255 255 / 8%);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.app-header .module-group summary,
.topbar .module-group summary {
  color: #f7f9fb;
}

.module-group summary::-webkit-details-marker {
  display: none;
}

.module-group summary::after {
  content: "▾";
  margin-left: 7px;
  color: #b8d7f5;
  font-size: 10px;
}

.module-group.active summary,
.module-group[open] summary,
.module-group summary:hover {
  border-color: #4f8fc9;
  background: #2f6fae;
}

.module-group-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid #cfd8e2;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 35px rgb(17 39 61 / 24%);
}

.module-group:last-child .module-group-menu {
  right: 0;
  left: auto;
}

/* Shared application shell, based on the uploaded Bennos P02/P09/P10 designs. */
.has-sidebar-shell #app-view {
  padding-left: 198px;
}

.has-sidebar-shell .topbar,
.has-sidebar-shell .app-header {
  min-height: 72px;
  padding: 12px 22px;
  color: #172033;
  border-bottom: 1px solid #e4e9f0;
  background: #fff;
  box-shadow: 0 1px 8px rgb(25 45 75 / 4%);
}

.has-sidebar-shell .topbar h1,
.has-sidebar-shell .app-header h1 {
  color: #172033;
}

.has-sidebar-shell .topbar .eyebrow,
.has-sidebar-shell .app-header .eyebrow {
  color: #246ef0;
}

.has-sidebar-shell .topbar .user-copy .muted,
.has-sidebar-shell .app-header .user-copy .muted {
  color: #69758a;
}

.has-sidebar-shell .topbar .button.secondary,
.has-sidebar-shell .app-header .button.secondary {
  color: #354155;
  border-color: #d7dee8;
  background: #fff;
}

.has-sidebar-shell .grouped-module-nav {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  width: 198px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 18px 10px 28px;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 30% -5%, rgb(35 104 196 / 35%), transparent 34%),
    linear-gradient(180deg, #071a35 0%, #06152d 100%);
  box-shadow: 5px 0 22px rgb(7 26 53 / 14%);
}

.has-sidebar-shell .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 5px 18px;
  padding: 2px;
  color: #fff;
  text-decoration: none;
}

.has-sidebar-shell .sidebar-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #ff9b21, #ee6b00);
  box-shadow: 0 7px 18px rgb(237 107 0 / 24%);
  font-size: 25px;
  font-weight: 900;
}

.has-sidebar-shell .sidebar-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.has-sidebar-shell .sidebar-brand-copy strong {
  font-size: 15px;
  white-space: nowrap;
}

.has-sidebar-shell .sidebar-brand-copy small {
  margin-top: 3px;
  color: #b9c7dc;
  font-size: 11px;
}

.has-sidebar-shell .module-group {
  position: static;
}

.has-sidebar-shell .module-group summary {
  min-height: 38px;
  padding: 8px 11px;
  border-color: transparent;
  color: #d7e1f0;
  background: transparent;
  font-size: 13px;
}

.has-sidebar-shell .module-group summary::after {
  margin-left: auto;
  color: #8ea2bf;
}

.has-sidebar-shell .module-group.active summary,
.has-sidebar-shell .module-group[open] summary,
.has-sidebar-shell .module-group summary:hover {
  color: #fff;
  border-color: rgb(255 255 255 / 6%);
  background: rgb(255 255 255 / 8%);
}

.has-sidebar-shell .module-group-menu {
  position: static;
  min-width: 0;
  gap: 2px;
  margin: 2px 0 7px;
  padding: 3px 0 3px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.has-sidebar-shell .module-group-menu a {
  position: relative;
  padding: 8px 10px 8px 15px;
  color: #aebdd2;
  border-radius: 7px;
  font-size: 12px;
}

.has-sidebar-shell .module-group-menu a::before {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #657b99;
  content: "";
  transform: translateY(-50%);
}

.has-sidebar-shell .module-group-menu a:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.has-sidebar-shell .module-group-menu a.current {
  color: #fff;
  background: linear-gradient(90deg, #135deb, #1677ff);
  box-shadow: 0 6px 16px rgb(19 93 235 / 28%);
}

.has-sidebar-shell .module-group-menu a.current::before {
  background: #fff;
}

@media (max-width: 1250px) {
  .has-sidebar-shell #app-view {
    padding-left: 176px;
  }

  .has-sidebar-shell .grouped-module-nav {
    width: 176px;
  }
}

.module-group-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #263442;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.module-group-menu a:hover,
.module-group-menu a.current {
  color: #fff;
  background: #2f6fae;
}

.product-image-library {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e0e2e4;
}

.product-image-library h4 {
  margin: 14px 0 8px;
  color: #38434d;
}

.image-upload-controls,
.customer-image-settings {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.image-upload-controls select,
.customer-image-settings select {
  width: auto;
  min-width: 150px;
}

.image-file-label {
  display: inline-flex;
  cursor: pointer;
}

.image-help {
  margin: 8px 0 12px;
  font-size: 12px;
}

.product-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.product-image-card {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d6dce2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(31 45 58 / 8%);
}

.product-image-card.inactive {
  opacity: .52;
}

.product-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #f0f2f4;
}

.product-image-card .image-preview-trigger {
  cursor: zoom-in;
}

.product-image-card figcaption {
  display: grid;
  gap: 5px;
  padding: 8px;
  font-size: 12px;
}

.image-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.image-card-actions button {
  padding: 4px 7px;
  border: 1px solid #c9d2dc;
  border-radius: 5px;
  color: #34516b;
  background: #f7fafc;
  font-size: 11px;
}

.image-origin-badge,
.image-primary-badge {
  position: absolute;
  top: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  background: rgb(37 41 45 / 82%);
  font-size: 10px;
}

.image-origin-badge { left: 7px; }
.image-primary-badge { right: 7px; background: #2f6fae; }
.image-select-control { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.image-select-control input { width: auto; }
.compact-image-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.compact-image-grid .product-image-card figcaption { display: none; }

.product-image-lightbox {
  width: min(94vw, 1400px);
  max-width: none;
  padding: 42px 18px 14px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #14171a;
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
}

.product-image-lightbox::backdrop { background: rgb(0 0 0 / 82%); }

.product-image-lightbox img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain;
}

.product-image-lightbox p {
  margin: 10px 0 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.product-image-lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / 35%);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.user-copy {
  display: grid;
  gap: 3px;
  text-align: right;
}

.user-copy .muted {
  color: #c4c7ca;
  font-size: 12px;
}

.toolbar {
  justify-content: space-between;
  gap: 24px;
  padding: 14px 20px;
  border-bottom: 1px solid #ddd9d2;
  background: #fff;
}

.toolbar p {
  margin-bottom: 0;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.product-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-search-form input {
  width: 280px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  white-space: nowrap;
}

.checkbox input {
  width: auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1.5fr) minmax(380px, 1fr);
  gap: 12px;
  padding: 12px 20px 20px;
}

.panel {
  overflow: hidden;
  border: 1px solid #dfdcd6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 14px rgb(32 34 37 / 5%);
}

.list-panel {
  align-self: start;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 7px 10px;
  color: #62666a;
  background: #f7f6f3;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 8px 10px;
  border-top: 1px solid #ece9e3;
  font-size: 13px;
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #fff5ed;
}

.code-cell {
  color: #94440f;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #52565a;
  background: #ececea;
  font-size: 12px;
  font-weight: 750;
}

.status-badge.active {
  color: #176440;
  background: #dff4e9;
}

.status-badge.draft {
  color: #855d0b;
  background: #fff1ca;
}

.status-badge.inactive {
  color: #696b6d;
  background: #e5e5e4;
}

.status-badge.blacklisted {
  color: #8f211a;
  background: #f8d9d6;
}

.status-badge.sent {
  color: #185b82;
  background: #dbeefa;
}

.status-badge.revised {
  color: #80580a;
  background: #fff0c5;
}

.status-badge.accepted {
  color: #176440;
  background: #dff4e9;
}

.status-badge.rejected,
.status-badge.expired {
  color: #8f211a;
  background: #f8d9d6;
}

.pagination {
  justify-content: flex-end;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid #ece9e3;
}

.empty-state {
  padding: 48px 24px;
  color: #777b7f;
  text-align: center;
}

.detail-panel {
  align-self: start;
  min-height: 460px;
  padding: 16px;
}

.detail-heading {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #ece9e3;
}

.detail-heading h2 {
  margin-bottom: 0;
}

.detail-list {
  margin: 8px 0 20px;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0eeea;
}

.detail-list dt {
  color: #73777b;
  font-size: 12px;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.product-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 6px;
  margin: 10px 0 16px;
}

.product-detail-fields > div {
  display: block;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #e5e7e8;
  border-radius: 8px;
  background: #fafafa;
}

.product-detail-fields > .field-medium { grid-column: span 2; }
.product-detail-fields > .field-wide { grid-column: 1 / -1; }

.product-detail-fields dt {
  margin-bottom: 2px;
  color: #7a7f83;
  font-size: 11px;
}

.product-detail-fields dd {
  font-size: 13px;
  line-height: 1.35;
}

.product-list-table th,
.product-list-table td {
  height: 34px;
  padding: 3px 7px;
  line-height: 1.25;
  white-space: nowrap;
}

.product-list-table td:not(.product-thumbnail-cell) {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-list-table .status-badge {
  min-width: 46px;
  padding: 2px 6px;
  font-size: 11px;
}

.product-thumbnail-cell {
  width: 38px;
  min-width: 38px;
  text-align: center;
}

.product-thumbnail {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 1px solid #e2e5e7;
  border-radius: 4px;
  object-fit: cover;
  background:
    linear-gradient(135deg, #f2f3f3 25%, #e7e9e9 25% 50%, #f2f3f3 50% 75%, #e7e9e9 75%);
  background-size: 8px 8px;
}

.product-thumbnail.loaded {
  background: #f2f3f3;
}

.detail-field-group {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-field-group > div {
  min-width: 0;
  padding-right: 8px;
  border-right: 1px solid #e2e4e5;
}

.detail-field-group > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.product-detail-footer {
  margin-top: 18px;
}

.column-settings-dialog {
  width: min(620px, calc(100vw - 48px));
}

.column-settings-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.column-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e1e3e4;
  border-radius: 7px;
  background: #fafafa;
}

.column-option input {
  width: auto;
}

.hs-tax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8e3ea;
  border-radius: 9px;
  background: #f6fafc;
}

.hs-code-control {
  position: relative;
  min-width: 0;
}

.hs-code-suggestions {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  width: min(420px, calc(100vw - 80px));
  min-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #c7d3dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(32 45 58 / 18%);
}

.hs-code-suggestions[hidden] {
  display: none;
}

.hs-code-suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  color: #202225;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.hs-code-suggestion:last-child {
  border-bottom: 0;
}

.hs-code-suggestion:hover,
.hs-code-suggestion:focus-visible {
  background: #fff5ec;
  outline: none;
}

.hs-code-suggestion strong {
  color: #9a4312;
  font-variant-numeric: tabular-nums;
}

.hs-code-suggestion span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hs-code-suggestion small {
  grid-column: 1 / -1;
  color: #73777b;
}

.hs-tax-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  font-size: 12px;
}

.field-hint {
  margin-left: 8px;
  color: #7a7f83;
  font-size: 11px;
  font-weight: 400;
}

.expandable-description {
  cursor: text;
}

.expandable-description:focus {
  box-shadow: 0 0 0 3px rgb(47 111 174 / 12%);
}

.description-editor-dialog {
  width: min(1100px, calc(100vw - 40px));
}

.description-editor-dialog textarea {
  width: 100%;
  min-height: min(58vh, 620px);
  resize: vertical;
  font: inherit;
  line-height: 1.6;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 9px;
}

.history-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #dfdcd6;
}

.customer-item-detail {
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid #dfdcd6;
}

.customer-item-detail .section-heading > div {
  display: grid;
  gap: 3px;
}

.customer-item-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.customer-item-table td:last-child {
  min-width: 124px;
  white-space: nowrap;
}

.customer-item-table td:last-child .button + .button {
  margin-left: 6px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.history-item {
  padding: 12px 0;
  border-bottom: 1px solid #ece9e3;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
}

.history-change {
  margin: 5px 0;
  color: #4f5357;
  font-size: 12px;
  line-height: 1.45;
}

.button {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 700;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.button.primary {
  color: #fff;
  background: #d96518;
}

.button.primary:hover:not(:disabled) {
  background: #bd5511;
}

.button.secondary {
  color: #393d40;
  border-color: #cfd1d3;
  background: #fff;
}

.button.secondary:hover:not(:disabled) {
  background: #f3f2ef;
}

.button.danger {
  color: #a02e25;
  border-color: #e2aaa5;
  background: #fff;
}

.button.success {
  color: #176440;
  border-color: #93cdb0;
  background: #fff;
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #55595d;
  background: transparent;
  font-size: 26px;
}

.icon-button:hover {
  background: #f0efec;
}

.page-error,
.form-error {
  min-height: 18px;
  margin: 0;
  color: #aa3027;
  font-size: 13px;
}

.page-error:not(:empty) {
  margin: 14px 28px 0;
  padding: 11px 14px;
  border: 1px solid #e5b6b2;
  border-radius: 7px;
  background: #fff0ef;
}

.required {
  color: #c43c2f;
}

dialog {
  width: min(900px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 28%);
}

dialog.quotation-dialog {
  width: min(1240px, calc(100vw - 48px));
}

dialog.customer-product-full-dialog {
  width: min(1120px, calc(100vw - 32px));
}

dialog.quotation-dialog form {
  padding: 16px;
}

dialog.quotation-dialog .dialog-heading {
  margin-bottom: 14px;
}

dialog.quotation-ppt-dialog {
  width: min(720px, calc(100vw - 48px));
}

dialog.quotation-columns-dialog {
  width: min(560px, calc(100vw - 48px));
}

dialog::backdrop {
  background: rgb(27 30 32 / 58%);
}

dialog form {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
}

.dialog-heading,
.dialog-actions {
  justify-content: space-between;
}

.dialog-heading {
  margin-bottom: 22px;
}

.dialog-heading h2 {
  margin-bottom: 0;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.customer-product-form-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px 10px;
}

.customer-product-form-grid > .span-2 {
  grid-column: span 2;
}

.customer-product-form-grid > .span-3 {
  grid-column: span 3;
}

.customer-product-form-grid > label {
  min-width: 0;
  gap: 5px;
}

.compact-field-help,
.package-qty-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.customer-package-editor-table {
  width: 760px;
  min-width: 760px;
  table-layout: fixed;
}

.customer-package-editor-table th,
.customer-package-editor-table td {
  padding: 4px 5px;
}

.customer-package-editor-table th:nth-child(1),
.customer-package-editor-table td:nth-child(1) { width: 54px; }
.customer-package-editor-table th:nth-child(2),
.customer-package-editor-table td:nth-child(2) { width: 48px; }
.customer-package-editor-table th:nth-child(3),
.customer-package-editor-table td:nth-child(3) { width: 104px; }
.customer-package-editor-table th:nth-child(n + 4),
.customer-package-editor-table td:nth-child(n + 4) { width: 94px; }

.customer-package-editor-table input[type="number"],
.customer-package-editor-table input[type="text"] {
  width: 100%;
  min-width: 0 !important;
  padding: 6px 7px;
}

.customer-package-editor-table input[type="checkbox"] {
  width: auto;
}

.quotation-header-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 9px 10px;
}

.quotation-header-grid > label {
  gap: 5px;
}

.field-caption {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quotation-header-grid input,
.quotation-header-grid select,
.quotation-header-grid textarea {
  padding: 7px 9px;
}

.quote-field-customer { grid-column: span 4; }
.quote-field-salesperson { grid-column: span 2; }
.quote-field-date { grid-column: span 2; }
.quote-field-currency { grid-column: span 2; }
.quote-field-incoterm { grid-column: span 2; }
.quote-field-destination { grid-column: span 3; }
.quote-field-payment { grid-column: span 7; }

.package-editor,
.package-detail {
  padding: 13px;
  border: 1px solid #deddd9;
  border-radius: 10px;
  background: #faf9f7;
}

.package-detail {
  margin: 14px 0;
}

.package-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.package-editor-heading h3,
.package-editor-heading p,
.package-detail h3 {
  margin: 0;
}

.package-editor-heading.compact {
  align-items: center;
  margin-bottom: 9px;
}

.package-editor-actions {
  display: flex;
  gap: 8px;
}

.package-editor-heading p {
  margin-top: 5px;
}

.package-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.package-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.package-table th,
.package-table td {
  padding: 6px 7px;
  border-bottom: 1px solid #deddd9;
  text-align: left;
  white-space: nowrap;
}

.package-table th {
  color: #55595d;
  background: #f1f0ed;
  font-size: 12px;
}

.package-table td {
  font-size: 13px;
}

.package-editor-table input {
  width: 104px;
  min-width: 90px;
  padding: 8px;
}

.supplier-product-table select {
  min-width: 220px;
}

.supplier-product-table input {
  min-width: 100px;
  padding: 8px;
}

.supplier-product-table .factory-code-input {
  min-width: 150px;
}

.quotation-line-table {
  min-width: 980px;
}

.quotation-line-table th,
.quotation-line-table td {
  padding: 5px 6px;
}

.quotation-line-table td:first-child {
  width: 260px;
  vertical-align: top;
}

.quotation-line-table .quote-product-code {
  min-width: 0;
  flex: 1;
}

.quote-product-picker {
  display: flex;
  min-width: 245px;
  align-items: center;
  gap: 6px;
}

.quote-product-picker .button {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.quote-custom-fields {
  display: grid;
  min-width: 330px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #d8d5c9;
  border-radius: 8px;
  gap: 8px;
  background: #f7f5ee;
  white-space: normal;
}

.quote-custom-fields[hidden] {
  display: none;
}

.quote-custom-fields label {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #55595d;
  font-size: 11px;
}

.quote-custom-fields input {
  width: 100%;
  min-width: 0;
}

.quotation-line-table input {
  padding: 7px 8px;
}

.quotation-line-table .quote-customer-code {
  min-width: 118px;
}

.quotation-line-table .quote-description {
  min-width: 330px;
  min-height: 64px;
  padding: 7px 8px;
  line-height: 1.4;
}

.quotation-line-table .quote-unit { min-width: 65px; }
.quotation-line-table .quote-unit-price { min-width: 92px; }
.quotation-line-table .quote-discount { min-width: 76px; }

.quotation-detail-table {
  min-width: 900px;
}

.quotation-detail-table th:first-child,
.quotation-detail-table td:first-child {
  min-width: 210px;
}

.quotation-detail-table [data-quote-column="description"] {
  min-width: 320px;
  max-width: 460px;
  white-space: pre-wrap;
}

.quote-product-summary strong,
.quote-product-summary span {
  display: block;
}

.quote-product-summary span {
  margin-top: 3px;
  color: #666b70;
  white-space: normal;
}

.quotation-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.quotation-column-options .checkbox {
  padding: 10px 12px;
  border: 1px solid #deddd9;
  border-radius: 8px;
  background: #faf9f7;
}

.package-editor-table output {
  display: inline-block;
  min-width: 76px;
  font-variant-numeric: tabular-nums;
}

.package-remove-button {
  padding: 7px 10px;
  font-size: 12px;
}

.package-empty-hint,
.package-empty-cell {
  padding: 16px 8px;
  text-align: center;
}

.package-table tfoot th,
.package-table tfoot td {
  border-bottom: 0;
  font-weight: 700;
}
.toast {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  max-width: 560px;
  padding: 11px 18px;
  border-radius: 8px;
  color: #fff;
  background: #2c3033;
  box-shadow: 0 8px 26px rgb(0 0 0 / 22%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: .18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #a8342b;
}

.footer {
  min-height: 46px;
  display: grid;
  place-items: center;
  color: #777b7f;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .product-search-form input {
    width: 220px;
  }

  .workspace {
    grid-template-columns: minmax(600px, 1fr) 390px;
  }

  .column-settings-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-field-customer { grid-column: span 6; }
  .quote-field-salesperson,
  .quote-field-date,
  .quote-field-currency { grid-column: span 3; }
  .quote-field-incoterm { grid-column: span 3; }
  .quote-field-destination { grid-column: span 4; }
  .quote-field-payment { grid-column: span 5; }
}

@media (max-width: 900px) {
  .customer-product-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-product-form-grid > .span-3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .customer-product-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-product-form-grid > .span-2,
  .customer-product-form-grid > .span-3 {
    grid-column: 1;
  }

  .column-settings-options,
  .hs-tax-grid,
  .detail-field-group {
    grid-template-columns: 1fr;
  }

  .product-detail-fields > .field-medium {
    grid-column: 1 / -1;
  }

  .detail-field-group > div {
    padding: 0 0 7px;
    border-right: 0;
    border-bottom: 1px solid #e2e4e5;
  }

  .detail-field-group > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .quotation-header-grid {
    grid-template-columns: 1fr;
  }

  .quotation-header-grid > label,
  .quotation-header-grid > .full {
    grid-column: 1;
  }

  .quotation-column-options {
    grid-template-columns: 1fr;
  }
}

.status-badge.confirmed {
  color: #176440;
  background: #dff4e9;
}

.status-badge.issued {
  color: #175b78;
  background: #dceff7;
}

.status-badge.cancelled {
  color: #8f211a;
  background: #f8d9d6;
}

.qc-workspace {
  grid-template-columns: minmax(640px, .9fr) minmax(620px, 1.1fr);
}

.qc-detail-panel {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.qc-report-sheet {
  color: #25292d;
  background: #fff;
}

.qc-report-heading,
.qc-file-actions,
.qc-photo-card figcaption,
.qc-upload-progress {
  display: flex;
}

.qc-report-heading {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 3px solid #ef7f2d;
}

.qc-report-heading h2 {
  margin: 0;
  font-size: 28px;
}

.qc-report-number {
  display: grid;
  gap: 5px;
  text-align: right;
}

.qc-report-number strong {
  font-size: 18px;
}

.qc-detail-list {
  grid-template-columns: 150px 1fr;
  margin-bottom: 24px;
}

.qc-issue-list {
  display: grid;
  gap: 10px;
}

.qc-issue-card {
  padding: 13px 15px;
  border-left: 4px solid #d5a537;
  border-radius: 7px;
  background: #faf8f2;
}

.qc-issue-card.critical {
  border-color: #a8342b;
  background: #fff1ef;
}

.qc-issue-card.minor {
  border-color: #71828c;
  background: #f3f6f7;
}

.qc-issue-card p:last-child {
  margin-bottom: 0;
}

.button.small {
  margin-left: 7px;
  padding: 5px 9px;
  font-size: 12px;
}

.qc-drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 24px;
  border: 2px dashed #c4c8ca;
  border-radius: 12px;
  text-align: center;
  background: #fafaf8;
  transition: .15s ease;
}

.qc-drop-zone.active {
  border-color: #ef7f2d;
  background: #fff4ec;
  box-shadow: 0 0 0 4px rgb(239 127 45 / 12%);
}

.qc-drop-zone span {
  color: #6f7378;
  font-size: 13px;
}

.qc-file-actions {
  gap: 10px;
  margin-top: 15px;
}

.file-button {
  display: inline-flex;
}

.qc-upload-meta {
  margin-top: 15px;
}

.qc-upload-progress {
  position: relative;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 7px;
  background: #e9e9e5;
}

#qc-upload-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #f0a16a;
  transition: width .15s linear;
}

#qc-upload-progress-text {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
}

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

.qc-photo-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dbddde;
  border-radius: 9px;
  background: #f3f3f1;
}

.qc-photo-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #e8e8e5;
}

.qc-photo-card img.photo-error {
  padding: 35px;
}

.qc-photo-card figcaption {
  min-height: 68px;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  font-size: 11px;
}

.qc-photo-card figcaption strong {
  overflow-wrap: anywhere;
}

.qc-photo-card figcaption span {
  color: #707478;
}

.qc-photo-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(139 33 27 / 88%);
  cursor: pointer;
}

.qc-report-sheet {
  padding: 18px;
  border: 1px solid #202020;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.qc-company-header {
  padding: 8px 12px 12px;
  color: #1f4e78;
  text-align: center;
}

.qc-company-header h2 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 2px;
}

.qc-company-header p {
  margin: 2px 0;
  font-size: 12px;
}

.qc-report-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 42%);
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 1px solid #202020;
}

.qc-report-heading h1 {
  display: grid;
  place-items: center;
  margin: 0;
  color: #1f4e78;
  font-size: 28px;
  letter-spacing: 8px;
}

.qc-report-number {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 0;
  text-align: left;
}

.qc-report-number > * {
  min-width: 0;
  padding: 8px;
  border-left: 1px solid #202020;
  border-bottom: 1px solid #202020;
}

.qc-report-number > :nth-last-child(-n + 2) {
  border-bottom: 0;
}

.qc-report-number .status-badge {
  grid-column: 1 / -1;
  justify-self: stretch;
  border-radius: 0;
  text-align: center;
}

.qc-product-heading {
  display: grid;
  grid-template-columns: 180px 1fr;
  border: 1px solid #202020;
  border-top: 0;
}

.qc-product-heading > * {
  padding: 8px 10px;
}

.qc-product-heading strong {
  border-right: 1px solid #202020;
}

.qc-detail-list {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 132px minmax(0, 1fr);
  margin: 0 0 12px;
  border-left: 1px solid #202020;
}

.qc-detail-list dt,
.qc-detail-list dd {
  margin: 0;
  padding: 8px;
  border-right: 1px solid #202020;
  border-bottom: 1px solid #202020;
  white-space: pre-wrap;
}

.qc-detail-list dt {
  color: #25292d;
  font-size: 12px;
  font-weight: 700;
  background: #f1f1f1;
}

.qc-detail-list dd {
  font-size: 12px;
  line-height: 1.45;
}

.qc-detail-list dt:nth-of-type(n + 13) {
  grid-column: 1;
}

.qc-detail-list dd:nth-of-type(n + 13) {
  grid-column: 2 / -1;
}

.qc-report-sheet .package-detail {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.qc-report-sheet .section-heading {
  min-height: 34px;
  align-items: center;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid #202020;
  border-bottom: 0;
  background: #e9edf2;
}

.qc-report-sheet .section-heading h3 {
  margin: 0;
  font-size: 14px;
}

.qc-report-sheet .package-table th,
.qc-report-sheet .package-table td,
.qc-aql-reference th,
.qc-aql-reference td {
  border: 1px solid #202020;
}

.qc-conclusion.pass { color: #176440; font-weight: 700; }
.qc-conclusion.fail { color: #9f251d; font-weight: 700; }
.qc-conclusion.observation { color: #765817; font-weight: 700; }

.qc-source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qc-source-filters select,
.qc-source-filters input {
  width: auto;
  min-width: 145px;
  max-width: 210px;
  padding: 6px 8px;
}

.qc-result-editor textarea {
  min-width: 220px;
  min-height: 48px;
  resize: vertical;
}

.qc-workspace > .list-panel { padding: 10px; }
.qc-workspace > .list-panel table { width: max-content; min-width: 100%; }
.qc-workspace > .list-panel th,
.qc-workspace > .list-panel td { height: 36px; max-width: 145px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-dialog { width: min(1320px, 97vw); }
.qc-dialog > form > .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 12px; }
.qc-dialog > form > .form-grid > .full { grid-column: 1 / -1; }
.qc-dialog input,.qc-dialog select { min-height: 36px; padding: 7px 8px; }
.qc-dialog textarea { padding: 7px 8px; }
.qc-dialog .package-editor { margin-top: 5px; padding: 10px; }
.qc-source-option-table th,.qc-source-option-table td,
.qc-measurement-editor th,.qc-measurement-editor td,
.qc-result-editor th,.qc-result-editor td { padding: 5px 6px; }
.qc-measurement-editor input,.qc-measurement-editor select { min-width: 76px; }
.qc-result-editor th:first-child,.qc-result-editor td:first-child { width: 180px; }
.qc-result-editor th:last-child,.qc-result-editor td:last-child { width: 150px; }
.qc-result-editor input[readonly] { color: var(--text); background: var(--surface-subtle); font-weight: 700; }

@media (max-width: 980px) {
  .qc-dialog > form > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.qc-photo-column-headings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #202020;
  background: #f1f1f1;
}

.qc-photo-column-headings strong {
  padding: 6px;
  text-align: center;
}

.qc-photo-column-headings strong:first-child {
  border-right: 1px solid #202020;
}

.qc-photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.qc-photo-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 260px;
  border: 1px solid #202020;
  border-top: 0;
  border-radius: 0;
  background: #fff;
}

.qc-photo-card img {
  width: 100%;
  height: 260px;
  border-right: 1px solid #202020;
  object-fit: contain;
  background: #fff;
}

.qc-photo-card figcaption {
  justify-content: center;
  min-height: 0;
  padding: 10px;
  font-size: 12px;
}

.qc-photo-category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.qc-photo-category-button.active {
  color: #1f4e78;
  border-color: #1f4e78;
  background: #e9edf2;
}

.qc-photo-category-group > h4 {
  margin: 12px 0 0;
  padding: 7px 10px;
  border: 1px solid #202020;
  color: #1f4e78;
  background: #e9edf2;
}

.qc-photo-list {
  display: grid;
}

.qc-photo-overview-group .qc-photo-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qc-photo-overview-card {
  display: block;
  min-height: 0;
  border-top: 0;
}

.qc-photo-overview-card:nth-child(even) {
  border-left: 0;
}

.qc-photo-overview-card img {
  height: 250px;
  border-right: 0;
}

.qc-photo-problem-group .qc-photo-list {
  grid-template-columns: 1fr;
}

.qc-photo-problem-card {
  grid-template-columns: 1fr 1fr;
}

.qc-photo-caption-field {
  margin-top: 8px;
}

.qc-photo-caption-field textarea {
  min-height: 92px;
  resize: vertical;
}

.qc-photo-caption-field textarea[readonly] {
  border-color: transparent;
  background: #f7f7f5;
}

.qc-photo-card figcaption code {
  margin-top: 10px;
  color: #39434b;
  overflow-wrap: anywhere;
  white-space: normal;
}

.qc-disclaimer {
  padding: 10px;
  border: 1px solid #202020;
  font-size: 11px;
}

.qc-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #202020;
  border-top: 0;
}

.qc-signatures span {
  min-height: 44px;
  padding: 12px;
  border-right: 1px solid #202020;
}

.qc-signatures span:last-child { border-right: 0; }

.qc-aql-reference {
  margin-top: 24px;
  break-before: page;
}

.qc-aql-reference h3 {
  margin: 0;
  padding: 8px;
  border: 1px solid #202020;
  text-align: center;
}

.qc-aql-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.qc-aql-tables table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  text-align: center;
}

.qc-aql-tables th,
.qc-aql-tables td { padding: 5px; }

@media print {
  @page { size: A4 portrait; margin: 11mm; }

  html, body { width: 100%; min-width: 0; background: #fff; }
  .no-print, .topbar, .app-header, .toolbar, .list-panel, .page-error, .footer { display: none !important; }
  #app-view, #qc-detail-content, .app-shell, .workspace, .detail-panel { display: block !important; }
  .has-sidebar-shell #app-view { padding-left: 0 !important; }
  #qc-detail-placeholder { display: none !important; }
  .workspace { padding: 0; }
  .detail-panel { max-height: none; padding: 0; overflow: visible; border: 0; box-shadow: none; }
  .qc-report-sheet { width: 100%; padding: 0; border: 0; font-size: 8.5pt; print-color-adjust: exact; }
  .qc-company-header h2 { font-size: 20pt; }
  .qc-report-heading h1 { font-size: 20pt; }
  .qc-report-sheet th, .qc-report-sheet td { padding: 4px 5px; white-space: normal; }
  .qc-report-sheet .package-detail, .qc-photo-card, .qc-signatures { break-inside: avoid; }
  .qc-photo-overview-card { min-height: 0; }
  .qc-photo-overview-card img { height: 58mm; }
  .qc-photo-problem-card { min-height: 72mm; }
  .qc-photo-problem-card img { height: 72mm; }
  .qc-photo-caption-field textarea { min-height: 54mm; border: 0; padding: 0; overflow: hidden; }
  .qc-aql-reference { break-before: page; }
}

@media (max-width: 760px) {
  .qc-detail-list { grid-template-columns: 110px 1fr; }
  .qc-detail-list dt:nth-of-type(n), .qc-detail-list dd:nth-of-type(n) { grid-column: auto; }
  .qc-report-heading, .qc-photo-card, .qc-aql-tables { grid-template-columns: 1fr; }
  .qc-photo-overview-group .qc-photo-list { grid-template-columns: 1fr; }
  .qc-photo-overview-card:nth-child(even) { border-left: 1px solid #202020; }
  .qc-photo-card img { border-right: 0; border-bottom: 1px solid #202020; }
}

/* Keep the A4 layout independent from the narrow-screen responsive rules. */
@media print {
  .qc-report-sheet .package-table-wrap {
    width: 100%;
    overflow: visible !important;
  }

  .qc-report-sheet .package-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .qc-report-sheet .package-table th,
  .qc-report-sheet .package-table td {
    max-width: none;
    padding: 3px 4px;
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal !important;
    word-break: break-word;
    font-size: 7.5pt;
    line-height: 1.25;
  }

  .qc-report-sheet .package-table-wrap::-webkit-scrollbar {
    display: none;
  }

  .qc-source-print-table th:nth-child(1),
  .qc-source-print-table th:nth-child(2) { width: 22%; }
  .qc-source-print-table th:nth-child(3) { width: 18%; }
  .qc-source-print-table th:nth-child(4) { width: 20%; }
  .qc-source-print-table th:nth-child(5),
  .qc-source-print-table th:nth-child(6) { width: 9%; }

  .qc-measurement-print-table th:nth-child(1) { width: 26%; }
  .qc-measurement-print-table th:nth-child(2),
  .qc-measurement-print-table th:nth-child(3),
  .qc-measurement-print-table th:nth-child(4) { width: 8%; }
  .qc-measurement-print-table th:nth-child(5),
  .qc-measurement-print-table th:nth-child(6) { width: 10%; }
  .qc-measurement-print-table th:nth-child(7) { width: 9%; }
  .qc-measurement-print-table th:nth-child(8) { width: 21%; }

  .qc-result-table th:nth-child(1) { width: 8%; }
  .qc-result-table th:nth-child(2) { width: 26%; }
  .qc-result-table th:nth-child(3) { width: 51%; }
  .qc-result-table th:nth-child(4) { width: 15%; }

  .qc-issue-list .empty-state {
    min-height: 0;
    margin: 0;
    padding: 10px;
  }

  .qc-photo-overview-group .qc-photo-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .qc-photo-overview-card {
    display: block !important;
    min-width: 0;
  }

  .qc-photo-overview-card:nth-child(even) {
    border-left: 0 !important;
  }

  .qc-photo-overview-card img {
    width: 100%;
    height: 58mm;
    border-right: 0 !important;
    border-bottom: 0 !important;
    object-fit: contain;
  }

  .qc-photo-problem-group .qc-photo-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .qc-photo-problem-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    min-height: 68mm;
  }

  .qc-photo-problem-card img {
    width: 100%;
    height: 68mm;
    border-right: 1px solid #202020 !important;
    border-bottom: 0 !important;
    object-fit: contain;
  }

  .qc-photo-problem-card figcaption {
    display: flex !important;
    min-width: 0;
    min-height: 68mm;
    padding: 6px;
  }

  .qc-photo-problem-card .qc-photo-caption-field {
    display: flex;
    height: 100%;
    margin: 0;
    flex-direction: column;
  }

  .qc-photo-problem-card .qc-photo-caption-field textarea {
    width: 100%;
    min-height: 56mm;
    padding: 5px;
    flex: 1;
    border: 0;
    overflow: hidden;
    resize: none;
  }
}
