:root {
  --blue: #1166ff;
  --blue-600: #0757e6;
  --blue-50: #edf5ff;
  --ink: #1f2937;
  --muted: #687789;
  --soft: #eef2f7;
  --panel: #ffffff;
  --line: #dfe6ef;
  --canvas-bg: #edf1f6;
  --green: #35c759;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 1180px;
  height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--canvas-bg);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(380px, 1fr);
  padding: 0;
  background: #eaf0f7;
}

.login-screen::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(13, 23, 38, 0.12), rgba(234, 240, 247, 0.18) 62%, rgba(234, 240, 247, 0.76)),
    url("./assets/login-digital-print-factory.png") center center / cover no-repeat;
}

.login-shell {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  padding: 0 clamp(42px, 4vw, 72px);
  overflow: hidden;
  background: #fff;
  border-left: 1px solid #dce5ef;
  box-shadow: -26px 0 70px rgba(15, 23, 42, 0.1);
}

.login-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d7e7ff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  padding: 0;
  background: #fff;
}

.login-card-head {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-bottom: 6px;
}

.login-card h1 {
  margin: 0;
  color: #1f2937;
  font-size: 24px;
}

.login-card p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 13px;
}

.login-card input {
  height: 38px;
  padding: 0 12px;
  color: #263244;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 6px;
}

.login-card .primary-button {
  width: 100%;
  height: 38px;
  margin-top: 2px;
  border-radius: 6px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.erp-sidebar {
  display: none;
  grid-column: 1;
  grid-row: 1 / 4;
  grid-template-rows: 58px minmax(0, 1fr);
  min-width: 0;
  color: #c7d2e4;
  background: #1f2430;
  border-right: 1px solid #171b24;
  overflow: hidden;
}

.erp-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.erp-brand strong {
  font-size: 16px;
  font-weight: 800;
}

.erp-logo {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}

.erp-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.erp-menu {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px 0;
  overflow-y: auto;
}

.erp-menu section {
  display: grid;
  gap: 2px;
  overflow: hidden;
}

.erp-menu section.collapsed .erp-menu-item {
  min-height: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.erp-menu-head,
.erp-menu-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-height: 54px;
  padding: 0 18px 0 22px;
  color: #b9c5d7;
  font-size: 14px;
  text-align: left;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, opacity 0.2s ease, max-height 0.24s ease, min-height 0.24s ease, padding 0.24s ease;
}

.erp-menu-head {
  min-height: 38px;
  color: #9aa8bd;
  font-size: 13px;
  font-weight: 700;
}

.erp-menu-head:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.erp-menu-head:active,
.erp-menu-item:active {
  transform: translateX(2px) scale(0.99);
}

.erp-menu-item {
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 45px;
  max-height: 54px;
  padding-left: 40px;
  color: #d7deea;
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

.erp-menu-head svg,
.erp-menu-item svg {
  width: 17px;
  height: 17px;
  color: #9aa8bd;
}

.erp-menu-head svg:last-child {
  justify-self: end;
  transition: transform 0.24s ease, color 0.18s ease;
}

.erp-menu section.collapsed .erp-menu-head svg:last-child {
  transform: rotate(180deg);
}

.erp-menu-item:hover,
.erp-menu-item.active {
  color: #fff;
  background: #05070a;
}

.erp-menu-item:hover {
  transform: translateX(3px);
}

.erp-menu-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #4092ff;
  animation: erpActiveBarIn 0.22s ease both;
}

.erp-menu-item.active svg {
  color: #fff;
}

@keyframes erpActiveBarIn {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.topbar {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 22px 0 18px;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
  z-index: 5;
}

.brand,
.top-actions,
.save-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--blue);
  border-radius: 6px;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 14px;
}

.top-view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  color: #506176;
  border-radius: 6px;
  font-weight: 700;
}

.top-view-link[data-view="designer"] {
  color: #0b50d6;
  background: #f2f7ff;
  border: 1px solid #cfe0ff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.designer-return {
  display: none;
}

.top-view-link svg {
  width: 16px;
  height: 16px;
}

.top-view-link:hover,
.top-view-link.active {
  color: var(--blue);
  background: var(--blue-50);
}

.top-view-link[data-view="production"] {
  display: inline-flex;
}

.app-shell.admin-active {
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr);
}

.app-shell.admin-active .erp-sidebar {
  display: grid;
}

.app-shell.admin-active .top-actions {
  display: none;
}

.app-shell.admin-active .topbar {
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto;
}

.app-shell.admin-active .brand-mark {
  display: none;
}

.app-shell:not(.admin-active) .designer-return {
  display: inline-flex;
  color: #1f4f8f;
  background: #f4f8ff;
  border: 1px solid #d7e5f8;
  box-shadow: 0 1px 2px rgba(31, 75, 130, 0.06);
}

.app-shell:not(.admin-active) .designer-return:hover {
  color: var(--blue);
  background: #eaf3ff;
  border-color: #b9d5ff;
}

.app-shell:not(.admin-active) .designer-return svg {
  color: currentColor;
}

.app-shell.admin-active .save-actions > .plain-button,
.app-shell.admin-active #saveButton {
  display: none;
}

.app-shell.admin-active .save-actions > .logout-button {
  display: inline-flex;
}

.app-shell.admin-active .workspace {
  display: none;
}

.top-actions {
  gap: 14px;
  justify-self: start;
}

.app-shell:not(.admin-active) .top-actions {
  justify-self: center;
}

.save-actions {
  gap: 14px;
  justify-self: end;
}

.erp-tabbar {
  grid-column: 2;
  grid-row: 2;
  display: none;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 38px;
  padding: 4px 20px;
  background: #fff;
  border-bottom: 1px solid #e5eaf1;
  overflow-x: auto;
  scrollbar-width: thin;
}

.erp-tab,
.erp-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 16px;
  color: #8a97a8;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 3px;
  font-size: 13px;
  white-space: nowrap;
}

.erp-tab svg,
.erp-more svg {
  width: 14px;
  height: 14px;
}

.erp-tab.active {
  color: var(--blue);
  border-color: #cfe1ff;
  background: #f8fbff;
}

.erp-tab.muted {
  color: #b5bfcc;
}

.erp-more {
  margin-left: auto;
  color: #fff;
  background: #4092ff;
  border-color: #4092ff;
  font-weight: 700;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #31506f;
  background: #f5f8fc;
  border: 1px solid #dde8f5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.divider,
.divider-line {
  display: block;
  background: var(--line);
}

.divider {
  width: 1px;
  height: 22px;
}

.divider-line {
  width: 100%;
  height: 1px;
  margin: 10px 0 14px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #1d334d;
  border-radius: 999px;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover,
.icon-button.active {
  background: #eff3f8;
}

.icon-button.muted {
  color: #bdc7d4;
}

.icon-button.small {
  width: 26px;
  height: 26px;
}

.icon-button.small svg {
  width: 15px;
  height: 15px;
}

.icon-button.blue {
  color: var(--blue);
}

.plain-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  color: #506176;
  font-size: 13px;
  white-space: nowrap;
}

.plain-button svg {
  width: 14px;
  height: 14px;
}

.plain-button.blue {
  color: var(--blue);
  font-weight: 700;
}

.logout-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  color: #66758a;
  background: #f8fafc;
  border: 1px solid #d8e3ef;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.logout-button:hover {
  color: #b42318;
  background: #fff5f5;
  border-color: #fecaca;
  transform: translateY(-1px);
}

.primary-button {
  min-width: 58px;
  height: 30px;
  padding: 0 17px;
  color: #fff;
  font-weight: 700;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 7px 16px rgba(17, 102, 255, 0.22);
}

.primary-button:hover {
  background: var(--blue-600);
}

.workspace {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: 56px 294px minmax(620px, 1fr) 300px;
  min-height: 0;
  overflow: hidden;
}

.tool-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 10px 6px;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
  z-index: 3;
}

.rail-item {
  display: grid;
  grid-template-rows: 24px 16px;
  justify-items: center;
  align-items: center;
  width: 44px;
  height: 50px;
  color: #395169;
  border-radius: 7px;
  font-size: 11px;
}

.rail-item svg {
  width: 19px;
  height: 19px;
}

.rail-item.selected,
.rail-item:hover {
  color: var(--blue);
  background: var(--blue-50);
}

.left-panel {
  display: grid;
  min-width: 0;
  padding: 10px 12px 10px;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
  overflow: hidden;
  z-index: 2;
}

.tool-panel {
  display: none;
  min-height: 0;
  overflow: hidden;
}

.tool-panel.active {
  display: grid;
}

.tool-panel[data-panel="products"] {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.asset-panel {
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 2px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 10px;
  color: var(--blue);
  border: 1px solid #cfe0ff;
  border-radius: 7px;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.upload-button svg {
  width: 14px;
  height: 14px;
}

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

.search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  min-width: 0;
  padding: 0 11px;
  color: #79879a;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.search-box svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #243042;
  font-size: 12px;
  background: transparent;
}

.round-button,
.pill-button {
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
}

.round-button {
  display: grid;
  width: 30px;
  place-items: center;
  border-radius: 999px;
}

.round-button svg {
  width: 15px;
  height: 15px;
}

.pill-button {
  border-radius: 999px;
  color: #5f6d7f;
  font-size: 12px;
}

.sort-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 30px;
  margin: 0 2px;
  border-radius: 999px;
  background: #f0f2f5;
  overflow: hidden;
}

.product-upload-form {
  display: grid;
  gap: 8px;
  margin: 10px 2px 0;
}

.style-name-field {
  display: grid;
  gap: 5px;
  color: #687789;
  font-size: 12px;
}

.style-name-field input {
  width: 100%;
  height: 32px;
  min-width: 0;
  padding: 0 10px;
  color: #243042;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  outline: 0;
}

.style-name-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.1);
}

.file-picker,
.template-upload {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
  cursor: pointer;
}

.file-picker {
  grid-template-columns: 106px 1fr;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: #334155;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  font-size: 12px;
}

.file-picker span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
}

.file-picker strong {
  min-width: 0;
  color: #7a8798;
  font-weight: 400;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

.file-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.template-upload {
  display: flex;
  justify-content: center;
  gap: 7px;
  height: 34px;
  color: var(--blue);
  background: #f7fbff;
  border: 1px dashed #b9d2ff;
  font-size: 13px;
  font-weight: 700;
}

.template-upload svg {
  width: 16px;
  height: 16px;
}

.sort-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #667488;
  font-size: 12px;
}

.sort-button svg {
  width: 13px;
  height: 13px;
}

.sort-button.link {
  color: var(--blue);
}

.sort-button.selected {
  color: #fff;
  background: var(--blue);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 124px;
  gap: 8px;
  min-height: 0;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd4e1 transparent;
}

.product-card {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f5f8;
  border: 2px solid transparent;
  content-visibility: auto;
  contain-intrinsic-size: 124px 124px;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-empty {
  color: #8a97aa;
  font-size: 12px;
}

.product-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.12) inset;
}

.product-card::after {
  content: attr(data-code);
  position: absolute;
  left: 8px;
  bottom: 7px;
  max-width: calc(100% - 16px);
  padding: 3px 6px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background: rgba(23, 34, 49, 0.5);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.product-card:hover::after,
.product-card.selected::after {
  opacity: 1;
}

.template-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding-top: 6px;
  color: #7a8798;
  font-size: 12px;
}

.asset-grid,
.background-grid,
.text-template-list,
.left-layer-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.asset-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(128px, auto);
}

.asset-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  padding: 7px;
  color: #334155;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.asset-card:hover,
.background-card:hover,
.text-template:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.asset-card:hover {
  transform: translateY(-1px);
}

.asset-card img {
  width: 100%;
  min-height: 0;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
}

.asset-delete-button {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #e11d48;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #fecdd3;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

.asset-delete-button svg {
  width: 14px;
  height: 14px;
}

.uploaded-asset-card:hover .asset-delete-button,
.uploaded-asset-card:focus-within .asset-delete-button {
  opacity: 1;
  transform: translateY(0);
}

.asset-delete-button:hover {
  background: #fff1f2;
}

.uploaded-asset-card.deleting {
  opacity: 0.48;
  pointer-events: none;
}

.asset-card span,
.background-card span,
.text-template {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-import-tip {
  display: none;
  gap: 5px;
  padding: 10px;
  color: #64748b;
  background: #f8fbff;
  border: 1px solid #dbe8fb;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.order-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 38px;
  padding: 0 2px;
  border-bottom: 1px solid #dce5ef;
}

.order-tabs button {
  position: relative;
  min-height: 38px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.order-tabs button.active {
  color: var(--blue);
}

.order-tabs button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--blue);
  border-radius: 999px;
}

.order-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.2fr) minmax(220px, 1.2fr) minmax(300px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.order-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #526176;
  font-size: 12px;
  font-weight: 700;
}

.order-filter-bar select,
.order-filter-bar input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  color: #263244;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 6px;
}

.order-date-filter {
  min-width: 300px;
}

.order-filter-actions,
.order-module-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-filter-actions {
  justify-content: flex-end;
}

.order-filter-actions .primary-button,
.order-filter-actions .plain-button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 6px;
}

.order-filter-actions .plain-button {
  color: #526176;
  background: #fff;
  border: 1px solid #dce6f2;
}

.order-module-actions {
  padding: 0 2px;
}

.order-action-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  color: #0b5fd3;
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.order-action-button.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(17, 102, 255, 0.16);
}

.order-action-button input {
  display: none;
}

.order-action-button svg {
  width: 14px;
  height: 14px;
}

.order-import-tip strong {
  color: #1e3a8a;
  font-size: 12px;
}

.order-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  min-height: 0;
  padding: 0;
  color: #31506f;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.order-import-summary span {
  display: grid;
  gap: 4px;
  min-height: 62px;
  align-content: center;
  padding: 10px 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  font-weight: 700;
}

.order-import-summary strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.order-import-summary em {
  color: #8a98aa;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.order-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding-right: 2px;
}

.order-admin-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  min-height: calc(100vh - 84px);
  gap: 12px;
}

.order-admin-list {
  grid-template-columns: 1fr;
  align-content: start;
}

.order-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 16px;
  color: #7a8798;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #d8e1ed;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.order-empty.upgraded {
  min-height: 320px;
  align-content: center;
  gap: 10px;
}

.order-empty.upgraded span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--blue);
  background: #edf5ff;
  border-radius: 8px;
}

.order-empty.upgraded svg {
  width: 24px;
  height: 24px;
}

.order-empty.upgraded strong {
  color: #1f2937;
  font-size: 16px;
}

.order-empty.upgraded p {
  max-width: 520px;
  margin: 0;
  color: #64748b;
}

.order-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  color: #334155;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
}

.order-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.order-card.matched .order-match {
  color: #16a34a;
}

.order-card-head,
.order-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-card-head strong,
.order-card p,
.order-card small,
.order-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-card-head strong {
  color: #1f2937;
  font-size: 13px;
}

.order-card-head span,
.order-card small,
.order-match {
  color: #64748b;
  font-size: 11px;
}

.order-card p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.order-card em {
  display: block;
  padding: 7px 8px;
  color: #7c3aed;
  background: #f6f1ff;
  border: 1px solid #e6d8ff;
  border-radius: 6px;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}

.order-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.order-card-actions .plain-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.order-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.order-table-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.order-table-toolbar strong {
  color: #0f172a;
  font-size: 14px;
}

.order-table-toolbar span {
  color: #64748b;
  font-size: 12px;
}

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

.order-table-actions .plain-button,
.order-row-actions .plain-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.order-table-actions .plain-button.active {
  color: #0b5fd3;
  background: #f4f8ff;
  border-color: #cfe0ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.order-row-actions .plain-button.blue {
  color: #0b5fd3;
  background: #f4f8ff;
  border-color: #cfe0ff;
}

.order-row-actions .plain-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.order-table {
  display: grid;
  overflow: auto;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.order-table-head,
.order-table-row {
  display: grid;
  grid-template-columns: 90px minmax(150px, 0.9fr) minmax(280px, 1.5fr) 80px 80px minmax(110px, 0.7fr) minmax(170px, 0.9fr) minmax(130px, 0.75fr) minmax(260px, 1.1fr);
  align-items: center;
  gap: 12px;
  min-width: 1380px;
}

.order-table-head {
  min-height: 42px;
  padding: 0 12px;
  color: #526176;
  background: #f3f6fa;
  border-bottom: 1px solid #dce5ef;
  font-size: 12px;
  font-weight: 800;
}

.order-table-row {
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid #e8eef5;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.order-table-row:last-child {
  border-bottom: 0;
}

.order-table-row:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 #9cc5ff;
}

.order-table-row.active {
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.order-table-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-table-row strong,
.order-table-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-table-row strong {
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
}

.order-table-row small {
  color: #64748b;
  font-size: 11px;
}

.order-no-cell strong {
  color: #0b5fd3;
}

.order-product-cell strong {
  white-space: nowrap;
}

.order-status-pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.order-status-pill.matched {
  color: #167144;
  background: #effbf3;
  border: 1px solid #bde9cd;
}

.order-status-pill.unmatched {
  color: #9a5b00;
  background: #fff8e8;
  border: 1px solid #f5d58b;
}

.order-row-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px;
}

@media (max-width: 1100px) {
  .order-import-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .order-table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

.color-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  margin-bottom: 10px;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
}

.color-material-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #60718a;
  font-size: 12px;
  font-weight: 700;
}

.color-material-row input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid #d8e3ef;
  border-radius: 7px;
  background: #fff;
}

.color-material-row .primary-button {
  height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.background-card {
  display: grid;
  min-height: 64px;
  align-items: end;
  padding: 10px;
  color: #223047;
  text-align: left;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg), #fff 20%), var(--bg)),
    #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.text-input-row {
  display: grid;
  gap: 7px;
  color: #69768a;
  font-size: 12px;
}

.text-input-row input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  outline: 0;
}

.text-template-list {
  overflow: visible;
}

.text-template {
  min-height: 42px;
  padding: 0 12px;
  color: #1166ff;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  font-weight: 800;
}

.canvas-zone {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 42px;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(205, 217, 232, 0.42) 1px, transparent 1px),
    linear-gradient(180deg, rgba(205, 217, 232, 0.42) 1px, transparent 1px),
    linear-gradient(135deg, #f3f7fb 0%, #e7eef6 100%);
  background-size: 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

.editor-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 20px 28px 14px;
  overflow: auto;
}

.canvas-shell {
  position: relative;
  display: grid;
  width: min(700px, 92%);
  aspect-ratio: 1;
  place-items: center;
  padding-left: 76px;
}

.canvas-shell:not(:has(.face-strip.ready)) {
  padding-left: 0;
}

.canvas-card {
  position: relative;
  width: min(620px, 100%);
  aspect-ratio: 1;
  background: #f8fbff;
  border: 1px solid rgba(193, 207, 224, 0.9);
  border-radius: 14px;
  box-shadow:
    0 18px 42px rgba(31, 41, 55, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

#designCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: grab;
}

#designCanvas.dragging {
  cursor: grabbing;
}

.canvas-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 32px;
  text-align: center;
  pointer-events: none;
}

.canvas-hint h1 {
  margin: 0;
  color: #1f2937;
  font-size: 28px;
  line-height: 1.2;
}

.canvas-hint p {
  margin: 12px 0 0;
  color: #69768a;
  font-size: 15px;
}

.canvas-hint.hidden {
  display: none;
}

.canvas-loading,
.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #203047;
  text-align: center;
  background: rgba(246, 250, 255, 0.82);
  backdrop-filter: blur(6px);
}

.canvas-loading[hidden],
.preview-loading[hidden] {
  display: none;
}

.canvas-loading strong,
.preview-loading strong {
  display: none;
  font-size: 16px;
  font-weight: 800;
}

.canvas-loading em {
  display: none;
  max-width: 340px;
  color: #687789;
  font-style: normal;
  font-size: 13px;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(17, 102, 255, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: designerSpin 0.78s linear infinite;
}

.loading-spinner.small {
  width: 26px;
  height: 26px;
  border-width: 2px;
}

.canvas-card.loading #designCanvas,
.preview-wrap.loading canvas {
  filter: saturate(0.85);
}

@keyframes designerSpin {
  to {
    transform: rotate(360deg);
  }
}

.face-strip {
  position: absolute;
  top: 50%;
  left: 4px;
  z-index: 4;
  display: none;
  width: 76px;
  max-height: calc(100% - 28px);
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e4ebf5;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(37, 51, 71, 0.16);
  scrollbar-width: none;
  transform: translateY(-50%);
}

.face-strip.ready {
  display: flex;
}

.face-strip[hidden] {
  display: none;
}

.face-strip::-webkit-scrollbar {
  display: none;
}

.face-chip {
  min-width: 62px;
  min-height: 30px;
  padding: 0 9px;
  color: #4f6b8a;
  border-radius: 999px;
  background: #f5f8fc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.face-chip.active {
  color: var(--blue);
  background: var(--blue-50);
}

.face-thumb {
  position: relative;
  display: grid;
  width: 62px;
  grid-template-rows: 48px auto;
  justify-items: center;
  color: #738196;
  font-size: 11px;
}

.face-thumb img {
  width: 44px;
  height: 48px;
  object-fit: contain;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
}

.face-thumb span {
  max-width: 62px;
  margin-top: 2px;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-thumb::after {
  content: none;
}

.face-thumb.selected span,
.face-chip.active {
  color: var(--blue);
  font-weight: 700;
}

.face-thumb.selected img {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.12);
}

.face-copy-menu {
  position: fixed;
  z-index: 72;
  width: 256px;
  padding: 10px;
  color: #263244;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(26, 39, 60, 0.2);
}

.face-copy-head {
  display: grid;
  gap: 2px;
  padding: 2px 2px 9px;
  border-bottom: 1px solid #edf2f8;
}

.face-copy-head span {
  color: #6a788c;
  font-size: 12px;
  font-weight: 700;
}

.face-copy-head strong {
  color: #11233d;
  font-size: 14px;
}

.face-copy-list {
  display: grid;
  gap: 7px;
  padding-top: 9px;
}

.face-copy-list button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 6px;
  text-align: left;
  background: #f7faff;
  border: 1px solid #e3ebf6;
  border-radius: 8px;
}

.face-copy-list button:hover {
  border-color: rgba(17, 102, 255, 0.36);
  background: #eef5ff;
}

.face-copy-list img {
  width: 36px;
  height: 42px;
  object-fit: contain;
  padding: 3px;
  background: #fff;
  border: 1px solid #e4ebf5;
  border-radius: 6px;
}

.face-copy-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.face-copy-list strong,
.face-copy-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-copy-list strong {
  color: #17243a;
  font-size: 13px;
  font-weight: 800;
}

.face-copy-list em {
  color: #748297;
  font-style: normal;
  font-size: 11px;
}

.canvas-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  padding: 0 18px 8px;
  font-size: 13px;
}

.canvas-footer > strong {
  justify-self: center;
}

.print-tip {
  position: absolute;
  left: 18px;
  bottom: 7px;
  z-index: 4;
  display: grid;
  gap: 2px;
  width: 186px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #e1e9f3;
  border-radius: 999px;
  box-shadow: 0 7px 22px rgba(35, 50, 70, 0.14);
  pointer-events: none;
}

.print-tip strong {
  color: #39b84a;
  font-size: 11px;
  line-height: 1.1;
}

.print-tip span {
  color: #6f7c8f;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-tip.empty strong {
  color: #64748b;
}

.print-tip.warning {
  background: #fff7f7;
  border: 1px solid #fecaca;
  box-shadow: 0 7px 22px rgba(239, 68, 68, 0.14);
}

.print-tip.warning strong {
  color: #ef4444;
}

.print-tip.warning span {
  color: #991b1b;
}

.zoom-control {
  position: absolute;
  right: 18px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(30, 39, 51, 0.16);
}

.zoom-control input {
  width: 72px;
  accent-color: var(--blue);
}

.side-collapse {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: grid;
  width: 18px;
  height: 44px;
  place-items: center;
  color: #9aa7b8;
  background: #fff;
  border: 1px solid #e3e9f1;
  box-shadow: 0 4px 12px rgba(30, 39, 51, 0.08);
}

.side-collapse svg {
  width: 14px;
  height: 14px;
}

.side-collapse.left {
  left: 0;
  border-radius: 0 7px 7px 0;
  transform: translate(-1px, -50%);
}

.side-collapse.right {
  left: -18px;
  border-radius: 7px 0 0 7px;
  transform: translateY(-50%);
}

.settings-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto;
  min-width: 300px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: -1px 0 0 var(--line);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 2;
}

.settings-panel .product-summary,
.settings-panel .file-analysis,
.settings-panel .element-inspector,
.settings-panel .history-section {
  display: none;
}

.settings-section {
  padding: 16px 18px;
}

.product-summary h2,
.element-inspector h2,
.layer-list h2,
.history-section h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.option-line,
.size-row {
  display: flex;
  align-items: center;
  min-height: 32px;
  color: #69768a;
  font-size: 13px;
}

.option-line {
  gap: 8px;
}

.swatch {
  width: 21px;
  height: 21px;
  border: 1px solid #d9e2ee;
  border-radius: 999px;
  background: #fff;
}

.size-row {
  gap: 5px;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 178px;
  min-width: 0;
}

.size-options button {
  height: 24px;
  min-width: 0;
  padding: 0 7px;
  color: #5b6879;
  border: 1px solid #d9e2ee;
  border-radius: 999px;
  font-size: 12px;
}

.size-options button.selected {
  color: var(--blue);
  border-color: var(--blue);
  background: #f8fbff;
}

.tick {
  display: grid;
  width: 14px;
  height: 22px;
  place-items: center;
  color: #7c889a;
}

.tick svg {
  width: 13px;
  height: 13px;
}

.meta-lines {
  display: grid;
  gap: 13px;
  margin-top: 10px;
  padding-top: 14px;
  color: #6f7c8f;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.meta-lines p {
  margin: 0;
}

.meta-lines strong {
  color: #2c3a4e;
}

.preview-section {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  padding: 12px 10px 16px;
  border-bottom: 0;
}

.preview-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 260px);
  min-height: 36px;
  margin: 0 auto;
}

.preview-panel-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preview-panel-head strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.2;
}

.preview-panel-head span {
  display: none;
}

.preview-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  color: #0b5fd3;
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.preview-open-button svg {
  width: 14px;
  height: 14px;
}

.preview-wrap {
  --preview-aspect: 1 / 1;
  position: relative;
  width: min(100%, 260px);
  max-width: 100%;
  aspect-ratio: var(--preview-aspect);
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(219, 229, 240, 0.45) 1px, transparent 1px),
    linear-gradient(180deg, rgba(219, 229, 240, 0.45) 1px, transparent 1px),
    radial-gradient(circle at 50% 88%, rgba(31, 41, 55, 0.08), transparent 18%),
    linear-gradient(135deg, #f8fbff 0%, #edf4fb 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  border: 1px solid #dce7f3;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(31, 41, 55, 0.08);
}

.preview-wrap.preview-portrait {
  width: min(100%, 232px);
}

.order-reference-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 9;
  display: grid;
  gap: 7px;
  width: 148px;
  padding: 8px;
  color: #1f2a3a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

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

.order-reference-panel div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.order-reference-panel strong {
  font-size: 12px;
  line-height: 1.2;
}

.order-reference-panel span {
  color: #748297;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-reference-panel img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #f5f8fc;
  border: 1px solid #e4ebf4;
  border-radius: 6px;
}

.preview-wrap img,
.preview-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 32px;
  height: 50px;
  place-items: center;
  color: #41536a;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(211, 222, 236, 0.88);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.10);
  transform: translateY(-50%);
}

.preview-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preview-arrow.prev {
  left: 8px;
  border-radius: 999px;
}

.preview-arrow.next {
  right: 8px;
  border-radius: 999px;
}

.preview-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  min-width: 44px;
  min-height: 25px;
  padding: 5px 9px;
  color: #fff;
  text-align: center;
  background: rgba(20, 29, 42, 0.48);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.preview-count[hidden] {
  display: none;
}

.preview-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 9px;
  color: #fff;
  background: rgba(20, 29, 42, 0.38);
  border-radius: 999px;
  font-size: 12px;
}

.preview-label svg {
  width: 14px;
  height: 14px;
}

.material-quick-actions {
  display: grid;
  gap: 10px;
  width: min(100%, 280px);
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border: 1px solid #dfe8f3;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.07);
}

.material-action-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  color: #263244;
  font-size: 12px;
}

.material-action-head strong {
  color: #172033;
  font-size: 13px;
}

.material-action-head span {
  color: #8b97a8;
  font-weight: 400;
  text-align: left;
  white-space: normal;
}

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

.material-action-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  color: #334155;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid #dfe7f0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.material-action-grid button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #6b7c92;
}

.material-action-grid button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-action-grid button[data-material-action="fill-design"],
.material-action-grid button[data-material-action="center-cover"] {
  color: #0b5fd3;
  background: #f4f8ff;
  border-color: #cfe0ff;
}

.material-action-grid button[data-material-action="fill-design"] svg,
.material-action-grid button[data-material-action="center-cover"] svg {
  color: #0b5fd3;
}

.material-action-grid button:hover,
.material-action-grid button.active {
  color: var(--blue);
  background: #f0f6ff;
  border-color: #bcd3ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.material-action-grid button:hover svg,
.material-action-grid button.active svg {
  color: var(--blue);
}

.material-action-grid button:disabled {
  color: #a6b0bf;
  background: #f3f6fa;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.file-analysis {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.file-analysis div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  padding: 8px;
  color: #69768a;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  font-size: 12px;
}

.file-analysis strong {
  color: #263244;
}

.file-analysis span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-analysis .psd-tree-card {
  grid-template-columns: 44px 1fr;
}

.psd-tree-card > span {
  white-space: normal;
}

.psd-tree-summary,
.psd-tree-list,
.psd-tree-row,
.psd-tree-more {
  display: block;
}

.psd-tree-summary {
  margin-bottom: 6px;
  color: #263244;
  font-weight: 700;
}

.psd-tree-row {
  padding-left: var(--depth, 0);
  line-height: 1.45;
}

.psd-tree-row b {
  color: #334155;
  font-weight: 700;
}

.psd-tree-row small {
  margin-left: 6px;
  color: #8b97a8;
}

.psd-tree-more {
  margin-top: 4px;
  color: #0b50ff;
}

.element-inspector {
  border-bottom: 1px solid var(--soft);
}

.element-inspector .section-head span {
  color: #7a8798;
  font-size: 12px;
}

.inspector-empty {
  margin-top: 10px;
  color: #7a8798;
  font-size: 12px;
  line-height: 1.6;
}

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

.inspector-grid label {
  display: grid;
  gap: 5px;
  color: #6c798b;
  font-size: 12px;
}

.inspector-grid input,
.inspector-grid select {
  width: 100%;
  height: 30px;
  min-width: 0;
  padding: 0 8px;
  color: #263244;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 6px;
  outline: 0;
  font-size: 12px;
}

.inspector-grid input:focus,
.inspector-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.1);
}

.inspector-grid input:disabled,
.inspector-grid select:disabled,
.inspector-actions button:disabled {
  color: #a6b0bf;
  background: #f3f6fa;
  cursor: not-allowed;
}

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

.inspector-actions .plain-button {
  margin-left: auto;
}

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

.empty-layer {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 140px;
  margin-top: 14px;
  padding: 24px;
  color: #8a97aa;
  text-align: center;
  background: #f7f9fc;
  border: 1px dashed #d8e1ed;
  border-radius: 8px;
  font-size: 13px;
}

.empty-layer svg {
  width: 26px;
  height: 26px;
  color: #b7c2d1;
}

.history-item {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 10px;
  padding: 7px 8px;
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 13px;
}

.layer-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 36px 1fr 20px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 5px 7px;
  text-align: left;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  cursor: grab;
  user-select: none;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.layer-item:hover {
  background: #fbfdff;
  border-color: #cdd9e8;
}

.layer-item.selected {
  border-color: var(--blue);
  background: #f0f6ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.layer-item.dragging {
  opacity: 0.55;
  cursor: grabbing;
  transform: scale(0.995);
}

.layer-item.hidden-layer {
  opacity: 0.58;
}

.layer-item.hidden-layer .layer-thumb,
.layer-item.hidden-layer .layer-meta {
  filter: grayscale(0.85);
}

.layer-item.drop-before::before,
.layer-item.drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 2;
  height: 2px;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.12);
}

.layer-item.drop-before::before {
  top: -4px;
}

.layer-item.drop-after::after {
  bottom: -4px;
}

.history-item {
  grid-template-columns: 1fr;
  align-items: start;
}

.history-item span {
  color: #7a8798;
  font-size: 12px;
}

.layer-visibility,
.layer-state {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #718096;
  background: transparent;
  border-radius: 5px;
}

.layer-visibility {
  cursor: pointer;
}

.layer-visibility:hover {
  color: var(--blue);
  background: #edf5ff;
}

.layer-state {
  cursor: grab;
  pointer-events: none;
}

.layer-visibility svg,
.layer-state svg {
  width: 15px;
  height: 15px;
}

.layer-thumb {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--blue);
  background: #f4f7fb;
  border: 1px solid #dfe6ef;
  border-radius: 4px;
  overflow: hidden;
}

.layer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.layer-thumb svg {
  width: 17px;
  height: 17px;
}

.layer-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.layer-meta strong,
.layer-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-meta strong {
  color: #253246;
  font-size: 12px;
}

.layer-meta small {
  color: #7a8798;
  font-size: 11px;
}

.history-list {
  min-height: 72px;
  margin-top: 10px;
}

.admin-page {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  padding: 18px 20px;
  overflow: auto;
  background: #f2f5f9;
}

.app-shell.admin-active .admin-page {
  grid-column: 2;
  grid-row: 2;
}

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

.admin-panel {
  width: min(760px, calc(100vw - 52px));
  margin: 0 auto;
  padding: 18px;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
}

.admin-panel.wide {
  width: 100%;
  max-width: none;
}

.records-page .admin-panel.wide {
  width: 100%;
  max-width: none;
}

.records-page .admin-panel {
  padding: 20px;
}

.records-page .admin-head {
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e5ebf3;
}

.records-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.records-overview em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #31506f;
  background: #f5f8fc;
  border: 1px solid #dde8f5;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
}

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

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.records-page .admin-head-actions {
  justify-content: flex-end;
  gap: 8px;
}

.records-page .admin-head-actions .plain-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
}

.records-page .admin-head-actions .plain-button.blue {
  background: #f4f8ff;
  border-color: #d7e6ff;
}

.admin-select.compact {
  min-width: 210px;
}

.admin-select.compact span {
  font-size: 12px;
}

.admin-select.compact select {
  height: 30px;
  font-size: 13px;
}

.admin-head span {
  color: #6f7c8f;
  font-size: 12px;
}

.admin-head h1 {
  margin: 3px 0 0;
  color: #243145;
  font-size: 18px;
}

.app-shell.admin-active {
  grid-template-columns: 216px minmax(0, 1fr);
  background: #edf4fb;
}

.app-shell.admin-active .erp-sidebar {
  color: #d8e8ff;
  background: #082f5f;
  border-right: 1px solid #05254d;
  box-shadow: none;
}

.app-shell.admin-active .erp-brand {
  height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(216, 232, 255, 0.14);
}

.app-shell.admin-active .erp-brand strong {
  font-size: 19px;
  letter-spacing: 0;
}

.app-shell.admin-active .erp-logo {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(1, 24, 52, 0.22);
}

.app-shell.admin-active .erp-menu {
  gap: 8px;
  padding: 12px 10px 18px;
}

.app-shell.admin-active .erp-menu section {
  gap: 2px;
}

.app-shell.admin-active .erp-menu-head {
  min-height: 30px;
  padding: 0 10px 0 12px;
  color: rgba(216, 232, 255, 0.62);
  font-size: 12px;
}

.app-shell.admin-active .erp-menu-item {
  min-height: 38px;
  max-height: 42px;
  padding: 0 12px;
  color: rgba(246, 250, 255, 0.88);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.app-shell.admin-active .erp-menu-head svg,
.app-shell.admin-active .erp-menu-item svg {
  color: currentColor;
  opacity: 0.84;
}

.app-shell.admin-active .erp-menu-item:hover,
.app-shell.admin-active .erp-menu-item.active {
  color: #fff;
  background: #1268d8;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  transform: none;
}

.app-shell.admin-active .erp-menu-item.active::before {
  display: none;
}

.app-shell.admin-active .topbar {
  height: 50px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 1px solid #dbe6f3;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.app-shell.admin-active .brand {
  min-width: 0;
}

.app-shell.admin-active .top-view-link[data-view="designer"] {
  height: 32px;
  padding: 0 12px;
  color: #0b5fd3;
  background: #f5f9ff;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.app-shell.admin-active .save-actions {
  gap: 10px;
}

.app-shell.admin-active .user-badge {
  min-height: 30px;
  color: #17345e;
  background: #f5f8fc;
  border-color: #dce7f5;
  border-radius: 6px;
}

.app-shell.admin-active .primary-button,
.app-shell.admin-active .plain-button {
  border-radius: 6px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.app-shell.admin-active .primary-button:active,
.app-shell.admin-active .plain-button:active,
.app-shell.admin-active .erp-menu-item:active,
.workbench-shortcuts a:active {
  transform: translateY(1px);
}

.app-shell.admin-active .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  box-shadow: none;
}

.app-shell.admin-active .primary-button svg {
  width: 15px;
  height: 15px;
}

.admin-page {
  padding: 16px 18px;
  background: #eef3f8;
}

.app-shell.admin-active .admin-page {
  overflow: auto;
}

.admin-panel,
.shipment-card,
.merchant-create-form,
.merchant-list-panel {
  border-color: #d8e3f0;
  box-shadow: none;
}

.admin-panel {
  padding: 16px;
}

.admin-panel.wide {
  min-height: calc(100vh - 82px);
}

.app-shell.admin-active .admin-panel.wide,
.upload-page .admin-panel,
.records-page .admin-panel,
.shipment-page .admin-panel,
.order-admin-panel {
  align-content: start;
}

.admin-head {
  min-height: 44px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2eaf4;
}

.admin-head span {
  color: #6b7d94;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-head h1 {
  color: #10233f;
  font-size: 20px;
  font-weight: 900;
}

.admin-head-actions .plain-button,
.admin-head-actions .primary-button,
.records-batch-actions .plain-button,
.record-download-cell .plain-button,
.order-table-actions .plain-button,
.order-row-actions .plain-button,
.merchant-actions .plain-button,
.template-actions button {
  border-radius: 6px;
}

.workbench-page {
  padding: 16px 18px;
}

.workbench-shell {
  display: grid;
  gap: 12px;
}

.workbench-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  box-shadow: none;
}

.workbench-head > div:first-child {
  display: grid;
  gap: 3px;
}

.workbench-head span {
  color: #6b7d94;
  font-size: 12px;
  font-weight: 800;
}

.workbench-head h1 {
  margin: 0;
  color: #10233f;
  font-size: 22px;
}

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

.workbench-actions a,
.workbench-panel-head a,
.workbench-shortcuts a {
  text-decoration: none;
}

.workbench-actions .plain-button {
  min-height: 32px;
  padding: 0 11px;
  background: #f5f9ff;
  border: 1px solid #cfe0ff;
  font-weight: 800;
}

.workbench-actions .primary-button {
  min-width: 112px;
  padding: 0 13px;
}

.workbench-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
}

.workbench-kpi {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  min-height: 76px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border: 0;
  border-right: 1px solid #e3eaf3;
  border-radius: 0;
  box-shadow: none;
}

.workbench-kpi:last-child {
  border-right: 0;
}

.workbench-kpi-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #255a96;
  background: #f2f6fb;
  border: 1px solid #dce6f2;
  border-radius: 6px;
}

.workbench-kpi svg {
  width: 19px;
  height: 19px;
}

.workbench-kpi div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workbench-kpi em,
.workbench-kpi small {
  overflow: hidden;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-kpi strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(320px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.workbench-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  box-shadow: none;
}

.workbench-panel-wide {
  grid-row: span 2;
}

.workbench-panel-head {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workbench-panel-head strong {
  color: #10233f;
  font-size: 15px;
}

.workbench-panel-head a {
  color: #0b5fd3;
  font-size: 12px;
  font-weight: 800;
}

.workbench-record-list,
.workbench-template-list,
.workbench-shortcuts {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e0e8f2;
  border-radius: 8px;
}

.workbench-record-row,
.workbench-template-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 9px 10px;
  background: #fff;
  border-bottom: 1px solid #edf2f7;
}

.workbench-record-row {
  grid-template-columns: 58px minmax(0, 1fr) 86px;
}

.workbench-template-row {
  grid-template-columns: 46px minmax(0, 1fr) 68px;
}

.workbench-record-row:last-child,
.workbench-template-row:last-child {
  border-bottom: 0;
}

.workbench-record-row:hover,
.workbench-template-row:hover,
.workbench-shortcuts a:hover {
  background: #f5f8fc;
}

.workbench-thumb {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  color: #8aa0ba;
  background: #f4f7fb;
  border: 1px solid #dce6f2;
  border-radius: 6px;
}

.workbench-record-row .workbench-thumb {
  width: 58px;
  height: 46px;
}

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

.workbench-thumb svg {
  width: 18px;
  height: 18px;
}

.workbench-record-row > div:nth-child(2),
.workbench-template-row > div:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workbench-record-row span,
.workbench-record-row small,
.workbench-template-row small {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-record-row strong,
.workbench-template-row strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-record-row > em,
.workbench-template-row > em {
  justify-self: end;
  min-width: 64px;
  padding: 5px 7px;
  color: #526176;
  background: #f6f8fb;
  border: 1px solid #dce5ef;
  border-radius: 5px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.workbench-record-row > em.done,
.workbench-template-row > em.done {
  color: #167144;
  background: #effbf3;
  border-color: #bde9cd;
}

.workbench-record-row > em.running {
  color: #0b5fd3;
  background: #eef6ff;
  border-color: #c6dcff;
}

.workbench-record-row > em.warning,
.workbench-template-row > em.warning {
  color: #9a5b00;
  background: #fff8e8;
  border-color: #f5d58b;
}

.workbench-record-row > em.error {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffccc7;
}

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

.workbench-shortcuts a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  color: #223b58;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  font-weight: 800;
}

.workbench-shortcuts svg {
  width: 17px;
  height: 17px;
  color: #255a96;
}

.workbench-empty {
  min-height: 96px;
  display: grid;
  grid-template-columns: 22px auto;
  place-content: center;
  align-items: center;
  gap: 8px;
  color: #7a8798;
  background: #f8fafc;
  font-size: 13px;
}

.admin-empty {
  display: grid;
  grid-template-columns: auto;
  min-height: 48px;
  align-items: center;
  justify-content: start;
  gap: 8px;
  padding: 12px 14px;
  color: #526176;
  background: #f8fafc;
  border: 1px dashed #d6e0ec;
  border-radius: 8px;
  font-size: 13px;
}

.admin-empty svg {
  width: 22px;
  height: 22px;
  color: #3266ad;
}

.admin-empty:has(svg) {
  grid-template-columns: 26px minmax(0, 1fr);
}

.admin-empty strong {
  color: #10233f;
  font-size: 14px;
}

.admin-empty p {
  grid-column: 1 / -1;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.order-filter-bar,
.shipment-scan-bar {
  background: #f8fbff;
  border-color: #dce8f6;
  border-radius: 8px;
}

.order-import-summary span,
.template-overview span,
.records-kpi,
.record-file-stat,
.record-metric {
  border-radius: 8px;
}

.template-table,
.merchant-table,
.records-production-list,
.art-record-list,
.order-table {
  border-color: #d8e3f0;
  box-shadow: none;
}

.template-table-head,
.merchant-table-head,
.records-list-head,
.art-record-head,
.order-table-head {
  color: #2e4969;
  background: #f0f6ff;
  border-bottom-color: #d8e3f0;
}

.template-row,
.merchant-row,
.record-production-row.record-card,
.art-record-row.record-card,
.order-table-row {
  background: #fff;
}

.template-row:hover,
.merchant-row:hover,
.record-production-row.record-card:hover,
.art-record-row.record-card:hover,
.order-table-row:hover {
  background: #f8fbff;
}

.shipment-page .admin-panel {
  min-height: calc(100vh - 96px);
  padding: 28px;
}

.shipment-head {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e7edf5;
}

.shipment-head .admin-head h1,
.shipment-head h1 {
  margin-top: 6px;
  font-size: 22px;
}

.shipment-scan-bar {
  display: grid;
  grid-template-columns: 210px minmax(420px, 1fr) 96px 72px;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  background: #f8fbff;
  border: 1px solid #dfe9f6;
  border-radius: 10px;
}

.shipment-scan-bar .admin-select.compact {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.shipment-scan-bar .admin-select.compact span {
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.shipment-scan-bar .admin-select.compact select {
  height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
}

.shipment-scan-bar input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: #1f2f46;
  background: #fff;
  border: 1px solid #cfd9e6;
  border-radius: 6px;
  outline: 0;
  font-size: 14px;
}

.shipment-scan-bar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(17, 102, 255, 0.1);
}

.shipment-scan-bar .plain-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
  font-weight: 800;
}

.shipment-scan-bar .plain-button.blue {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.shipment-result {
  padding-top: 0;
}

.shipment-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #64748b;
  background: linear-gradient(180deg, #fbfdff, #f8fafc);
  border: 1px dashed #d7e0ec;
  border-radius: 10px;
}

.shipment-empty > span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #3266ad;
  background: #eef6ff;
  border-radius: 12px;
}

.shipment-empty strong {
  color: #243145;
  font-size: 16px;
}

.shipment-empty p {
  margin: 0;
  font-size: 13px;
}

.shipment-detail {
  display: grid;
  gap: 16px;
}

.shipment-detail h2 {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
}

.shipment-detail-table {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 150px minmax(180px, 1fr) 150px minmax(220px, 1.15fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e1e7ef;
  border-radius: 6px;
}

.shipment-label,
.shipment-value {
  min-height: 48px;
  padding: 12px 10px;
  border-right: 1px solid #e7edf5;
  border-bottom: 1px solid #e7edf5;
  font-size: 13px;
}

.shipment-label {
  color: #7a8798;
  background: #f8fafc;
}

.shipment-value {
  color: #243145;
  background: #fff;
  word-break: break-all;
}

.shipment-value.visual {
  min-height: 190px;
  padding: 12px;
}

.shipment-qr {
  display: grid;
  width: 168px;
  gap: 7px;
  padding: 0;
  color: #334155;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: center;
}

.shipment-qr img {
  width: 168px;
  height: 168px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #edf1f6;
}

.shipment-qr span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.shipment-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.shipment-image-card {
  display: grid;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: center;
}

.shipment-image-card span {
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.shipment-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5ebf3;
  border-radius: 4px;
}

.shipment-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.shipment-card {
  min-height: 280px;
  background: #fff;
  border: 1px solid #e1e7ef;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.shipment-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f6;
}

.shipment-card-head strong {
  color: #1f2937;
  font-size: 14px;
}

.shipment-timeline {
  display: grid;
  gap: 0;
  padding: 16px 18px;
}

.shipment-step {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding-left: 26px;
}

.shipment-step::before {
  position: absolute;
  top: 15px;
  bottom: -5px;
  left: 6px;
  width: 1px;
  content: "";
  background: #d7dee8;
}

.shipment-step:last-child::before {
  display: none;
}

.shipment-step i {
  position: absolute;
  top: 3px;
  left: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
}

.shipment-step strong {
  color: #243145;
  font-size: 13px;
}

.shipment-step span {
  color: #7a8798;
  font-size: 12px;
}

.shipment-card-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #9aa6b6;
  font-size: 13px;
}

.shipment-card-empty svg {
  width: 58px;
  height: 58px;
  color: #d6dde7;
}

.admin-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.admin-upload-form .admin-field,
.admin-upload-form .existing-files-section,
.admin-upload-form .upload-warning,
.admin-upload-form .admin-actions {
  grid-column: 1 / -1;
}

.admin-field,
.admin-file,
.admin-select,
.production-form label {
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 13px;
}

.admin-field input,
.admin-select select,
.production-form input,
.production-form select {
  height: 32px;
  padding: 0 10px;
  color: #263244;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 6px;
}

.admin-file {
  grid-template-columns: 22px minmax(98px, auto) minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  cursor: pointer;
}

.admin-file input {
  display: none;
}

.admin-file svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.admin-file strong {
  min-width: 0;
  overflow: hidden;
  color: #263244;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.merchant-create-form,
.merchant-list-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.merchant-create-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  align-items: end;
}

.merchant-create-form .section-head {
  grid-column: 1 / -1;
}

.merchant-create-form .admin-field {
  gap: 5px;
}

.merchant-create-form .admin-field span {
  font-size: 12px;
  font-weight: 700;
}

.merchant-create-form .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 132px;
  height: 32px;
  border-radius: 7px;
  white-space: nowrap;
}

.merchant-create-form .primary-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.merchant-list-panel {
  min-height: 210px;
}

.section-head.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.section-head.compact h2 {
  margin: 0;
  color: #172033;
  font-size: 15px;
}

.section-head.compact span {
  color: #64748b;
  font-size: 12px;
}

.merchant-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e0e8f2;
  border-radius: 8px;
}

.merchant-table-head,
.merchant-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(138px, 0.7fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
}

.merchant-table-head {
  min-height: 34px;
  padding: 0 12px;
  color: #607086;
  background: #f8fafc;
  border-bottom: 1px solid #e5ebf3;
  font-size: 12px;
}

.merchant-row {
  min-height: 50px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
}

.merchant-row:last-child {
  border-bottom: 0;
}

.merchant-row strong,
.merchant-row span {
  display: block;
}

.merchant-row strong {
  color: #172033;
  font-size: 14px;
}

.merchant-row span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.merchant-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.merchant-status.active {
  color: #167144;
  background: #effbf3;
  border: 1px solid #bde9cd;
}

.merchant-status.disabled {
  color: #8a3940;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.merchant-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.merchant-actions .plain-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.merchant-table .admin-empty {
  padding: 18px 16px;
  color: #526176;
  background: #fff;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .workbench-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .merchant-create-form .primary-button {
    width: 100%;
  }
}
}

.upload-warning,
.pattern-guide {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 13px 14px 13px 15px;
  color: #253347;
  background: #fbfdff;
  border: 1px solid #d7e1ee;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.upload-warning::before,
.pattern-guide::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: #2563eb;
  border-radius: 6px 0 0 6px;
}

.upload-warning::before {
  background: #d97706;
}

.notice-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.notice-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notice-head svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: #2563eb;
}

.notice-head strong,
.upload-warning strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.notice-head span,
.upload-warning span {
  color: #475569;
}

.notice-grid {
  display: grid;
  gap: 8px;
}

.notice-grid span {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding-top: 8px;
  color: #334155;
  border-top: 1px solid #edf1f6;
}

.notice-grid em {
  color: #18315c;
  font-style: normal;
  font-weight: 800;
}

.upload-warning {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
}

.upload-warning > div {
  display: grid;
  gap: 3px;
}

.upload-warning svg,
.file-warning svg,
.template-warning svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.template-list-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5ebf3;
}

.template-list-section h2 {
  margin: 0;
  font-size: 15px;
}

.template-table {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.template-table-head,
.template-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 72px 72px 56px minmax(132px, 0.8fr) 292px;
  align-items: center;
  gap: 8px;
}

.template-table-head {
  min-height: 30px;
  padding: 0 9px;
  color: #718096;
  background: #f8fafc;
  border: 1px solid #e5ebf3;
  border-radius: 6px;
  font-size: 12px;
}

.template-row {
  min-height: 50px;
  padding: 6px 9px;
  color: #334155;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  font-size: 12px;
  content-visibility: auto;
  contain-intrinsic-size: 64px;
}

.template-name {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.template-name img,
.template-empty-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  background: #f2f6fb;
  border: 1px solid #dfe6ef;
  border-radius: 6px;
}

.template-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-warning {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #d97706;
  vertical-align: text-bottom;
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.template-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 62px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--blue);
  background: #f4f8ff;
  border: 1px solid #d9e6ff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.template-actions button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.template-actions button span {
  display: inline-block;
}

.upload-page .admin-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.upload-page .admin-head {
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid #e5ebf3;
}

.upload-page .admin-upload-form {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0;
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  overflow: hidden;
  animation: templateFormIn 0.22s ease both;
  transform-origin: top center;
}

.upload-page .admin-upload-form[hidden] {
  display: none;
}

.upload-page .admin-head-actions .primary-button {
  min-height: 34px;
  padding: 0 14px;
  box-shadow: 0 8px 18px rgba(17, 102, 255, 0.16);
}

.upload-page .admin-head-actions .primary-button svg {
  width: 15px;
  height: 15px;
}

@keyframes templateFormIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.template-form-body {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
}

.template-form-main,
.template-rule-panel,
.template-form-section {
  display: grid;
  gap: 12px;
}

.template-form-main {
  min-width: 0;
}

.template-form-section {
  padding: 0 0 14px;
  background: #fff;
  border-bottom: 1px solid #e6edf5;
  border-radius: 0;
}

.template-form-section:last-of-type {
  border-bottom: 0;
}

.template-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 24px;
}

.template-section-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.template-section-head span {
  color: #526176;
  font-size: 12px;
  text-align: right;
}

.upload-page .admin-field,
.upload-page .admin-file {
  color: #334155;
  font-weight: 700;
}

.upload-page .admin-field input {
  height: 34px;
  color: #172033;
  border-color: #d7e0ec;
}

.upload-page .admin-field input::placeholder {
  color: #8a98aa;
}

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

.upload-page .admin-upload-form .admin-field {
  grid-column: auto;
}

.template-form-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e1e8f1;
}

.template-form-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-form-head strong {
  color: #0f172a;
  font-size: 14px;
}

.template-form-head span {
  color: #526176;
  font-size: 12px;
}

.template-form-head .plain-button,
.upload-page .admin-actions .plain-button {
  min-height: 30px;
  padding: 0 10px;
  color: #526176;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
}

.template-form-head svg,
.upload-page .admin-actions .plain-button svg {
  width: 14px;
  height: 14px;
}

.upload-page .admin-upload-form .existing-files-section,
.upload-page .admin-upload-form .admin-actions {
  grid-column: auto;
}

.upload-page .admin-file {
  min-height: 44px;
  background: #fff;
  border-color: #dbe4ef;
  border-radius: 6px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.upload-page .admin-file strong {
  color: #243145;
  font-weight: 800;
}

.upload-page .admin-file:hover {
  border-color: #9cc5ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.06);
  transform: translateY(-1px);
}

.upload-page .admin-file {
  min-height: 58px;
  grid-template-columns: 28px minmax(116px, auto) minmax(0, 1fr);
  padding: 10px 12px;
}

.upload-page .admin-file svg {
  width: 18px;
  height: 18px;
}

.upload-page .admin-file strong {
  justify-self: end;
  max-width: 240px;
  padding: 4px 8px;
  color: #18315c;
  background: #f4f8ff;
  border: 1px solid #dbe8ff;
  border-radius: 6px;
  font-size: 12px;
}

.upload-page .admin-actions .primary-button:disabled,
.upload-page .admin-head-actions .primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
  box-shadow: none;
}

.upload-page .admin-actions .primary-button:disabled svg {
  animation: spin 0.9s linear infinite;
}

.upload-page .template-rule-panel {
  position: sticky;
  top: 78px;
}

.upload-page .upload-warning svg {
  color: #d97706;
}

.upload-page .admin-actions {
  justify-content: flex-start;
  padding-top: 0;
}

.upload-page .admin-actions .primary-button {
  min-height: 34px;
  padding: 0 16px;
}

.template-list-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.template-list-section[hidden] {
  display: none;
}

.template-list-section .section-head {
  min-height: 40px;
  padding: 0 2px;
}

.template-upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.template-upload-progress > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-upload-progress strong,
.template-upload-progress span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-upload-progress strong {
  color: #0f172a;
  font-size: 13px;
}

.template-upload-progress span {
  color: #475569;
  font-size: 12px;
}

.template-upload-progress em {
  color: #0b5fd3;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.template-upload-bar {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: #dfeaff;
  border-radius: 999px;
}

.template-upload-bar i {
  display: block;
  height: 100%;
  background: #1166ff;
  border-radius: inherit;
  transition: width 0.22s ease;
}

.template-upload-progress.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.template-upload-progress.done em {
  color: #148044;
}

.template-upload-progress.done .template-upload-bar {
  background: #dcfce7;
}

.template-upload-progress.done .template-upload-bar i {
  background: #22c55e;
}

.template-upload-progress.error {
  background: #fff7f7;
  border-color: #ffd6d6;
}

.template-upload-progress.error em {
  color: #b42318;
}

.template-upload-progress.error .template-upload-bar i {
  background: #ef4444;
}

.template-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.template-overview span {
  display: grid;
  gap: 4px;
  min-height: 66px;
  align-content: center;
  padding: 10px 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.template-overview em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.template-overview strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.template-table {
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.template-table-head,
.template-row {
  grid-template-columns: minmax(260px, 1.35fr) minmax(110px, 0.6fr) minmax(110px, 0.6fr) minmax(140px, 0.75fr) minmax(160px, 0.8fr) 304px;
  gap: 12px;
}

.template-table-head {
  min-height: 42px;
  padding: 0 12px;
  color: #526176;
  background: #f3f6fa;
  border: 0;
  border-bottom: 1px solid #dce5ef;
  border-radius: 0;
  font-weight: 800;
}

.template-table-head span:last-child {
  width: 304px;
  justify-self: stretch;
  text-align: center;
}

.template-row {
  min-height: 62px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #e8eef5;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.template-row:last-child {
  border-bottom: 0;
}

.template-row:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 #9cc5ff;
}

.template-name {
  grid-template-columns: 42px minmax(0, 1fr);
}

.template-name img,
.template-empty-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.template-name > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-name small,
.template-file-cell small,
.template-status-cell small {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-file-cell,
.template-status-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.template-file-cell strong {
  color: #0f172a;
  font-size: 14px;
}

.template-status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.template-status.ready {
  color: #167144;
  background: #effbf3;
  border: 1px solid #bde9cd;
}

.template-status.warning {
  color: #9a5b00;
  background: #fff8e8;
  border: 1px solid #f5d58b;
}

.template-actions {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  justify-content: stretch;
  justify-items: stretch;
  gap: 8px;
  width: 304px;
  justify-self: stretch;
}

.template-actions button {
  width: 70px;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.template-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.template-actions button.danger {
  color: #dc2626;
  background: #fff5f5;
  border-color: #fecaca;
}

.template-actions button.danger:hover {
  background: #fee2e2;
}

.template-delete-dialog {
  position: relative;
  display: grid;
  width: min(420px, 92vw);
  overflow: hidden;
  color: #172033;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.24);
  animation: templateDeleteIn 0.18s ease both;
}

.template-delete-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid #eef2f7;
}

.template-delete-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.template-delete-head strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.template-delete-head span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-delete-body {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 18px;
  background: #fff;
}

.template-delete-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #b42318;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.template-delete-icon svg {
  width: 18px;
  height: 18px;
}

.template-delete-body div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.template-delete-body strong {
  color: #111827;
  font-size: 14px;
}

.template-delete-body p {
  margin: 0;
  color: #5b6678;
  font-size: 13px;
  line-height: 1.65;
}

.template-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
}

.template-delete-actions .plain-button {
  justify-content: center;
  min-width: 82px;
  min-height: 34px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  font-weight: 800;
}

.template-delete-actions .plain-button.red {
  color: #fff;
  background: #c92a2a;
  border-color: #c92a2a;
}

.template-delete-actions .plain-button.red:hover {
  background: #a61e1e;
  border-color: #a61e1e;
}

@keyframes templateDeleteIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1200px) {
  .upload-page .admin-upload-form {
    grid-template-columns: 1fr;
  }

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

  .upload-page .template-rule-panel {
    position: static;
  }

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

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

  .template-table {
    overflow-x: auto;
  }

  .template-table-head,
  .template-row {
    min-width: 1120px;
  }
}

.records-grid {
  display: grid;
  gap: 14px;
  max-width: 100%;
  margin: 0 auto;
}

.records-empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px 20px;
  color: #4d5f76;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #cfd9e6;
  border-radius: 8px;
}

.records-empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--blue);
  background: #edf5ff;
  border: 1px solid #d7e7ff;
  border-radius: 8px;
}

.records-empty-icon svg {
  width: 24px;
  height: 24px;
}

.records-empty-state strong {
  color: #1f2937;
  font-size: 18px;
}

.records-empty-state p {
  max-width: 520px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.records-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.records-kpi-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.records-kpi {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 9px;
  min-height: 78px;
  align-content: center;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.records-kpi svg {
  grid-row: 1 / 4;
  align-self: center;
  width: 22px;
  height: 22px;
  color: #3266ad;
}

.records-kpi em,
.records-kpi small {
  overflow: hidden;
  color: #64748b;
  font-style: normal;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-kpi strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.records-kpi.done {
  background: #f2fbf5;
  border-color: #ccefd8;
}

.records-kpi.done svg,
.records-kpi.done strong {
  color: #148044;
}

.records-kpi.running {
  background: #eef6ff;
  border-color: #c6dcff;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  content-visibility: auto;
  contain-intrinsic-size: 280px;
}

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

.record-head span,
.record-foot {
  color: #718096;
  font-size: 11px;
}

.record-head strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
}

.record-title-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.record-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-meta-chips em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  color: #31506f;
  background: #f4f8fc;
  border: 1px solid #dce7f3;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}

.record-preview-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 126px;
  padding: 2px 0 12px;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.record-preview-strip figure {
  display: grid;
  gap: 4px;
  width: 84px;
  flex: 0 0 84px;
  margin: 0;
}

.record-preview-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f2f6fb;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.record-preview-strip figcaption {
  overflow: hidden;
  color: #526176;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-empty-preview {
  display: grid;
  min-height: 106px;
  place-items: center;
  color: #7a8798;
  background: #f8fafc;
  border: 1px dashed #d8e1ed;
  border-radius: 8px;
}

.record-asset-section {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 0;
  border-top: 0;
}

.record-asset-sections {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(260px, 0.95fr) minmax(320px, 1.2fr);
  gap: 12px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #e5ebf3;
}

.record-generate {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid #dbe8fb;
  border-radius: 8px;
}

.record-generate-head,
.record-generate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.record-generate-head strong {
  color: #1e3a8a;
  font-size: 12px;
}

.record-generate-head span {
  color: #64748b;
  font-size: 11px;
}

.record-size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-size-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  color: #334155;
  background: #fff;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.record-size-options input {
  width: 13px;
  height: 13px;
  accent-color: var(--blue);
}

.record-size-options em {
  margin-left: 4px;
  color: #16a34a;
  font-style: normal;
  font-size: 11px;
}

.record-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.record-section-title strong {
  color: #334155;
  font-size: 12px;
}

.record-section-title span {
  color: #94a3b8;
  font-size: 11px;
  flex: 1;
}

.record-section-actions {
  display: flex;
  gap: 8px;
}

.text-button {
  padding: 2px 5px;
  color: var(--blue);
  font-size: 11px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.text-button:hover {
  background: #f0f6ff;
}

.record-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.record-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.record-check span {
  display: none;
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 2px;
}

.record-check:hover {
  border-color: var(--blue);
  background: #fff;
}

.record-check input:checked ~ span {
  display: block;
}

.record-check input:checked {
  border-color: var(--blue);
}

.record-preview-strip figure {
  position: relative;
  display: grid;
  gap: 4px;
  width: 84px;
  flex: 0 0 84px;
  margin: 0;
  cursor: pointer;
}

.record-preview-strip figure img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f2f6fb;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.record-preview-strip figure:hover img {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(17, 102, 255, 0.15);
}

.record-hover-preview {
  display: none !important;
}

.record-preview-strip figure:hover .record-hover-preview {
  display: none;
}

.record-preview-strip figure:hover .record-hover-preview img {
  width: 100%;
  max-height: 300px;
  aspect-ratio: auto;
  object-fit: contain;
  border: 0;
  box-shadow: none;
  transform: none;
}

.record-preview-strip figure button {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transition: all 0.15s ease;
}

.record-preview-strip figure:hover button {
  opacity: 1;
}

.record-preview-strip figure button svg {
  width: 12px;
  height: 12px;
  color: var(--blue);
}

.record-preview-strip figure button:hover {
  background: var(--blue);
}

.record-preview-strip figure button:hover svg {
  color: #fff;
}

.record-placeholder {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0;
}

.placeholder-content {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 84px;
  aspect-ratio: 1;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.record-progress {
  display: grid;
  gap: 4px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e5ebf3;
  border-radius: 6px;
  font-size: 12px;
}

.record-progress span {
  color: #64748b;
  font-weight: 500;
}

.record-progress > div {
  position: relative;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.record-progress > div > i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.record-progress.running {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.record-progress.running span {
  color: var(--blue);
}

.record-progress.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.record-progress.done span {
  color: #16a34a;
}

.record-progress.done > div > i {
  background: #22c55e;
}

.record-progress.error {
  background: #fef2f2;
  border-color: #fecaca;
}

.record-progress.error span {
  color: #dc2626;
}

.record-progress.error > div > i {
  background: #ef4444;
}

.record-progress.skipped {
  background: #fafafa;
  border-color: #e5e7eb;
}

.record-progress.skipped span {
  color: #9ca3af;
}

.record-progress.skipped > div {
  display: none;
}

.record-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.record-actions .plain-button {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.record-actions .plain-button,
.record-generate-actions .plain-button {
  min-height: 28px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
}

.record-actions .plain-button.blue,
.record-generate-actions .plain-button.blue {
  background: #f4f8ff;
  border-color: #d7e6ff;
}

.record-card {
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border-color: #d6e0ec;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.record-head {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4ebf4;
}

.record-title-block {
  gap: 6px;
}

.record-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.record-job-no {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.record-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #dce5ef;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.record-status-badge svg {
  width: 13px;
  height: 13px;
}

.record-status-badge.done {
  color: #167144;
  background: #effbf3;
  border-color: #bde9cd;
}

.record-status-badge.running {
  color: #0b5fd3;
  background: #eef6ff;
  border-color: #c6dcff;
}

.record-status-badge.warning {
  color: #9a5b00;
  background: #fff8e8;
  border-color: #f5d58b;
}

.record-status-badge.error {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffccc7;
}

.record-status-badge.idle {
  color: #526176;
  background: #f6f8fb;
}

.record-title-block > strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
}

.record-title-block > span {
  color: #64748b;
  font-size: 12px;
}

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

.record-metric {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e1e8f1;
  border-radius: 8px;
}

.record-metric span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.record-metric strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1.1;
}

.record-metric em {
  overflow: hidden;
  color: #718096;
  font-style: normal;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-metric.done {
  background: #f2fbf5;
  border-color: #ccefd8;
}

.record-metric.done strong {
  color: #148044;
}

.record-metric.warning {
  background: #fff9ed;
  border-color: #f4d69a;
}

.record-metric.warning strong {
  color: #a45f00;
}

.record-progress {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
}

.record-progress span {
  font-size: 12px;
}

.record-progress > div {
  height: 5px;
}

.record-generate {
  gap: 10px;
  padding: 12px;
  background: #f9fbfe;
  border-color: #d7e2f0;
}

.record-generate-head {
  align-items: flex-start;
}

.record-generate-head > div {
  display: grid;
  gap: 3px;
}

.record-generate-head strong {
  color: #18315c;
  font-size: 13px;
}

.record-generate-head em {
  color: #475569;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.record-size-options {
  gap: 8px;
}

.record-size-options label {
  min-height: 34px;
  padding: 0 11px;
  border-color: #d9e2ef;
  border-radius: 8px;
  font-weight: 700;
}

.record-size-options label.done {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.record-size-options label.pending {
  color: #334155;
  background: #ffffff;
}

.record-size-options label:has(input:checked) {
  border-color: #6aa6ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
}

.record-size-options span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.record-size-options em {
  margin-left: 0;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
}

.record-generate-actions {
  justify-content: flex-start;
}

.record-generate-actions .plain-button {
  min-height: 32px;
  padding: 0 11px;
}

.record-generate-actions .plain-button:disabled,
.record-size-options input:disabled ~ span {
  opacity: 0.55;
  cursor: not-allowed;
}

.record-output-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.record-output-head strong {
  color: #0f172a;
  font-size: 14px;
}

.record-output-head span {
  color: #64748b;
  font-size: 12px;
}

.record-asset-sections {
  grid-template-columns: minmax(220px, 0.8fr) minmax(240px, 0.85fr) minmax(380px, 1.35fr);
  gap: 10px;
  padding-top: 0;
  border-top: 0;
}

.record-asset-section {
  gap: 9px;
  min-height: 172px;
  padding: 10px;
  background: #fbfdff;
  border: 1px solid #e1e8f1;
  border-radius: 8px;
}

.record-section-title {
  align-items: flex-start;
  min-height: 34px;
}

.record-section-title > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-section-title strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #18315c;
  font-size: 12px;
}

.record-section-title strong svg {
  width: 14px;
  height: 14px;
  color: #3266ad;
}

.record-section-title span {
  color: #7a8798;
  font-size: 11px;
  flex: none;
}

.record-section-title > em {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: #475569;
  background: #eef3f8;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.record-section-actions {
  flex: 0 0 auto;
}

.record-preview-strip {
  gap: 8px;
  min-height: 116px;
  padding: 0 0 8px;
}

.record-preview-strip figure {
  width: 92px;
  flex-basis: 92px;
}

.record-preview-strip figure > img {
  height: 92px;
  aspect-ratio: auto;
}

.record-preview-strip figcaption {
  display: grid;
  gap: 2px;
}

.record-preview-strip figcaption strong {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-preview-strip figcaption small {
  color: #7a8798;
  font-size: 10px;
}

.record-empty-preview {
  min-height: 98px;
  width: 100%;
  color: #64748b;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12px;
}

.placeholder-content {
  width: 92px;
  height: 92px;
  aspect-ratio: auto;
}

.record-foot {
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #e4ebf4;
}

@media (max-width: 900px) {
  .record-head,
  .record-output-head,
  .record-foot {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

.records-batch-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.records-batch-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.records-batch-toolbar strong {
  color: #0f172a;
  font-size: 14px;
}

.records-batch-toolbar span {
  color: #64748b;
  font-size: 12px;
}

.records-batch-stats,
.records-batch-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.records-batch-stats em {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  color: #334155;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.records-batch-actions .plain-button,
.record-download-cell .plain-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.records-batch-actions .plain-button.blue,
.record-download-cell .plain-button.blue {
  color: #0b5fd3;
  background: #f4f8ff;
  border-color: #cfe0ff;
}

.records-batch-actions .plain-button.dark,
.record-download-cell .plain-button.dark {
  color: #fff;
  background: #18315c;
  border-color: #18315c;
}

.records-batch-actions .plain-button.red,
.record-download-cell .plain-button.red {
  color: #b42318;
  background: #fff7f7;
  border-color: #ffd6d6;
}

.records-production-list {
  display: grid;
  gap: 0;
  overflow: visible;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.records-list-head,
.record-production-row {
  display: grid;
  grid-template-columns: 34px minmax(112px, 0.48fr) minmax(190px, 0.9fr) minmax(190px, 0.95fr) minmax(220px, 0.88fr) minmax(240px, 1.05fr) minmax(260px, 0.95fr);
  align-items: center;
  gap: 12px;
}

.records-list-head {
  min-height: 42px;
  padding: 0 12px;
  color: #526176;
  background: #f3f6fa;
  border-bottom: 1px solid #dce5ef;
  font-size: 12px;
}

.records-list-head strong {
  font-size: 12px;
  font-weight: 800;
}

.record-production-row.record-card {
  gap: 12px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #e5ebf3;
  border-radius: 0;
  box-shadow: none;
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.record-production-row:last-child {
  border-bottom: 0;
}

.record-production-row:hover {
  background: #fbfdff;
}

.record-image-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.record-main-preview {
  position: relative;
  display: grid;
  width: 104px;
  height: 82px;
  place-items: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

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

.record-main-preview span {
  position: absolute;
  inset: auto 6px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.record-main-preview span svg {
  width: 13px;
  height: 13px;
}

.record-main-preview:hover {
  border-color: #9cc5ff;
  box-shadow: 0 8px 20px rgba(17, 102, 255, 0.14);
  transform: translateY(-1px);
}

.record-main-preview:hover span {
  opacity: 1;
  transform: translateY(0);
}

.record-main-preview.empty {
  color: #94a3b8;
  cursor: not-allowed;
}

.record-main-preview.empty span {
  position: static;
  color: #94a3b8;
  background: transparent;
  opacity: 1;
  transform: none;
}

.record-main-preview.empty em {
  color: #94a3b8;
  font-style: normal;
  font-size: 11px;
}

.record-preview-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.record-preview-counts small {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  color: #64748b;
  background: #f6f8fb;
  border: 1px solid #e3eaf3;
  border-radius: 4px;
  font-size: 10px;
}

.record-preview-open {
  width: max-content;
  padding: 1px 4px;
  font-weight: 800;
}

.art-record-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.art-record-head,
.art-record-row.record-card {
  display: grid;
  grid-template-columns: 34px 74px minmax(240px, 1fr) minmax(110px, 0.28fr) 240px;
  align-items: center;
  gap: 10px;
}

.art-record-head {
  min-height: 36px;
  padding: 0 12px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e5ebf3;
  font-size: 12px;
  font-weight: 800;
}

.art-record-head strong:last-child {
  text-align: center;
}

.art-record-row.record-card {
  min-height: 58px;
  padding: 6px 12px;
  border: 0;
  border-bottom: 1px solid #e5ebf3;
  border-radius: 0;
  box-shadow: none;
}

.art-record-row .record-main-preview {
  width: 56px;
  height: 44px;
  border-radius: 6px;
}

.art-record-row .record-style-cell {
  gap: 2px;
}

.art-record-row .record-style-cell strong {
  font-size: 13px;
}

.art-record-row .record-style-cell span,
.art-record-row .record-style-cell small {
  font-size: 11px;
}

.art-record-row .record-file-cell {
  display: block;
}

.art-record-row .record-download-cell {
  gap: 5px;
  justify-content: center;
}

.art-record-row .record-download-cell .plain-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.art-record-file-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  color: #17345e;
  background: #f7faff;
  border: 1px solid #dce7f5;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.art-record-file-pill strong {
  color: #0f172a;
  font-size: 15px;
}

.art-record-file-pill em {
  color: #64748b;
  font-style: normal;
}

.art-record-row.record-card:last-child {
  border-bottom: 0;
}

.art-record-row.record-card:hover {
  background: #fbfdff;
}

.art-record-batch-toolbar {
  margin-bottom: 10px;
  padding: 9px 12px;
}

.art-record-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 10px;
  color: #64748b;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  font-size: 12px;
}

.art-record-pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.art-record-pager em {
  color: #334155;
  font-style: normal;
  font-weight: 800;
}

.art-record-pager .plain-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.record-row-select {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.record-row-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.record-row-select span {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1.5px solid #b9c6d6;
  border-radius: 4px;
}

.record-row-select input:checked + span,
.record-row-select input:indeterminate + span {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
}

.record-order-cell,
.record-style-cell,
.record-status-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.record-order-cell strong,
.record-style-cell strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-order-cell small,
.record-style-cell small,
.record-style-cell span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-file-cell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.record-file-stat {
  display: grid;
  min-height: 54px;
  align-content: center;
  gap: 2px;
  padding: 7px 8px;
  background: #f8fafc;
  border: 1px solid #e1e8f1;
  border-radius: 6px;
}

.record-file-stat em,
.record-file-stat small {
  overflow: hidden;
  color: #64748b;
  font-style: normal;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-file-stat strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.1;
}

.record-file-stat.done {
  background: #f0fdf4;
  border-color: #ccefd8;
}

.record-file-stat.warning {
  background: #fff9ed;
  border-color: #f4d69a;
}

.record-status-cell .record-progress {
  min-height: 0;
  padding: 7px 9px;
}

.record-status-cell .record-generate {
  margin-top: 2px;
  padding: 8px;
  border-radius: 6px;
}

.record-status-cell .record-generate-head span,
.record-status-cell .record-generate-head em {
  display: none;
}

.record-status-cell .record-size-options {
  max-height: 74px;
  overflow: auto;
  gap: 5px;
}

.record-status-cell .record-size-options label {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
}

.record-status-cell .record-generate-actions {
  gap: 6px;
}

.record-status-cell .record-generate-actions .plain-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

.record-download-cell {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  min-width: 0;
}

.record-download-cell .plain-button {
  justify-content: center;
}

.record-more-wrap {
  position: relative;
  width: 112px;
}

.record-more-button {
  width: 100%;
}

.record-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 224px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.record-more-menu[hidden] {
  display: none;
}

.record-more-menu button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px;
  color: #243145;
  border-radius: 6px;
  text-align: left;
}

.record-more-menu button:hover {
  background: #f4f8ff;
}

.record-more-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.record-more-menu button.danger {
  color: #b42318;
}

.record-more-menu svg {
  width: 16px;
  height: 16px;
}

.record-more-menu span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-more-menu strong,
.record-more-menu em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-more-menu strong {
  font-size: 12px;
}

.record-more-menu em {
  color: #64748b;
  font-style: normal;
  font-size: 11px;
}

@media (max-width: 1320px) {
  .records-list-head {
    display: none;
  }

  .record-production-row.record-card {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: flex-start;
    border-bottom: 1px solid #dce5ef;
  }

  .record-image-cell,
  .record-order-cell,
  .record-style-cell,
  .record-file-cell,
  .record-status-cell,
  .record-download-cell {
    grid-column: 2;
  }

  .record-main-preview {
    width: min(220px, 100%);
    height: 132px;
  }

  .record-download-cell {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .records-kpi-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .records-batch-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .records-batch-stats,
  .records-batch-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 620px) {
  .records-kpi-bar {
    grid-template-columns: 1fr;
  }
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
}

.image-preview-content {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(760px, 88vw);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

.image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.image-preview-header strong {
  color: #1f2937;
  font-size: 14px;
}

.image-preview-body {
  display: grid;
  place-items: center;
  padding: 24px;
  min-height: 320px;
  overflow: auto;
  background: #f9fafb;
}

.image-preview-body img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.record-preview-content {
  width: min(980px, 92vw);
}

.record-preview-header {
  align-items: center;
}

.record-preview-header > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-preview-header span {
  color: #64748b;
  font-size: 12px;
}

.record-preview-header strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.record-preview-header-actions .plain-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  background: #f4f8ff;
  font-size: 12px;
  font-weight: 800;
}

.record-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: min(560px, calc(100vh - 150px));
  overflow: hidden;
}

.record-preview-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  background: #f3f6fa;
  border-right: 1px solid #e1e8f1;
}

.record-preview-stage-image {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 22px;
  overflow: auto;
}

.record-preview-stage-image img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.record-preview-stage-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e1e8f1;
}

.record-preview-stage-meta span {
  color: #3266ad;
  font-size: 12px;
  font-weight: 800;
}

.record-preview-stage-meta strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-preview-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
}

.record-preview-group {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f6;
}

.record-preview-group:last-child {
  border-bottom: 0;
}

.record-preview-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.record-preview-group-head strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #18315c;
  font-size: 13px;
}

.record-preview-group-head svg {
  width: 15px;
  height: 15px;
  color: #3266ad;
}

.record-preview-group-head span,
.record-preview-group p {
  color: #64748b;
  font-size: 11px;
}

.record-preview-group p {
  margin: 0;
  line-height: 1.45;
}

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

.record-preview-thumbs button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 6px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.record-preview-thumbs button:hover,
.record-preview-thumbs button.active {
  border-color: #6aa6ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.08);
  transform: translateY(-1px);
}

.record-preview-thumbs img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  contain: strict;
}

.record-preview-thumbs span {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-preview-thumbs em {
  grid-column: 1 / -1;
  display: grid;
  min-height: 52px;
  place-items: center;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #d7e0ec;
  border-radius: 8px;
  font-style: normal;
  font-size: 12px;
}

.record-action-modal.small .record-action-content {
  width: min(420px, 92vw);
}

.record-action-modal.medium .record-action-content {
  width: min(720px, 94vw);
}

.record-action-content {
  max-height: calc(100vh - 60px);
}

.record-action-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-action-header span {
  color: #64748b;
  font-size: 12px;
}

.record-action-header strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-action-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
  background: #fff;
}

.record-dialog-intro {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.record-dialog-intro strong {
  color: #0f172a;
  font-size: 14px;
}

.record-dialog-intro span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.record-dialog-toolbar,
.record-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.record-dialog-toolbar {
  padding: 8px 0;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
}

.record-dialog-actions {
  justify-content: flex-end;
}

.record-size-choice-grid,
.record-download-choice-grid {
  display: grid;
  gap: 8px;
}

.record-size-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.record-size-choice,
.record-download-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.record-size-choice input,
.record-download-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.record-size-choice span,
.record-download-choice span {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
}

.record-size-choice.selected span,
.record-download-choice.selected span {
  border-color: #6aa6ff;
  box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.09);
}

.record-size-choice.done span {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.record-size-choice.pending span {
  background: #fff;
}

.record-size-choice strong,
.record-download-choice strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-size-choice em,
.record-download-choice em {
  color: #64748b;
  font-style: normal;
  font-size: 11px;
}

.record-size-choice.done em {
  color: #148044;
}

.record-size-choice.pending em {
  color: #9a5b00;
}

.record-download-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-download-choice span {
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
}

.record-download-choice svg {
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  color: #3266ad;
}

.record-dialog-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d7e0ec;
  border-radius: 8px;
  font-size: 13px;
}

.record-production-image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.record-production-thumb {
  display: grid;
  gap: 7px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.record-production-thumb:hover {
  border-color: #8ab7ff;
  box-shadow: 0 10px 22px rgba(17, 102, 255, 0.11);
}

.record-production-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
}

.record-production-thumb span {
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-dialog-actions .plain-button.red {
  color: #b42318;
  background: #fff7f7;
  border-color: #ffd6d6;
}

.record-delete-confirm {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: #fff7f7;
  border: 1px solid #ffd6d6;
  border-radius: 8px;
}

.record-delete-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #b42318;
  background: #fff;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
}

.record-delete-icon svg {
  width: 19px;
  height: 19px;
}

.record-delete-confirm strong {
  color: #7f1d1d;
  font-size: 15px;
}

.record-delete-confirm p {
  margin: 4px 0 0;
  color: #7a3540;
  font-size: 12px;
  line-height: 1.6;
}

.record-delete-meta {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
}

.record-delete-meta span,
.record-delete-meta em {
  color: #64748b;
  font-style: normal;
  font-size: 11px;
}

.record-delete-meta strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .record-size-choice-grid,
  .record-download-choice-grid,
  .record-production-image-grid,
  .art-record-row.record-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .shipment-scan-bar,
  .shipment-bottom-grid {
    grid-template-columns: 1fr;
  }

  .shipment-detail-table {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .shipment-value.visual {
    min-height: 0;
  }

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

@media (max-width: 900px) {
  .record-preview-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .record-preview-stage {
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid #e1e8f1;
  }

  .record-preview-side {
    max-height: none;
  }
}

.production-layout {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 18px;
  align-items: start;
}

.production-side {
  display: grid;
  gap: 8px;
}

.production-tab {
  height: 34px;
  padding: 0 10px;
  color: #506176;
  text-align: left;
  background: #f8fafc;
  border-radius: 6px;
}

.production-tab.active {
  color: #098477;
  background: #e9fbf6;
}

.production-config {
  display: grid;
  gap: 14px;
}

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

.production-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.production-size-row button {
  height: 30px;
  padding: 0 12px;
  color: #526176;
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-radius: 6px;
}

.production-size-row button.active {
  color: #098477;
  border-color: #5bd8c7;
  background: #e9fbf6;
}

.production-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.production-table th,
.production-table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #e5ebf3;
}

.production-table th {
  color: #526176;
  background: #f8fafc;
}

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

.production-canvas-wrap {
  display: grid;
  justify-content: start;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
}

.production-canvas-wrap canvas {
  width: 520px;
  height: 720px;
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  padding: 9px 14px;
  color: #fff;
  background: rgba(27, 38, 54, 0.92);
  border-radius: 999px;
  font-size: 13px;
  transform: translateX(-50%);
}

.context-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  width: 168px;
  padding: 6px 0;
  color: #263244;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(23, 31, 45, 0.18);
  font-size: 13px;
}

.context-menu[hidden] {
  display: none;
}

.context-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 29px;
  padding: 0 10px;
  text-align: left;
}

.context-item:hover:not(:disabled) {
  background: #f3f7ff;
}

.context-item.disabled {
  color: #8b97a8;
  cursor: default;
}

.context-item.danger {
  color: #f04438;
}

.context-item kbd {
  color: #a6b0bf;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
}

.context-item svg {
  width: 14px;
  height: 14px;
  color: #6f7c8f;
}

.context-submenu {
  position: absolute;
  left: calc(100% - 4px);
  top: 0;
  display: grid;
  width: 132px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(23, 31, 45, 0.18);
}

.context-submenu[hidden] {
  display: none;
}

.context-submenu button {
  min-height: 29px;
  padding: 0 10px;
  color: #263244;
  text-align: left;
  font-size: 13px;
}

.context-submenu button:hover {
  color: var(--blue);
  background: #f3f7ff;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}

.preview-modal-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(520px, 88vw);
  max-height: calc(100vh - 48px);
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.28);
}

.preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding-bottom: 10px;
  color: #263244;
  font-size: 14px;
}

.preview-modal-grid {
  min-height: 0;
  overflow: hidden;
}

.preview-modal-viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.preview-modal-stage {
  position: relative;
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  background: #f6f8fb;
  border-radius: 2px;
}

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

.preview-modal-name {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 7px;
  min-height: 24px;
  max-width: calc(100% - 36px);
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--blue);
  border-radius: 999px;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.preview-modal-name svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.preview-modal-thumbs {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 2px 0;
}

.preview-modal-thumb {
  position: relative;
  display: grid;
  width: 68px;
  height: 70px;
  place-items: end stretch;
  overflow: hidden;
  padding: 0;
  color: #fff;
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  cursor: pointer;
}

.preview-modal-thumb.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
}

.preview-modal-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-modal-thumb span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 18px 4px 8px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.72));
  border-radius: inherit;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 1px 8px rgba(15, 23, 42, 0.45);
}

.preview-modal-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: #687789;
  background: #f7f9fc;
  border: 1px solid #e3eaf3;
  border-radius: 6px;
  font-size: 13px;
}

@media (max-width: 1500px) {
  html,
  body {
    min-width: 1180px;
  }

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

  .settings-panel {
    min-width: 300px;
  }

  .preview-wrap {
    width: min(100%, 260px);
  }

  .preview-wrap.preview-portrait {
    width: min(100%, 235px);
  }

  .preview-panel-head,
  .material-quick-actions {
    width: min(100%, 260px);
  }

  .editor-stage {
    padding-inline: 24px;
  }

  .canvas-shell {
    width: min(620px, 94%);
    padding-left: 64px;
  }

  .canvas-card {
    width: min(560px, 100%);
  }
}

@media (max-width: 1280px) {
  .template-table-head,
  .template-row {
    grid-template-columns: minmax(260px, 1.35fr) minmax(110px, 0.6fr) minmax(110px, 0.6fr) minmax(140px, 0.75fr) minmax(160px, 0.8fr) 184px;
  }

  .template-actions {
    grid-template-columns: repeat(4, 40px);
    width: 184px;
  }

  .template-table-head span:last-child {
    width: 184px;
  }

  .template-actions button {
    width: 40px;
    min-width: 0;
    padding: 0 7px;
  }

  .template-actions button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  html,
  body {
    min-width: 0;
    overflow: auto;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .app-shell.admin-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .app-shell.admin-active .erp-sidebar {
    grid-column: 1;
    grid-row: 2;
    grid-template-rows: auto;
    max-height: none;
  }

  .app-shell.admin-active .erp-brand {
    min-height: 46px;
  }

  .app-shell.admin-active .erp-menu {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
  }

  .app-shell.admin-active .erp-menu section {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }

  .app-shell.admin-active .erp-menu-head {
    display: none;
  }

  .app-shell.admin-active .erp-menu-item {
    display: inline-grid;
    min-height: 34px;
    max-height: 34px;
    padding: 0 12px;
    border-radius: 4px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .app-shell.admin-active .topbar {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .app-shell.admin-active .admin-page {
    grid-column: 1;
    grid-row: 3;
  }

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

  .workbench-actions,
  .workbench-actions .plain-button,
  .workbench-actions .primary-button {
    width: 100%;
  }

  .workbench-kpis {
    grid-template-columns: 1fr;
  }

  .workbench-record-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .workbench-record-row > em,
  .workbench-template-row > em {
    grid-column: 2;
    justify-self: start;
  }

  .workbench-shortcuts {
    grid-template-columns: 1fr;
  }

  .brand {
    justify-content: space-between;
  }

  .brand-text {
    gap: 22px;
  }

  .top-actions,
  .save-actions {
    justify-content: space-between;
  }

  .workspace {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .tool-rail {
    grid-row: 1 / span 3;
  }

  .left-panel,
  .canvas-zone,
  .settings-panel {
    min-width: 0;
  }

  .left-panel {
    max-height: 420px;
  }

  .canvas-zone,
  .settings-panel {
    grid-column: 2;
  }

  .canvas-zone {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .editor-stage {
    padding: 14px 8px 18px;
    overflow: visible;
  }

  .canvas-shell {
    width: 100%;
    padding-left: 0;
    gap: 10px;
    aspect-ratio: auto;
  }

  .face-strip {
    position: static;
    width: auto;
    max-height: none;
    flex-direction: row;
    justify-content: center;
    padding: 6px 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    order: 1;
  }

  .canvas-card {
    order: 2;
    width: 100%;
  }

  .canvas-hint {
    top: 34px;
  }

  .canvas-hint h1 {
    font-size: 21px;
  }

  .canvas-hint p {
    font-size: 13px;
  }

  .canvas-footer {
    grid-template-columns: 1fr;
    gap: 6px;
    justify-items: center;
    padding-bottom: 44px;
  }

  .print-tip {
    left: 50%;
    width: min(210px, 86%);
    transform: translateX(-50%);
  }

  .zoom-control {
    right: 50%;
    transform: translateX(50%);
  }

  .material-action-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

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


/* 现有文件列表样式 */
.existing-files-section {
  margin: 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
}

.existing-files-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

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

.file-section {
  min-width: 0;
  margin-bottom: 0;
}

.file-section:last-child {
  margin-bottom: 0;
}

.file-section h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.file-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 6px 4px 8px;
  background: white;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.file-warning {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: #b45309;
  font-size: 11px;
}

.file-name {
  max-width: 180px;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  padding: 0;
  font-size: 0;
  border-radius: 4px;
  transition: all 0.15s;
}

.delete-file-btn:hover {
  background: #fee;
}

.delete-file-btn svg {
  width: 14px;
  height: 14px;
}

.plain-button.red {
  color: #ef4444;
}

.plain-button.red:hover {
  background: #fee;
  color: #dc2626;
}

.template-delete-actions .plain-button.red {
  color: #fff;
  background: #c92a2a;
  border-color: #c92a2a;
}

.template-delete-actions .plain-button.red:hover {
  color: #fff;
  background: #a61e1e;
  border-color: #a61e1e;
}
