:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #d9dee7;
  --line-soft: #e9edf3;
  --text: #20252d;
  --muted: #687385;
  --blue: #2563eb;
  --green: #16835f;
  --amber: #a15c05;
  --red: #c43d3d;
  --cyan: #087ea4;
  --shadow: 0 12px 30px rgba(32, 37, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
}

.login-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.login-card p,
.password-help {
  color: var(--muted);
  line-height: 1.6;
}

.login-card label,
.password-card label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #344055;
}

.login-card input,
.password-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.password-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.password-card {
  display: grid;
  gap: 14px;
}

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

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

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

h1 {
  font-size: 24px;
  line-height: 1.25;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.subline {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-state {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.role-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 36px;
}

input,
textarea {
  padding: 8px 10px;
}

select {
  padding: 0 28px 0 10px;
}

textarea {
  resize: vertical;
}

.button,
.icon-button,
.upload-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.button.secondary {
  background: #edf4ff;
  border-color: #b8cdfa;
  color: #174ea6;
}

.button.ghost {
  background: #fff;
  color: var(--cyan);
}

.button:disabled,
.upload-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
}

.metric-button {
  appearance: none;
  font: inherit;
  min-height: auto;
  cursor: pointer;
}

.metric-button:hover {
  border-color: #9bbcff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.metric-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong,
.metric em {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.metric em {
  color: #596273;
  font-style: normal;
  font-weight: 800;
}

.todo-metric strong {
  color: var(--blue);
}

.metric.good strong {
  color: var(--green);
}

.metric.warn strong {
  color: var(--amber);
}

.metric.mute strong {
  color: #596273;
}

.metric.alert strong {
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1.45fr) minmax(430px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.workspace[hidden] {
  display: none !important;
}

.list-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.list-panel {
  min-width: 0;
  overflow: hidden;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(112px, 0.65fr)) auto;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.search-wrap input {
  width: 100%;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 13px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-toolbar .button {
  min-width: 96px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
  color: #5c6676;
  font-weight: 650;
}

.select-col,
.select-cell {
  text-align: center;
}

.select-col input,
.select-cell input {
  min-height: auto;
}

.resizable-column {
  position: sticky;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 4;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 3px;
  bottom: 12px;
  width: 1px;
  background: transparent;
}

.column-resizer:hover::after,
.is-resizing-column .column-resizer::after {
  background: #7aa7ee;
}

.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f7fbff;
}

tbody tr.selected {
  background: #eef6ff;
}

.thumb,
.image-box {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f4f5f7;
  border: 1px solid var(--line-soft);
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.thumb-summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.thumb-summary.has-image {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.thumb-summary.empty-image {
  color: #94a3b8;
}

.thumb img,
.image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.name-cell {
  min-width: 0;
}

.name-cell strong,
.name-cell span {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.name-cell span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.name-cell .name-meta span {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  overflow: visible;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
  background: #eef0f4;
  color: #4b5565;
}

.badge.saleable {
  background: #e7f6ef;
  color: var(--green);
}

.badge.production {
  background: #fff3dd;
  color: var(--amber);
}

.badge.pending {
  background: #edf4ff;
  color: var(--blue);
}

.badge.paused,
.badge.stopped {
  background: #f3f4f6;
  color: #5f6877;
}

.asset-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.asset-tags span {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #eef2f8;
  color: #3b4554;
  font-size: 12px;
}

.asset-tags .ok {
  background: #e9f7f2;
  color: var(--green);
}

.asset-tags .missing {
  background: #fff0f0;
  color: var(--red);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.pagination-actions,
.page-size-control,
.page-jump-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control,
.page-jump-control {
  color: var(--muted);
}

.page-size-control select {
  min-height: 32px;
  padding-right: 24px;
}

.page-jump-control input {
  width: 64px;
  min-height: 32px;
  padding: 6px 8px;
  text-align: center;
}

.icon-button {
  width: 34px;
  min-height: 32px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}

.side-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
}

.side-action-card div {
  display: grid;
  gap: 4px;
}

.side-action-card span {
  color: var(--muted);
  font-size: 12px;
}

.side-action-card strong {
  color: #273246;
  font-size: 18px;
  line-height: 1;
}

.detail-panel {
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.empty-state strong {
  color: var(--text);
}

.detail-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.image-box {
  width: 112px;
  height: 112px;
  border-radius: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sku {
  color: var(--muted);
  font-size: 13px;
}

.detail-head h2 {
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.detail-head p {
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line-soft);
}

.tab {
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: #fff;
  min-height: 42px;
  cursor: pointer;
  color: var(--muted);
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  color: var(--blue);
  box-shadow: inset 0 -2px 0 var(--blue);
}

.detail-form {
  padding: 14px 16px 16px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

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

.form-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  color: var(--text);
}

.editable-field-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 6px;
}

.editable-field-control.no-lock {
  grid-template-columns: minmax(0, 1fr);
}

.field-lock-button {
  border: 1px solid #b8cdfa;
  border-radius: 6px;
  background: #edf4ff;
  color: #174ea6;
  min-height: 36px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.field-lock-button:hover {
  border-color: var(--blue);
}

.field-can-edit {
  position: relative;
  border-radius: 8px;
  padding: 7px;
  margin: -7px;
  background: transparent;
  outline: 1px solid rgba(217, 119, 6, 0.42);
}

.field-can-edit input:disabled,
.field-can-edit select:disabled,
.field-can-edit textarea:disabled {
  color: var(--text);
  opacity: 1;
  background: #fff;
  border-color: #f4a261;
  cursor: default;
}

.field-unlocked {
  background: transparent;
  outline-color: rgba(194, 65, 12, 0.52);
}

.field-unlocked input,
.field-unlocked select,
.field-unlocked textarea {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16);
}

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

.form-grid .tall textarea {
  min-height: 132px;
  line-height: 1.55;
}

.workflow-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
}

.workflow-tags,
.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.workflow-step {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 124px;
  padding: 10px;
  border: 1px solid #dbe4f3;
  border-radius: 8px;
  background: #ffffff;
}

.workflow-step.is-clickable {
  cursor: pointer;
}

.workflow-step.is-clickable:hover {
  border-color: #9bbcff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.workflow-step.is-clickable:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.workflow-step.is-done {
  border-color: #b9ead2;
  background: #f3fbf6;
}

.workflow-step.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.workflow-step.is-current-role {
  border-color: #0f9f6e;
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 #0f9f6e;
}

.workflow-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.workflow-step-role,
.workflow-step-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.workflow-step.is-active .workflow-step-state,
.workflow-step.is-current-role .workflow-step-state {
  background: #dbeafe;
  color: #1d4ed8;
}

.workflow-step.is-current-role .workflow-step-state {
  background: #d1fae5;
  color: #047857;
}

.workflow-step.is-done .workflow-step-state {
  background: #dcfce7;
  color: #15803d;
}

.workflow-step strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.workflow-step em {
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.workflow-step-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.workflow-step-board span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #dbe4f3;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
}

.workflow-step-board small,
.workflow-step-board b {
  display: block;
  overflow-wrap: anywhere;
}

.workflow-step-board small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workflow-step-board b {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.workflow-step .button {
  width: 100%;
  min-height: 32px;
}

.workflow-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-warning {
  padding: 8px 10px;
  border: 1px solid #ffd6a3;
  border-radius: 8px;
  background: #fff7ed;
  color: #a35a00;
  font-size: 13px;
  font-weight: 700;
}

.asset-block {
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0 14px;
  margin-bottom: 14px;
}

.asset-toolbar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 12px;
}

.asset-block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.asset-head-actions,
.qualification-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.button.square {
  min-width: 38px;
  padding: 0;
  font-size: 18px;
  font-weight: 750;
}

.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.button.danger {
  border-color: #f1c6c6;
  color: var(--red);
}

.button.primary.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.asset-head h3 {
  font-size: 14px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f9fafc;
  font-size: 13px;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.asset-list.compact {
  grid-template-columns: 1fr;
}

.asset-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfe;
}

.asset-slot {
  min-width: 0;
}

.asset-slot > .asset-item,
.asset-slot > .upload-button {
  width: 100%;
}

.slot-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.empty-slot {
  min-height: 136px;
  border-style: dashed;
  color: var(--muted);
}

.empty-slot span {
  pointer-events: none;
}

.asset-preview {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f5f8;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clickable-preview {
  cursor: zoom-in;
}

.clickable-preview:hover {
  background: #edf4ff;
}

.asset-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.asset-name {
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

button.asset-name {
  text-decoration: underline;
}

.delete-asset {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
}

.empty-list {
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

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

.qualification-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

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

.qualification-card h4 {
  margin: 0;
  font-size: 13px;
}

.qualification-upload {
  min-height: 30px;
  padding: 0 10px;
  flex: 0 0 auto;
}

.qualification-files {
  display: grid;
  gap: 8px;
}

.compact-card .asset-file {
  padding: 8px;
}

.report-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(32, 37, 45, 0.24);
}

.report-dialog::backdrop {
  background: rgba(32, 37, 45, 0.32);
}

.report-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: calc(100vh - 32px);
  background: #fff;
}

.todo-dialog .report-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.todo-search {
  display: grid;
  gap: 4px;
  width: min(420px, 45vw);
}

.todo-search span {
  color: var(--muted);
  font-size: 12px;
}

.todo-search input {
  min-height: 36px;
}

.system-docs-dialog .report-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.download-head > div {
  display: grid;
  gap: 4px;
}

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

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.report-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.todo-list {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px 16px 16px;
}

.todo-group {
  display: grid;
  gap: 8px;
}

.todo-group h4 {
  margin: 0;
  color: var(--text);
}

.todo-artwork-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.todo-artwork-columns .todo-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.todo-artwork-columns .todo-group h4 {
  padding: 0 2px 2px;
}

.todo-group.is-empty .empty-list {
  min-height: 80px;
}

.todo-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.todo-item:hover {
  border-color: #b8cdfa;
  background: #f8fbff;
}

.todo-item.is-warning {
  border-color: #ffd6a3;
  background: #fff7ed;
}

.todo-item span,
.todo-item em,
.todo-item small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.todo-item .todo-product-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.todo-item .todo-product-meta {
  color: var(--muted);
}

.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

@media (max-width: 820px) {
  .todo-artwork-columns {
    grid-template-columns: 1fr;
  }
}

.system-doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.system-doc-tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.system-doc-tab.active {
  border-color: #b8cdfa;
  background: #eaf1ff;
  color: var(--blue);
  font-weight: 700;
}

.system-doc-content {
  overflow: auto;
  padding: 16px;
}

.system-doc-article {
  display: grid;
  gap: 14px;
  max-width: 920px;
}

.system-doc-article > p {
  color: var(--muted);
  line-height: 1.7;
}

.system-doc-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.system-doc-section h4 {
  margin: 0;
  font-size: 15px;
}

.system-doc-section ul,
.system-doc-section ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.65;
}

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

.cost-summary-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.cost-summary-card span,
.cost-help {
  color: var(--muted);
  font-size: 12px;
}

.cost-summary-card strong {
  font-size: 22px;
}

.cost-items-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.compact-head {
  padding: 0;
  border-bottom: 0;
}

.compact-head h4 {
  margin: 0;
}

.cost-item-list {
  display: grid;
  gap: 8px;
}

.cost-item-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 0.55fr) minmax(140px, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.cost-visible-users {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.cost-visible-user {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.report-toolbar select {
  min-width: 160px;
}

.report-batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.report-batch-actions span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.common-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.common-toolbar label,
.common-upload {
  display: flex;
  align-items: center;
  gap: 8px;
}

.common-toolbar label span {
  color: var(--muted);
  font-size: 13px;
}

.common-upload {
  justify-content: flex-end;
}

.common-upload input {
  min-width: 220px;
}

.common-state {
  min-height: 20px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.common-state.success {
  color: var(--green);
}

.common-state.warn {
  color: var(--amber);
}

.common-state.error {
  color: var(--red);
}

.common-table th:nth-child(2),
.common-table td:nth-child(2) {
  min-width: 160px;
  white-space: normal;
}

.common-table th:nth-child(3),
.common-table td:nth-child(3),
.common-table th:nth-child(5),
.common-table td:nth-child(5),
.common-table th:nth-child(6),
.common-table td:nth-child(6) {
  min-width: 220px;
  white-space: normal;
}

.common-table th:nth-child(8),
.common-table td:nth-child(8) {
  min-width: 190px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-dialog,
.product-common-dialog,
.create-product-dialog {
  width: min(480px, calc(100vw - 32px));
}

.create-product-dialog {
  width: min(620px, calc(100vw - 32px));
}

.edit-dialog {
  width: min(560px, calc(100vw - 32px));
}

.link-body,
.product-common-body,
.create-product-body,
.edit-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.create-product-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-body label,
.product-common-body label,
.create-product-body label,
.edit-body label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.link-body textarea,
.product-common-body select,
.create-product-body input,
.create-product-body select,
.edit-body textarea,
.edit-body input,
.edit-body select {
  width: 100%;
}

.create-product-body .wide {
  grid-column: 1 / -1;
}

.common-linked-list {
  display: grid;
  gap: 10px;
}

.common-link-controls {
  display: flex;
  justify-content: flex-start;
}

.common-linked-items {
  display: grid;
  gap: 8px;
}

.common-linked-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.common-linked-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.common-linked-item strong,
.common-linked-item span,
.common-linked-item a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-linked-item span {
  color: var(--muted);
  font-size: 12px;
}

.common-linked-category {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: #eff6ff;
  color: #1f5fa8;
  padding: 2px 8px;
}

.common-linked-item a {
  color: #1f5fbf;
  font-size: 13px;
}

.common-linked-actions {
  display: flex;
  justify-content: flex-end;
}

.report-table-wrap {
  overflow: auto;
}

.report-table {
  min-width: 1230px;
  table-layout: auto;
}

.report-table th,
.report-table td {
  width: auto;
  padding: 10px 12px;
  white-space: nowrap;
}

.report-table th:nth-child(3),
.report-table td:nth-child(3),
.report-table th:nth-child(8),
.report-table td:nth-child(8) {
  min-width: 160px;
  white-space: normal;
}

.report-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
}

.report-status.ready {
  background: #e8f6ef;
  color: var(--green);
}

.report-status.blocked {
  background: #fff4e6;
  color: #a15c00;
}

.report-action-cell {
  text-align: center;
}

.report-action {
  min-width: 68px;
}

.report-table input[type="checkbox"] {
  min-height: auto;
}

.material-focus {
  outline: 2px solid rgba(47, 111, 183, 0.48);
  outline-offset: 2px;
  transition: outline-color 0.2s ease;
}

.report-empty {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.download-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(32, 37, 45, 0.24);
}

.download-dialog::backdrop {
  background: rgba(32, 37, 45, 0.32);
}

.product-order-dialog {
  width: min(760px, calc(100vw - 32px));
}

.download-card {
  background: #fff;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
}

.download-head,
.download-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.download-actions {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.download-options {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.download-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0 12px;
}

.download-option-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.download-options .download-option-main {
  min-height: auto;
  border: 0;
  padding: 0;
}

.download-suboptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-left: 24px;
}

.download-suboptions label {
  min-height: 32px;
  border-color: #e7edf8;
  background: #f8fbff;
  font-size: 12px;
}

.download-options input {
  min-height: auto;
}

.action-dialog {
  width: min(500px, calc(100vw - 32px));
}

.action-dialog:has(.import-preview-textarea) {
  width: min(900px, calc(100vw - 32px));
}

.action-dialog-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.action-dialog-body p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.action-dialog-fields {
  display: grid;
  gap: 12px;
}

.action-dialog-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.action-dialog-field input,
.action-dialog-field select,
.action-dialog-field textarea {
  width: 100%;
}

.import-preview-textarea {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.action-dialog-field small {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

#downloadState {
  color: var(--muted);
  font-size: 13px;
  margin-right: auto;
}

.batch-edit-dialog {
  width: min(760px, calc(100vw - 32px));
}

.batch-edit-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.batch-edit-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.batch-edit-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.batch-edit-controls input,
.batch-edit-controls select {
  width: 100%;
}

.batch-preview-head {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.batch-preview .report-table-wrap {
  max-height: 280px;
}

.batch-preview-table th,
.batch-preview-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-preview-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.batch-upload-dialog {
  width: min(980px, calc(100vw - 28px));
}

.batch-upload-card {
  width: 100%;
}

.batch-upload-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.batch-upload-rules {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.batch-upload-rules strong {
  color: var(--text);
  font-size: 13px;
}

.batch-upload-target {
  display: grid;
  grid-template-columns: 88px minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.batch-upload-target select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.batch-drop-zone {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 160px;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.batch-drop-zone.dragging {
  border-color: var(--blue);
  background: #f2f7ff;
}

.batch-drop-zone > strong {
  font-size: 17px;
}

.batch-drop-zone > span {
  color: var(--muted);
  font-size: 13px;
}

.batch-upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.batch-upload-overview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcff;
}

.batch-upload-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.batch-upload-stats strong {
  color: var(--text);
}

.batch-total-progress,
.batch-row-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf6;
}

.batch-total-progress span,
.batch-row-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .18s ease;
}

.batch-upload-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.batch-upload-list {
  display: grid;
  gap: 8px;
}

.batch-upload-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.batch-upload-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(150px, .8fr) auto;
  gap: 12px;
  align-items: center;
}

.batch-upload-file {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.batch-upload-file strong,
.batch-upload-file span,
.batch-upload-product {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-upload-file strong {
  font-size: 13px;
}

.batch-upload-file span,
.batch-upload-product {
  color: var(--muted);
  font-size: 12px;
}

.batch-upload-status {
  min-width: 92px;
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.batch-upload-row.is-uploading {
  border-color: #b8cdfa;
  background: #f7fbff;
}

.batch-upload-row.is-uploading .batch-upload-status {
  background: #edf4ff;
  color: var(--blue);
}

.batch-upload-row.is-success .batch-upload-status {
  background: #eaf8f1;
  color: var(--green);
}

.batch-upload-row.is-failed .batch-upload-status,
.batch-upload-row.is-blocked .batch-upload-status {
  background: #fff1f1;
  color: var(--red);
}

.batch-upload-row.is-success .batch-row-progress span {
  background: var(--green);
}

.image-preview-dialog {
  width: min(920px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.image-preview-dialog::backdrop {
  background: rgba(18, 24, 34, 0.58);
}

.image-preview-card {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(32, 37, 45, 0.28);
}

.image-preview-head,
.image-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.image-preview-head span,
.image-preview-foot span {
  color: var(--muted);
  font-size: 13px;
}

.image-preview-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  min-height: 320px;
  padding: 12px;
  background: #f8fafc;
}

.image-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: calc(100vh - 190px);
  overflow: hidden;
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
}

.preview-nav {
  width: 40px;
  min-height: 56px;
  font-size: 26px;
}

.image-preview-foot {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.locked-note {
  display: none;
  border: 1px solid #f1d1d1;
  background: #fff6f6;
  color: var(--red);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
}

.cost-locked [data-cost-fields] {
  display: none;
}

.cost-locked [data-cost-locked] {
  display: block;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

#saveState {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f5f6f8;
  color: #7b8493;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-wrap,
  .filters .button {
    grid-column: 1 / -1;
  }

  .detail-head {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .image-box {
    width: 88px;
    height: 88px;
  }

  .form-grid,
  .tabs {
    grid-template-columns: 1fr;
  }

  .asset-list {
    grid-template-columns: 1fr 1fr;
  }

  .slot-list,
  .qualification-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* 1.5.0 visual polish */
.app-shell {
  padding: 20px;
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(32, 37, 45, 0.06);
  padding: 16px 18px;
}

.brand-title {
  min-width: 260px;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

.version-badge {
  height: 23px;
  margin-left: 8px;
  background: #eef5ff;
  border: 1px solid #c8dbff;
}

.subline {
  margin-top: 6px;
  font-size: 14px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.role-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.role-picker {
  position: relative;
}

.role-picker select {
  min-width: 132px;
}

.role-picker span {
  color: var(--muted);
  font-weight: 700;
}

.role-default-picker select:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #64748b;
}

.role-hint {
  max-width: 300px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid #bfd4ff;
  border-radius: 8px;
  background: #f4f8ff;
  box-shadow: 0 16px 40px rgba(32, 37, 45, 0.16);
  color: #174ea6;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}

.toast[hidden] {
  display: none;
}

.toast.success {
  border-color: #b9e4d2;
  background: #f0fbf6;
  color: var(--green);
}

.toast.error {
  border-color: #f0c2c2;
  background: #fff5f5;
  color: var(--red);
}

select,
input,
textarea,
.button,
.icon-button,
.upload-button {
  border-radius: 7px;
}

.button,
.upload-button {
  min-height: 38px;
}

.button.secondary {
  background: #f2f7ff;
}

.button.ghost {
  border-color: #cdddf8;
  background: #fff;
  color: #1f5fbf;
}

.metrics {
  gap: 12px;
}

.metric {
  position: relative;
  min-height: 92px;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(32, 37, 45, 0.04);
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: #d8dee8;
}

.metric.good,
.metric.alert {
  border-color: #cfdcf0;
  box-shadow: 0 10px 26px rgba(32, 37, 45, 0.07);
}

.metric.good::before {
  background: var(--green);
}

.metric.warn::before {
  background: var(--amber);
}

.metric.alert::before {
  background: var(--red);
}

.metric span {
  font-size: 13px;
}

.metric strong,
.metric em {
  font-size: 28px;
}

.workspace {
  grid-template-columns: minmax(760px, 1.45fr) minmax(460px, 0.95fr);
}

.list-panel,
.detail-panel {
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(32, 37, 45, 0.07);
}

.detail-panel {
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #f8fafc;
}

.search-wrap {
  flex: 1 1 300px;
}

.filters select,
.filters input {
  min-height: 40px;
}

.filters select {
  flex: 1 1 132px;
  min-width: 132px;
}

.filters .button {
  flex: 1 1 132px;
  min-height: 40px;
  font-weight: 650;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}

table {
  font-size: 13.5px;
}

#productTable {
  width: 100%;
  min-width: 0;
}

th,
td {
  padding: 13px 12px;
}

#productTable th,
#productTable td {
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

th {
  height: 48px;
  background: #f8fafc;
  color: #526075;
}

tbody tr {
  min-height: 72px;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.selected {
  background: #eaf4ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fff;
}

.brand-cell {
  color: #536174;
  font-size: 13px;
}

.sku-cell {
  color: #111827;
  font-weight: 750;
  letter-spacing: 0;
}

.name-cell strong {
  color: #111827;
  font-size: 14px;
  font-weight: 750;
}

.asset-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: #445064;
  font-size: 12.5px;
  line-height: 1.55;
}

.name-cell .asset-summary {
  margin-top: 6px;
}

.name-cell .asset-summary span {
  display: inline;
  margin-top: 0;
  overflow: visible;
  white-space: nowrap;
}

.asset-summary .ok {
  color: var(--green);
}

.asset-summary .missing {
  color: var(--red);
}

.asset-divider {
  color: #a5adbb;
}

.readiness-line {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
}

.readiness-line.ready {
  background: #e8f6ef;
  color: var(--green);
}

.readiness-line.blocked {
  background: #fff4e6;
  color: #a15c00;
}

.detail-head {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  margin: 14px;
  padding: 14px;
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #f8fbff;
}

.image-box {
  width: 132px;
  height: 132px;
  border-radius: 9px;
  background: #fff;
}

.status-row {
  margin-bottom: 10px;
}

.sku {
  color: #1f2937;
  font-weight: 750;
  font-size: 14px;
}

.detail-head h2 {
  color: #111827;
  font-size: 20px;
  font-weight: 760;
}

.detail-head p {
  max-width: 100%;
  color: #5d687a;
  font-size: 13px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  color: #526176;
  font-size: 12px;
  line-height: 1.5;
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef3f9;
}

.detail-meta .meta-ready {
  background: #e8f6ef;
  color: var(--green);
}

.detail-meta .meta-blocked {
  background: #fff4e6;
  color: #a15c00;
}

.tabs {
  margin: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  overflow: hidden;
  background: #f8fafc;
}

.tab {
  min-height: 44px;
  background: transparent;
  font-weight: 650;
}

.tab.active {
  background: #fff;
  color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.detail-form {
  padding: 14px;
}

.form-grid {
  gap: 12px;
}

.asset-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0 0 12px;
  background: #fff;
}

.asset-toolbar .button {
  font-weight: 650;
}

.asset-block {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfe;
}

.asset-head h3 {
  font-size: 15px;
}

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

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

.slot-label {
  font-weight: 650;
}

.asset-item {
  border-radius: 9px;
  background: #fff;
}

.asset-preview {
  height: 120px;
  background: #f7f9fc;
}

.empty-slot {
  min-height: 148px;
  background: #fff;
  color: #2f6fb7;
  border-color: #c3d5ed;
  font-weight: 650;
}

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

.qualification-card {
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.qualification-actions {
  align-items: flex-start;
}

.qualification-card .qualification-upload {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  border-style: solid;
  border-radius: 8px;
  background: #f7fbff;
  color: #1f5fa8;
  font-size: 13px;
  font-weight: 650;
}

.qualification-card .qualification-upload span {
  white-space: nowrap;
}

.qualification-title {
  display: grid;
  gap: 3px;
}

.qualification-title span {
  color: var(--muted);
  font-size: 12px;
}

.qualification-title .qualification-latest {
  color: #2563eb;
  font-weight: 650;
}

.empty-list {
  background: #f8fafc;
}

.cost-sections {
  display: grid;
  gap: 12px;
}

.cost-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px;
}

.cost-section h3 {
  margin-bottom: 12px;
  color: #273246;
  font-size: 15px;
}

.change-log {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px;
}

.change-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.change-log-head h3 {
  font-size: 15px;
}

.change-log-head span {
  color: var(--muted);
  font-size: 12px;
}

.change-log-list {
  display: grid;
  gap: 8px;
}

.change-log-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.change-log-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.change-log-main strong {
  color: #273246;
  font-size: 13px;
}

.change-log-main span,
.change-log-detail {
  color: var(--muted);
  font-size: 12px;
}

.change-log-detail {
  margin-top: 4px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 18px -14px -14px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
  box-shadow: 0 -8px 18px rgba(32, 37, 45, 0.04);
}

.form-actions .button.primary {
  min-width: 96px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
    overflow: hidden;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    padding: 14px;
  }

  .top-actions {
    width: 100%;
  }

  .role-control {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .role-hint {
    white-space: normal;
    text-align: right;
  }

  .filters {
    margin: 10px;
  }

  .search-wrap,
  .filters select,
  .filters .button {
    flex-basis: 100%;
    min-width: 0;
    width: 100%;
  }

  .detail-head {
    grid-template-columns: 104px minmax(0, 1fr);
    margin: 10px;
  }

  .image-box {
    width: 104px;
    height: 104px;
  }

  .tabs {
    margin: 0 10px;
  }

  .detail-form {
    padding: 10px;
  }

  .slot-list,
  .asset-list,
  .qualification-list {
    grid-template-columns: 1fr;
  }

  .asset-block {
    padding: 12px;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-actions {
    width: 100%;
    justify-content: space-between;
  }

  .bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-actions {
    justify-content: stretch;
  }

  .bulk-actions .button {
    flex: 1 1 120px;
  }

  .batch-edit-controls {
    grid-template-columns: 1fr;
  }

  .side-action-card {
    align-items: stretch;
    flex-direction: column;
  }

  .side-action-card .button {
    width: 100%;
  }

  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-batch-actions {
    align-items: stretch;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .report-toolbar label,
  .report-toolbar select,
  .report-toolbar .button {
    width: 100%;
  }

  .common-toolbar,
  .common-upload,
  .common-linked-item {
    grid-template-columns: 1fr;
  }

  .common-toolbar label,
  .common-upload {
    align-items: stretch;
    flex-direction: column;
  }

  .create-product-body {
    grid-template-columns: 1fr;
  }

  .common-upload input,
  .common-upload select,
  .common-upload .button {
    width: 100%;
  }

  .qualification-head,
  .change-log-head,
  .change-log-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions {
    margin: 16px -10px -10px;
    padding: 12px;
  }

  .image-preview-body {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    min-height: 240px;
    padding: 8px;
  }

  .image-preview-stage {
    min-height: 240px;
  }

  .preview-nav {
    width: 34px;
    min-height: 48px;
  }
}

.user-management-dialog {
  width: min(1480px, calc(100vw - 28px));
}

.user-management-card {
  width: 100%;
  max-height: min(920px, calc(100vh - 28px));
}

.user-management-body {
  display: grid;
  grid-template-columns: minmax(560px, 0.95fr) minmax(640px, 1.05fr);
  gap: 20px;
  padding: 16px;
}

.user-management-body.editor-closed {
  grid-template-columns: minmax(0, 1fr);
}

.user-list-panel,
.user-editor-panel {
  min-width: 0;
}

.user-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.user-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr);
  gap: 10px;
  margin-bottom: 12px;
}

.user-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.user-filter-bar input,
.user-filter-bar select {
  width: 100%;
}

.user-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.user-table {
  width: max(100%, 680px);
  border-collapse: collapse;
  font-size: 13px;
}

.user-table th,
.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.user-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.user-empty-row {
  color: var(--muted);
  text-align: center !important;
}

.user-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.user-basic-grid label,
.user-basic-grid .user-field,
.permission-group label,
.scope-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.user-department-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.user-department-control select {
  min-width: 0;
}

.user-enabled-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.user-enabled-row input {
  min-height: auto;
}

.artlead-editor {
  margin-bottom: 12px;
  background: #fffaf3;
  border-color: #f3c27a;
}

.artlead-toggle {
  color: var(--text) !important;
  font-weight: 700;
}

.artlead-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.artlead-editor:has(input:disabled) {
  background: #f8fafc;
  border-color: var(--line-soft);
}

.developer-token-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  background: #f8fbff;
  border-color: #b9d2ff;
}

.developer-token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.developer-token-head h4 {
  margin: 0;
}

.developer-token-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.developer-token-created {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
}

.developer-token-created code {
  display: block;
  overflow-wrap: anywhere;
  padding: 8px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.developer-token-list {
  display: grid;
  gap: 8px;
}

.developer-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.developer-token-row.is-revoked {
  color: var(--muted);
  background: #f8fafc;
}

.developer-token-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
}

.developer-token-meta strong {
  color: var(--text);
  font-size: 13px;
}

.developer-token-meta small {
  color: var(--muted);
  line-height: 1.4;
}

.permission-editor,
.scope-editor,
.permission-preview {
  display: grid;
  gap: 12px;
}

.permission-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.permission-group h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

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

.permission-grid label {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.permission-grid input {
  min-height: auto;
}

.permission-grid small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.permission-grid em {
  grid-row: 1 / span 2;
  grid-column: 3;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

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

.user-editor-actions {
  margin-top: 12px;
}

.role-matrix-section {
  background: #f8fbff;
}

.role-matrix-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.role-matrix-group + .role-matrix-group {
  margin-top: 8px;
}

.role-matrix-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.role-matrix-group summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.role-matrix-wrap {
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.role-matrix-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.role-matrix-table th,
.role-matrix-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  white-space: nowrap;
}

.role-matrix-table th:first-child {
  text-align: left;
}

.role-matrix-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.role-matrix-table .is-allowed,
.permission-preview-group .is-allowed em {
  color: var(--green);
  font-weight: 700;
}

.role-matrix-table .is-denied,
.permission-preview-group .is-denied em {
  color: var(--muted);
}

.permission-preview-summary {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.permission-preview-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.permission-preview-group h4 {
  margin: 0 0 8px;
}

.permission-preview-group ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.permission-preview-group li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.permission-preview-group span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-preview-group em {
  font-style: normal;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .user-management-body {
    grid-template-columns: 1fr;
  }

  .user-filter-bar {
    grid-template-columns: 1fr;
  }

  .permission-grid,
  .scope-grid,
  .permission-preview-grid,
  .user-basic-grid {
    grid-template-columns: 1fr;
  }
}


.asset-file-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.asset-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.asset-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.asset-action,
.asset-play-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.asset-action:hover,
.asset-play-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.video-preview-trigger {
  display: grid;
  place-items: center;
  gap: 8px;
  background: #101827;
  color: #fff;
}

.asset-preview-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
}

.video-preview-dialog {
  width: min(960px, calc(100vw - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
}

.video-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.video-preview-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.28);
}

.video-preview-head,
.video-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.video-preview-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.video-preview-head span,
.video-preview-foot span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.video-preview-body {
  background: #020617;
  padding: 16px;
}

.video-preview-body video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

.video-preview-error {
  margin: 12px 0 0;
  color: #fecaca;
  font-size: 13px;
}

.video-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.temu-label-dialog {
  position: fixed;
  inset: 74px auto auto clamp(220px, 15vw, 300px);
  width: min(518px, calc(100vw - clamp(220px, 15vw, 300px) - 24px));
  max-height: calc(100vh - 92px);
  margin: 0;
}

.temu-label-card {
  width: 100%;
  max-height: calc(100vh - 92px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.temu-label-card .download-head,
.temu-label-card .download-actions {
  flex: 0 0 auto;
}

.temu-label-builder {
  display: grid;
  background: #fff;
  color: #111827;
  border: 1px solid #111827;
  overflow: auto;
  max-height: none;
  min-height: 0;
}

.temu-label-grid,
.temu-label-product-row {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.temu-label-product-head {
  border-bottom: 1px solid #111827;
}

.temu-label-product-head > *,
.temu-label-product-row > input,
.temu-ingredient-control {
  min-width: 0;
  padding: 6px;
  border: 0;
  border-right: 1px solid #111827;
}

.temu-label-product-head > *:last-child,
.temu-label-product-row > *:last-child {
  border-right: 0;
}

.temu-label-product-head label {
  display: grid;
  grid-template-columns: auto 74px;
  align-items: center;
  gap: 6px;
  line-height: 1.05;
}

.temu-label-product-head select {
  width: 74px;
  justify-self: end;
}

.temu-label-product-head select,
.temu-label-product-row input,
.temu-ingredient-control textarea,
.temu-fixed-block input,
.temu-capacity-row input,
.temu-capacity-row select {
  width: 100%;
  border: 1px solid #9ca3af;
  border-radius: 0;
  background: #fff;
  color: #111827;
  font: inherit;
  padding: 3px 4px;
  min-width: 0;
}

.temu-label-product-head label > select {
  width: 74px;
}

.temu-label-product-row {
  border-bottom: 1px solid #111827;
}

.temu-allergen-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border-bottom: 1px solid #111827;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.temu-allergen-row strong {
  font-weight: 700;
}

.temu-allergen-options {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-width: 0;
  max-height: 68px;
  overflow: auto;
}

.temu-allergen-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  line-height: 1.05;
  white-space: nowrap;
}

.temu-allergen-option input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.temu-allergen-placeholder {
  color: #6b7280;
}

.temu-ingredient-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: start;
}

.temu-ingredient-control textarea {
  min-height: 34px;
  max-height: 54px;
  resize: vertical;
}

.temu-fixed-block {
  display: grid;
  gap: 3px;
  padding: 6px;
  border-bottom: 1px solid #111827;
  outline: 1px solid #84cc16;
  outline-offset: -3px;
}

.temu-fixed-block strong {
  font-weight: 700;
}

.temu-static-input {
  display: block;
  width: min(100%, 430px);
  min-height: 18px;
  padding: 1px 3px;
  border: 1px solid #9ca3af;
  background: #fff;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: clip;
}

.temu-email-block .temu-static-input {
  width: min(100%, 430px);
}

.temu-rep-row {
  display: grid;
  gap: 4px;
  min-height: 54px;
}

.temu-rep-top {
  display: grid;
  grid-template-columns: auto auto minmax(90px, 176px) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.temu-rep-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid #111827;
  white-space: nowrap;
  line-height: 1;
}

.temu-rep-name-box {
  width: 176px;
}

.temu-rep-address-box {
  width: min(100%, 430px);
}

.temu-label-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid #111827;
}

.temu-label-bottom-grid > * {
  min-width: 0;
  min-height: 66px;
  padding: 6px;
  border-right: 1px solid #111827;
}

.temu-label-bottom-grid > *:last-child {
  border-right: 0;
}

.temu-label-bottom-grid > strong {
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}

.temu-label-bottom-grid input#temuLabelBatchNumber {
  width: min(100%, 138px);
  height: 24px;
  margin-top: 4px;
}

.temu-period-icon {
  position: relative;
  color: #111827;
  overflow: hidden;
}

.temu-period-icon::before {
  content: none;
}

.temu-period-icon::after {
  content: none;
}

.temu-period-icon span {
  display: none;
}

.temu-period-image,
.temu-period-svg {
  display: block;
  width: 42px;
  height: 45px;
}

.temu-period-image {
  object-fit: contain;
}

.temu-capacity-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid #111827;
  overflow-x: auto;
}

.temu-capacity-rows {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.temu-capacity-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.temu-capacity-row + .temu-capacity-row::before {
  content: "•";
  margin-right: 2px;
  color: #111827;
}

.temu-capacity-row input {
  width: 52px;
  height: 36px;
}

.temu-capacity-row select {
  width: 58px;
  height: 36px;
}

.temu-cpsr-inline-select {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}


.temu-capacity-row [data-temu-capacity-count] {
  width: 58px;
  height: 36px;
}

.qualification-card button.qualification-upload {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c3d5ed;
  border-radius: 8px;
  background: #f7fbff;
  color: #1f5fa8;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.qualification-card button.qualification-upload:hover {
  border-color: #1f5fa8;
}

.qualification-card button.qualification-upload:disabled,
.qualification-card button.qualification-upload.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.temu-add-label-button {
  white-space: nowrap;
}

.order-page[hidden] {
  display: none;
}

.order-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.order-page-head h2 {
  margin: 0;
  font-size: 20px;
}

.order-page-head span,
.order-muted {
  color: #64748b;
}

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

.order-table th,
.order-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf7;
  text-align: left;
  vertical-align: middle;
}

.order-table tbody tr {
  cursor: pointer;
}

.order-table tbody tr.selected {
  background: #e8f3ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.product-order-card {
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.product-order-create-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.product-order-picker-list {
  display: grid;
  gap: 12px;
}

.product-order-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #f8fbff;
}

.product-order-picker label,
.product-order-sku-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.product-order-picker input,
.product-order-sku-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 38px;
  border: 1px solid #cbd8ea;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
}

.product-order-search-field,
.product-order-quantity-field {
  grid-column: auto;
}

.product-order-picker-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.product-order-picker-results button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}

.order-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  text-align: right;
  white-space: nowrap;
}

.order-row-price {
  display: block;
  margin-top: 6px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-detail-head {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(0, 2.15fr);
  gap: 14px;
  align-items: stretch;
}

.order-summary-main {
  display: grid;
  align-content: start;
  gap: 10px;
}

.order-hero-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.order-product-hero-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fbff;
}

.order-product-hero-image {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 4px;
  border: 1px solid #e1e9f4;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  box-sizing: border-box;
}

.order-product-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.order-product-hero-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.order-product-hero-body strong,
.order-product-hero-body span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-product-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
}

.order-product-section + .order-product-section {
  margin-top: 12px;
}

.order-exclusive-assets {
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.order-product-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.order-product-title strong {
  font-size: 16px;
}

.order-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.order-info-grid div {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.order-info-grid .wide {
  grid-column: 1 / -1;
}

.order-info-grid dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.order-info-grid dd {
  margin: 4px 0 0;
  color: #111827;
}

.order-thumb-list,
.order-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.order-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.order-asset-groups,
.order-qualification-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-asset-group {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
}

.order-asset-group .asset-head {
  margin-bottom: 0;
}

.order-asset-group .asset-list {
  grid-template-columns: 1fr;
}

.order-asset-group .asset-item,
.order-qualification-list .qualification-card {
  min-width: 0;
}

.order-level-qualification-list .qualification-card {
  border-color: #bfdbfe;
  background: #fff;
}

.order-asset-group .empty-list,
.order-qualification-list .empty-list {
  min-height: 104px;
  display: flex;
  align-items: center;
}

@media (max-width: 720px) {
  .order-asset-groups,
  .order-qualification-list {
    grid-template-columns: 1fr;
  }
}

.order-detail-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 14px;
  border-top: 1px solid #e5edf7;
}

.order-chip-list span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #35516f;
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 720px) {
  .temu-label-dialog {
    inset: 56px 12px auto 12px;
    width: auto;
    max-height: calc(100vh - 72px);
  }

  .temu-label-card {
    max-height: calc(100vh - 72px);
  }

  .temu-label-grid,
  .temu-label-product-row,
  .temu-label-bottom-grid {
    grid-template-columns: 1fr;
  }

  .temu-label-product-head > *,
  .temu-label-product-row > input,
  .temu-ingredient-control,
  .temu-label-bottom-grid > * {
    border-right: 0;
    border-bottom: 1px solid #111827;
  }

  .temu-label-product-head > *:last-child,
  .temu-label-product-row > *:last-child,
  .temu-label-bottom-grid > *:last-child {
    border-bottom: 0;
  }

  .temu-rep-row {
    grid-template-columns: 1fr;
  }
}

.temu-capacity-section #addTemuCapacity {
  min-width: 30px;
  height: 30px;
  padding: 0;
}
