@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede7;
  --ink: #212124;
  --text: #212124;
  --muted: #706a62;
  --line: #ddd8cd;
  --accent: #f00643;
  --accent-2: #141414;
  --green: #2d7a54;
  --amber: #b46611;
  --red: #d71948;
  --shadow: 0 16px 42px rgba(20, 20, 20, 0.08);
  --radius: 8px;
  --font-sans: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --blue: #f00643;
  --motion-quick: 120ms;
  --motion-fast: 190ms;
  --motion-medium: 260ms;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.36, 0.64, 1);
  --control-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
  --control-shadow-hover: 0 8px 18px rgba(20, 20, 20, 0.09);
  --focus-ring: 0 0 0 3px rgba(240, 6, 67, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
}

.login-mode {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #ebe9e2;
}

.login-view {
  width: min(440px, calc(100vw - 32px));
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 210px;
  max-width: 100%;
  background: transparent;
}

[hidden] {
  display: none !important;
}

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

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

button,
summary {
  transition:
    transform var(--motion-quick) var(--ease-smooth),
    background-color var(--motion-fast) var(--ease-smooth),
    border-color var(--motion-fast) var(--ease-smooth),
    box-shadow var(--motion-fast) var(--ease-smooth),
    color var(--motion-fast) var(--ease-smooth),
    filter var(--motion-fast) var(--ease-smooth);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:not(:disabled):active,
summary:active {
  transform: translateY(1px) scale(0.985);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  padding: 18px 14px;
  background: #141414;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.brand-logo {
  width: 204px;
  max-width: 100%;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.brand-subtitle,
.eyebrow {
  font-size: 12px;
  color: var(--muted);
}

.sidebar .brand-subtitle,
.sidebar .eyebrow {
  color: #c8c1b7;
}

.nav-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  display: grid;
  gap: 12px;
  align-content: start;
  scrollbar-color: #f00643 transparent;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-group + .nav-group {
  padding-top: 10px;
  border-top: 1px solid rgba(235, 233, 226, 0.16);
}

.nav-group-title {
  padding: 0 10px 3px;
  color: #a7a097;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: #f7f4ef;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  position: relative;
}

.nav-item:hover {
  background: rgba(240, 6, 67, 0.14);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--accent);
}

.nav-item.active {
  color: #fff;
  box-shadow: inset 3px 0 0 #ffffff;
}

.nav-item.active:hover {
  transform: none;
}

.version-box {
  flex: 0 0 auto;
  margin-top: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(235, 233, 226, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.version-box span {
  color: #c8c1b7;
  font-size: 12px;
}

.logout-btn {
  flex: 0 0 auto;
  margin-top: 0;
  border: 1px solid rgba(235, 233, 226, 0.22);
}

.logout-btn + .version-box {
  margin-top: 0;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: inherit;
}

.hidden-by-role {
  display: none !important;
}

.readonly-by-role {
  opacity: 0.62;
  cursor: not-allowed !important;
}

.main {
  min-width: 0;
  padding: 18px 22px 28px;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.back-to-top:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: #c90038;
  border-color: #c90038;
  box-shadow: 0 12px 28px rgba(20, 20, 20, 0.24);
}

.back-to-top:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring), 0 10px 24px rgba(20, 20, 20, 0.18);
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 17px;
}

.global-search {
  display: grid;
  grid-template-columns: auto minmax(240px, 360px) auto;
  gap: 8px;
  align-items: center;
}

label {
  display: grid;
  gap: 5px;
  color: #36322d;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  outline: none;
  box-shadow: var(--control-shadow);
  transition:
    border-color var(--motion-fast) var(--ease-smooth),
    box-shadow var(--motion-fast) var(--ease-smooth),
    background-color var(--motion-fast) var(--ease-smooth),
    color var(--motion-fast) var(--ease-smooth);
}

input:hover:not(:disabled):not([readonly]),
select:hover:not(:disabled),
textarea:hover:not(:disabled):not([readonly]) {
  border-color: #b8afa4;
  box-shadow: var(--control-shadow-hover);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring), var(--control-shadow-hover);
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23706a62' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

input[type="range"] {
  width: 170px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
  cursor: ew-resize;
}

input[type="range"]:hover:not(:disabled) {
  box-shadow: none;
}

input[type="range"]:focus-visible {
  border: 0;
  box-shadow: none;
  outline: 2px solid rgba(240, 6, 67, 0.34);
  outline-offset: 3px;
}

input[type="number"].no-spin {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"].no-spin::-webkit-outer-spin-button,
input[type="number"].no-spin::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

input[readonly] {
  background: #eeebe5;
  color: #4c4740;
  box-shadow: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #e9e6df;
  color: #8a837a;
  cursor: not-allowed;
  box-shadow: none;
}

.currency-input {
  display: grid;
  grid-template-columns: 18px minmax(64px, 1fr);
  align-items: center;
  gap: 4px;
}

.currency-input span {
  color: var(--muted);
  font-weight: 800;
}

.currency-input input {
  min-width: 0;
}

.table-currency-input {
  grid-template-columns: 14px minmax(54px, 1fr);
  gap: 2px;
}

.table-currency-input span {
  font-size: 12px;
  text-align: right;
  user-select: none;
}

.data-table.editable .table-currency-input input {
  min-width: 54px;
  max-width: 78px;
}

.view {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.view.active {
  display: grid;
  gap: 16px;
  animation: view-reveal var(--motion-medium) var(--ease-smooth);
}

@keyframes view-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
    filter: blur(2px);
  }

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

@keyframes menu-drop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    filter: blur(2px);
  }

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

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.toolbar,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sticky-record-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 0;
  background: rgba(246, 244, 239, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.record-nav-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 18px;
}

.record-position-control {
  min-width: 168px;
  white-space: nowrap;
}

.record-position-control input[type="range"] {
  width: 112px;
}

.invoice-nav-toolbar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 7px 0;
  background: rgba(246, 244, 239, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.invoice-nav-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.invoice-nav-main .icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 18px;
}

.invoice-nav-main .invoice-search {
  flex: 0 1 220px;
  min-width: 170px;
  max-width: 220px;
}

.invoice-nav-main .record-counter {
  flex: 0 0 auto;
  padding: 7px 9px;
  white-space: nowrap;
}

.invoice-position-control {
  flex: 0 1 190px;
  min-width: 160px;
  white-space: nowrap;
}

.invoice-position-control input[type="range"] {
  width: 112px;
}

.invoice-action-groups {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.invoice-action-group {
  position: relative;
}

.invoice-action-group summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
  box-shadow: var(--control-shadow);
}

.invoice-action-group summary:hover {
  border-color: #b8afa4;
  background: #fbfaf7;
  transform: translateY(-1px);
  box-shadow: var(--control-shadow-hover);
}

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

.invoice-action-group summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 11px;
  transition: transform var(--motion-fast) var(--ease-smooth);
}

.invoice-action-group[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(240, 6, 67, 0.12);
}

.invoice-action-group[open] summary::after {
  transform: rotate(180deg);
}

.invoice-action-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  width: 280px;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 38px rgba(18, 35, 34, 0.18);
  transform-origin: top right;
  animation: menu-drop-in var(--motion-fast) var(--ease-smooth);
}

.invoice-action-menu.compact {
  width: 240px;
}

.invoice-action-menu.wide {
  width: 340px;
}

.invoice-action-menu .btn {
  width: 100%;
}

.btn {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(240, 6, 67, 0.12);
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn.danger {
  background: var(--red);
  border-color: var(--red);
}

.btn:hover:not(:disabled) {
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(240, 6, 67, 0.18);
}

.btn.secondary:hover:not(:disabled) {
  border-color: #b8afa4;
  background: #fbfaf7;
  box-shadow: var(--control-shadow-hover);
}

.btn.danger:hover:not(:disabled) {
  box-shadow: 0 10px 22px rgba(180, 35, 24, 0.2);
}

.btn.tiny {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.page-number:focus-visible,
.nav-item:focus-visible,
.recent-search-value:focus-visible,
.client-name-option:focus-visible,
.link-button:focus-visible,
.text-action:focus-visible,
.invoice-action-group summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--control-shadow-hover);
}

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

.metric,
.panel,
.summary-strip,
.pdf-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  transition:
    border-color var(--motion-fast) var(--ease-smooth),
    box-shadow var(--motion-fast) var(--ease-smooth),
    transform var(--motion-quick) var(--ease-smooth);
}

.metric span,
.summary-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.dashboard-wip-summary-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 2px 8px;
}

.dashboard-wip-summary-head h2 {
  margin: 0;
  font-size: 18px;
}

.dashboard-wip-summary-head .panel-note {
  margin: 2px 0 0;
}

.dashboard-wip-metrics {
  margin-bottom: 14px;
}

.dashboard-wip-metric {
  position: relative;
  overflow: hidden;
}

.dashboard-wip-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #706a62;
}

.dashboard-wip-metric.delayed::before {
  background: #d71948;
}

.dashboard-wip-metric.missing::before,
.dashboard-wip-metric.due-soon::before {
  background: #d58a1f;
}

.dashboard-wip-metric.on-track::before {
  background: #37805a;
}

.dashboard-wip-metric.not-started::before {
  background: #8a8781;
}

.dashboard-wip-directory-panel {
  display: block;
  margin-bottom: 14px;
  overflow: hidden;
}

.dashboard-wip-directory-head {
  align-items: end;
}

.dashboard-wip-directory-filters {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-wip-directory-filters label {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.dashboard-wip-directory-filters select {
  min-height: 36px;
}

.dashboard-wip-directory-scroll {
  margin-top: 10px;
}

.dashboard-wip-directory-table {
  min-width: 1370px;
}

.dashboard-wip-directory-table th,
.dashboard-wip-directory-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.dashboard-wip-directory-table td:nth-child(4) {
  white-space: normal;
  min-width: 190px;
}

.wip-master-version {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, white);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}

.wip-master-version.is-empty {
  border-color: var(--line);
  color: var(--muted);
  font-weight: 600;
}

.dashboard-wip-directory-table .dashboard-wip-open {
  width: 32px;
  height: 32px;
}

.dashboard-wip-count {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-wip-count:hover {
  text-decoration: underline;
  transform: translateY(-1px);
}

.dashboard-wip-count.delayed {
  color: var(--danger);
}

.dashboard-wip-count.missing {
  color: #8a5510;
}

.dashboard-wip-zero {
  color: var(--muted);
}

.wip-source-badge.fallback {
  border-color: var(--line);
  background: #f2f1ee;
  color: var(--muted);
}

.wip-type-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f2f1ee;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 14px;
}

.comments-panel {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 14px;
  min-width: 0;
}

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

.panel-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.pager-tools,
.small-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.pager-tools label {
  min-width: 74px;
}

.pagination-top {
  justify-content: flex-end;
  margin-left: auto;
}

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

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
  box-shadow: var(--control-shadow);
}

.icon-btn:hover:not(:disabled) {
  border-color: #b8afa4;
  background: #fbfaf7;
  transform: translateY(-1px);
  box-shadow: var(--control-shadow-hover);
}

.style-hs-code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: end;
}

.style-hs-code-field .icon-btn {
  width: 34px;
  height: 36px;
}

.page-info {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-width: 76px;
  text-align: center;
}

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

.page-number,
.page-ellipsis {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.page-number {
  cursor: pointer;
}

.page-number:hover:not(:disabled) {
  border-color: #f4a0b7;
  background: #fff3f6;
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(240, 6, 67, 0.12);
}

.page-number.active {
  border-color: var(--blue);
  background: #ffe6ee;
  color: #a0002c;
  box-shadow: 0 0 0 2px rgba(240, 6, 67, 0.12);
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.danger-icon {
  color: var(--red);
}

.range-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 230px;
}

.record-counter {
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
  transition:
    background-color var(--motion-fast) var(--ease-smooth),
    border-color var(--motion-fast) var(--ease-smooth);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.form-panel .form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.document-settings-sections {
  display: grid;
  gap: 18px;
}

.document-settings-section {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.document-settings-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.document-settings-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.document-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.document-settings-grid.two-column {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.document-settings-grid .row-start {
  grid-column-start: 1;
}

.document-settings-grid .field-span-2 {
  grid-column: span 2;
}

.document-settings-grid textarea {
  min-height: 76px;
  resize: vertical;
}

.document-settings-grid .same-height-control input,
.document-settings-grid .same-height-control textarea {
  height: 54px;
  min-height: 54px;
}

.document-settings-grid .same-height-control textarea {
  line-height: 1.35;
}

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

.document-profile-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.document-profile-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  max-height: 610px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.document-profile-list-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-smooth),
    border-color var(--motion-fast) var(--ease-smooth),
    color var(--motion-fast) var(--ease-smooth);
}

.document-profile-list-item:hover {
  border-color: var(--line);
  background: var(--surface);
}

.document-profile-list-item.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.document-profile-list-item strong {
  font-size: 13px;
}

.document-profile-list-item span,
.document-profile-list-item em {
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-profile-editor {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 14px;
  min-width: 0;
}

.document-profile-identity-grid,
.document-profile-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.document-profile-identity-grid {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.document-profile-active {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 22px;
}

.document-profile-active input {
  width: 18px;
  height: 18px;
}

.document-profile-fields-grid textarea {
  min-height: 66px;
  resize: vertical;
}

.document-profile-fields-grid .document-profile-party-field input,
.document-profile-fields-grid .document-profile-party-field textarea {
  height: 66px;
  min-height: 66px;
}

.document-profile-fields-grid .profile-manufacturer-field {
  grid-column: span 2;
}

.job-number-field {
  font-size: 18px;
  font-weight: 900;
}

.strong-label {
  color: var(--ink);
}

.strong-label input {
  font-weight: 800;
}

.danger-label {
  color: var(--red);
}

.danger-label input {
  border-color: #efb4ad;
  color: var(--red);
}

.shipment-row {
  margin-top: 10px;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) !important;
}

.shipment-row label {
  color: #a0002c;
}

.shipment-input {
  border-color: #f4a0b7;
  background: #fff3f6;
  color: #a0002c;
  font-weight: 800;
}

.style-search {
  margin-bottom: 12px;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div,
.mini-record,
.lookup-grid div,
.invoice-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--surface-2);
}

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

.detail-list dd {
  margin: 2px 0 0;
  font-size: 14px;
}

.job-style-detail-list {
  gap: 9px;
}

.job-style-detail-list > .job-style-meta-row,
.job-style-detail-list > .job-style-fabric-row {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.job-style-meta-row,
.job-style-fabric-row {
  display: grid;
  gap: 8px;
}

.job-style-meta-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-style-fabric-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.revision-list {
  display: grid;
  gap: 7px;
  font-size: 13px;
  max-height: 205px;
  overflow-y: auto;
  padding-right: 4px;
}

.manual-revision-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

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

.revision-list div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.wip-table th,
.wip-table td {
  white-space: nowrap;
}

.wip-table .wip-comments {
  min-width: 260px;
}

.wip-comments-field {
  grid-column: 1 / -1;
}

.wip-search-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
}

.wip-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px repeat(6, max-content);
  gap: 10px;
  align-items: end;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.wip-directory-toolbar > [hidden] {
  display: none;
}

.wip-directory-toolbar .icon-btn {
  width: 40px;
  height: 40px;
}

.wip-directory-status-filter {
  display: inline-flex;
  align-items: stretch;
  align-self: end;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #f7f5f0;
}

.wip-directory-status-btn {
  min-width: 78px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.wip-directory-status-btn:last-child {
  border-right: 0;
}

.wip-directory-status-btn:hover,
.wip-directory-status-btn.active {
  background: #ffffff;
  color: var(--ink);
}

.wip-directory-status-btn.active {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.wip-master-create {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(170px, 0.7fr) minmax(170px, 0.7fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f5f0;
}

.wip-master-create[hidden] {
  display: none;
}

.wip-unified-import {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f5f0;
}

.wip-unified-import[hidden],
.wip-unified-sheet-detail[hidden] {
  display: none;
}

.wip-unified-import-head,
.wip-unified-import-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.wip-unified-import-head {
  align-items: flex-start;
  margin-bottom: 10px;
}

.wip-unified-import-head h3 {
  margin: 0 0 2px;
}

.wip-unified-import-controls {
  justify-content: flex-start;
  padding-bottom: 10px;
}

.wip-unified-import-controls label {
  width: min(560px, 100%);
}

.wip-unified-import-controls input[type="file"] {
  padding: 6px 8px;
}

.wip-unified-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 8px;
}

.wip-unified-summary span,
.wip-unified-field-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.wip-unified-summary strong {
  margin-left: 5px;
  color: var(--ink);
}

.wip-unified-sheet-scroll {
  max-height: 360px;
  border: 1px solid var(--line);
}

.wip-unified-sheet-table {
  min-width: 1040px;
}

.wip-unified-sheet-table th,
.wip-unified-sheet-table td {
  white-space: nowrap;
}

.wip-unified-sheet-table tr.is-selected td {
  background: #edf4f0;
}

.wip-unified-review {
  color: var(--muted);
  font-weight: 700;
}

.wip-unified-review.needs-review {
  color: var(--danger);
}

.wip-unified-sheet-detail {
  padding-top: 10px;
}

.wip-unified-field-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.wip-unified-field-chip.customer-specific {
  border-style: dashed;
}

.wip-unified-sample-scroll {
  max-height: 260px;
  border: 1px solid var(--line);
}

.wip-unified-sample-table {
  min-width: max-content;
}

.wip-unified-sample-table th,
.wip-unified-sample-table td {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wip-unified-import-actions,
.wip-unified-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wip-unified-import-actions {
  min-height: 52px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.wip-unified-import-actions .panel-note {
  margin: 0;
}

.wip-unified-import-status-blocked {
  color: var(--danger);
  font-weight: 700;
}

.wip-unified-history-head {
  align-items: flex-end;
  margin-top: 8px;
}

.wip-unified-history-head h4 {
  margin: 0 0 2px;
}

.wip-unified-history-scroll {
  max-height: 240px;
  margin-top: 6px;
  border: 1px solid var(--line);
}

.wip-unified-history-table {
  min-width: 1320px;
}

.wip-unified-history-table th,
.wip-unified-history-table td {
  white-space: nowrap;
}

.wip-history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wip-history-current,
.wip-history-link-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.wip-history-current {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}

.wip-history-link-status.style_color_linked,
.wip-history-link-status.style_linked {
  color: var(--success);
}

.wip-history-link-status.conflict {
  color: var(--danger);
}

.wip-unified-history-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.wip-unified-history-detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.wip-unified-history-detail-head h4 {
  margin: 0 0 2px;
}

.wip-unified-history-detail-head .panel-note {
  margin: 0;
}

.wip-unified-history-detail-scroll {
  max-height: 360px;
  border: 1px solid var(--line);
}

.wip-unified-history-detail-table {
  min-width: 1800px;
}

.wip-unified-history-detail-table th,
.wip-unified-history-detail-table td {
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wip-directory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 6px;
}

.wip-directory-head h3 {
  margin: 0 0 2px;
}

.wip-directory-scroll {
  max-height: 320px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.wip-directory-table {
  min-width: 1180px;
}

.wip-directory-table th,
.wip-directory-table td {
  white-space: nowrap;
}

.wip-directory-table tr.is-selected td {
  background: #edf4f0;
}

.wip-directory-table .wip-master-open {
  width: 32px;
  height: 32px;
}

.wip-master-health {
  font-variant-numeric: tabular-nums;
}

.wip-master-health.has-alert {
  color: var(--danger);
  font-weight: 700;
}

.wip-master-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.wip-master-status.active {
  border-color: #93b5a7;
  color: #245f50;
  background: #edf5f1;
}

.wip-master-action {
  min-width: 82px;
}

.wip-client-export-panel {
  overflow: hidden;
}

.roots-wip-master-panel {
  overflow: hidden;
}

.roots-wip-import-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) 110px minmax(150px, 0.8fr) minmax(150px, 0.85fr) minmax(260px, 1.5fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.roots-wip-file-field input[type="file"] {
  min-width: 250px;
  padding: 6px 8px;
}

.roots-wip-preview {
  padding-top: 12px;
}

.roots-wip-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.roots-wip-preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roots-wip-preview-summary span {
  display: grid;
  min-width: 88px;
  padding: 7px 10px;
  border-left: 3px solid var(--accent);
  background: #f7f5f0;
}

.roots-wip-preview-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.roots-wip-preview-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.roots-wip-validation {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.roots-wip-validation-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 10px;
  border-left: 3px solid #9aa6a2;
  background: #f5f7f6;
  font-size: 12px;
}

.roots-wip-validation-item.error {
  border-left-color: #b62920;
  background: #fff0ed;
}

.roots-wip-validation-item.warning {
  border-left-color: #b77a17;
  background: #fff8e7;
}

.roots-wip-validation-item.ok {
  border-left-color: #187a68;
  background: #edf8f4;
}

.roots-wip-validation-item.info {
  border-left-color: #316ca5;
  background: #edf5fb;
}

.roots-wip-preview-scroll {
  max-height: 460px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
}

.roots-wip-preview-table {
  width: max-content;
  min-width: 100%;
}

.roots-wip-preview-table th,
.roots-wip-preview-table td {
  min-width: 170px;
  max-width: 260px;
  white-space: normal;
  vertical-align: top;
}

.roots-wip-preview-table th:first-child,
.roots-wip-preview-table td:first-child {
  min-width: 58px;
}

.roots-wip-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f0;
}

.roots-wip-preview-table th:first-child,
.roots-wip-preview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f8faf9;
}

.roots-wip-preview-table thead th:first-child {
  z-index: 3;
  background: #e8eeeb;
}

.roots-wip-preview-column-title {
  display: grid;
  gap: 2px;
}

.roots-wip-preview-column-title small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.roots-wip-preview-column-title span {
  line-height: 1.2;
}

.roots-wip-formula-cell {
  color: var(--muted);
  font-weight: 700;
}

.roots-wip-preview-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 6px;
  padding: 2px 0;
}

.roots-wip-preview-tab {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-smooth),
    border-color var(--motion-fast) var(--ease-smooth),
    color var(--motion-fast) var(--ease-smooth);
}

.roots-wip-preview-tab:hover {
  border-color: var(--accent);
  background: #f8f5ef;
}

.roots-wip-preview-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.roots-wip-preview-tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.roots-wip-preview-group-note {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.roots-wip-matrix-table {
  width: max-content;
  min-width: 100%;
}

.roots-wip-matrix-table.is-imported th,
.roots-wip-matrix-table.is-imported td {
  min-width: 170px;
  max-width: 260px;
  white-space: normal;
  vertical-align: top;
}

.roots-wip-matrix-table.is-imported th:first-child,
.roots-wip-matrix-table.is-imported td:first-child {
  min-width: 58px;
}

.roots-wip-matrix-table:not(.is-imported) th,
.roots-wip-matrix-table:not(.is-imported) td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.roots-wip-matrix-table:not(.is-imported) th:nth-child(1),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(1) { min-width: 210px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(2),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(2) { min-width: 240px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(3),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(3) { min-width: 130px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(4),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(4) { min-width: 140px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(5),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(5) { min-width: 100px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(6),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(6) { min-width: 130px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(7),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(7) { min-width: 110px; }
.roots-wip-matrix-table:not(.is-imported) th:nth-child(8),
.roots-wip-matrix-table:not(.is-imported) td:nth-child(8) { min-width: 120px; }

.roots-wip-preview-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.roots-wip-preview-scrollbar {
  margin-top: 8px;
}

.roots-wip-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.roots-wip-history-head h3 {
  margin: 0 0 2px;
  font-size: 14px;
}

.roots-wip-history-scroll {
  max-height: 230px;
}

.roots-wip-history-table td:nth-child(3) {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roots-wip-links-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.roots-wip-links-head h3 {
  margin: 0 0 2px;
  font-size: 14px;
}

.roots-wip-link-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.roots-wip-link-summary span {
  display: grid;
  min-width: 108px;
  padding: 7px 10px;
  border-left: 3px solid var(--line-strong);
  background: #f7f5f0;
}

.roots-wip-link-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.roots-wip-link-summary strong {
  font-size: 13px;
}

.roots-wip-links-scroll {
  max-height: 310px;
}

.roots-wip-links-table {
  width: max-content;
  min-width: 100%;
}

.roots-wip-links-table th,
.roots-wip-links-table td {
  min-width: 118px;
  max-width: 300px;
  white-space: normal;
  vertical-align: top;
}

.roots-wip-links-table th:first-child,
.roots-wip-links-table td:first-child {
  min-width: 58px;
}

.roots-wip-links-table th:last-child,
.roots-wip-links-table td:last-child {
  min-width: 260px;
}

.wip-client-export-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wip-client-export-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.wip-client-export-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.wip-client-export-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.wip-client-export-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.wip-client-export-tab:hover {
  background: #f7f5f0;
  color: var(--ink);
}

.wip-client-export-tab.active {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.wip-client-export-scroll {
  max-height: 360px;
  min-height: 160px;
}

.wip-client-export-table {
  width: max-content;
  min-width: 100%;
}

.wip-client-export-table th,
.wip-client-export-table td {
  min-width: 118px;
  max-width: 240px;
  white-space: normal;
  vertical-align: top;
}

.wip-client-export-table th:first-child,
.wip-client-export-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 130px;
  background: #ffffff;
  box-shadow: 5px 0 8px rgba(20, 20, 20, 0.05);
}

.wip-client-export-table thead th:first-child {
  z-index: 3;
  background: #ecefeb;
}

.wip-client-export-warnings {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.wip-client-export-warning {
  padding-left: 12px;
  border-left: 3px solid #d2cdc3;
}

.wip-overview-head {
  margin-bottom: 8px;
}

.wip-health-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #f7f5f0;
}

.wip-health-filter {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.wip-health-filter:last-child {
  border-right: 0;
}

.wip-health-filter strong {
  color: var(--ink);
  font-size: 20px;
}

.wip-health-filter:hover:not(:disabled) {
  background: #ffffff;
}

.wip-health-filter.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.wip-matrix-title-block {
  min-width: 0;
}

.wip-matrix-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.wip-matrix-title-row h2 {
  margin: 0;
}

.wip-view-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f5f0;
}

.wip-view-btn {
  min-height: 32px;
  padding: 5px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.wip-view-btn:last-child {
  border-right: 0;
}

.wip-view-btn:hover {
  background: #ffffff;
  color: var(--ink);
}

.wip-view-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.wip-matrix-head-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.wip-matrix-scroll {
  max-height: min(660px, calc(100vh - 350px));
  min-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.wip-matrix-scroll::-webkit-scrollbar:horizontal {
  display: none;
  height: 0;
}

.wip-matrix-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.wip-matrix-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 52px;
  background: #ecefeb;
  white-space: normal;
  line-height: 1.15;
}

.wip-job-detail-table th:nth-child(4),
.wip-job-detail-table td:nth-child(4) {
  width: 120px;
  min-width: 120px;
}

.wip-job-detail-table th:nth-child(5),
.wip-job-detail-table td:nth-child(5) {
  width: 120px;
  min-width: 120px;
}

.wip-job-detail-table th:nth-child(6),
.wip-job-detail-table td:nth-child(6) {
  width: 125px;
  min-width: 125px;
}

.wip-job-detail-table th:nth-child(7),
.wip-job-detail-table td:nth-child(7) {
  width: 110px;
  min-width: 110px;
}

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

.wip-job-detail-table th:nth-child(9),
.wip-job-detail-table td:nth-child(9) {
  width: 76px;
  min-width: 76px;
  text-align: right;
}

.wip-matrix-table .wip-sticky-select {
  position: sticky;
  left: 0;
  width: 42px;
  min-width: 42px;
  z-index: 6;
  background: #ffffff;
}

.wip-matrix-table .wip-sticky-job {
  position: sticky;
  left: 42px;
  width: 112px;
  min-width: 112px;
  z-index: 6;
  background: #ffffff;
}

.wip-matrix-table .wip-sticky-health {
  position: sticky;
  left: 154px;
  width: 120px;
  min-width: 120px;
  z-index: 6;
  background: #ffffff;
  box-shadow: 5px 0 8px rgba(20, 20, 20, 0.05);
}

.wip-matrix-table thead .wip-sticky-select,
.wip-matrix-table thead .wip-sticky-job,
.wip-matrix-table thead .wip-sticky-health {
  z-index: 8;
  background: #ecefeb;
}

.wip-style-summary-table .wip-style-sticky-select {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 42px;
  min-width: 42px;
  background: #ffffff;
}

.wip-style-summary-table .wip-style-sticky-id {
  position: sticky;
  left: 42px;
  z-index: 6;
  width: 150px;
  min-width: 150px;
  background: #ffffff;
}

.wip-style-summary-table .wip-style-sticky-name {
  position: sticky;
  left: 192px;
  z-index: 6;
  width: 240px;
  min-width: 240px;
  white-space: normal;
  background: #ffffff;
}

.wip-style-summary-table .wip-style-health {
  position: sticky;
  left: 432px;
  z-index: 6;
  width: 120px;
  min-width: 120px;
  background: #ffffff;
  box-shadow: 5px 0 8px rgba(20, 20, 20, 0.06);
}

.wip-style-summary-table thead .wip-style-sticky-select,
.wip-style-summary-table thead .wip-style-sticky-id,
.wip-style-summary-table thead .wip-style-sticky-name,
.wip-style-summary-table thead .wip-style-health {
  z-index: 8;
  background: #ecefeb;
}

.wip-style-summary-table .wip-style-job-count {
  width: 70px;
  min-width: 70px;
  text-align: center;
}

.wip-style-summary-table .wip-style-qty {
  width: 92px;
  min-width: 92px;
  text-align: right;
}

.wip-style-summary-table .wip-style-season {
  width: 120px;
  min-width: 120px;
}

.wip-style-summary-table .wip-style-destination {
  width: 150px;
  min-width: 150px;
  white-space: normal;
}

.wip-style-group-row td {
  background: #ffffff;
  border-top: 2px solid #d9d5cc;
}

.wip-style-job-row td,
.wip-style-summary-table .wip-style-job-row .wip-style-sticky-select,
.wip-style-summary-table .wip-style-job-row .wip-style-sticky-id,
.wip-style-summary-table .wip-style-job-row .wip-style-sticky-name,
.wip-style-summary-table .wip-style-job-row .wip-style-health {
  background: #f7f5f0;
}

.wip-style-job-row td {
  color: #58534e;
}

.wip-style-id-cell,
.wip-style-job-id {
  display: flex;
  align-items: center;
  gap: 7px;
}

.wip-style-expand {
  flex: 0 0 auto;
}

.wip-style-job-id > span {
  color: var(--muted);
  font-size: 15px;
}

.wip-style-job-meta {
  display: grid;
  gap: 3px;
  line-height: 1.15;
}

.wip-style-job-meta span {
  color: var(--muted);
  font-size: 10px;
}

.wip-style-job-row .wip-matrix-cell {
  min-height: 50px;
}

.wip-stage-head {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  text-align: center !important;
}

.wip-stage-cell {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  padding: 4px !important;
  background: #ffffff;
}

.wip-matrix-cell {
  width: 110px;
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid #ddd8cd;
  border-radius: 6px;
  background: #f7f5f0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.wip-matrix-cell:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #9d9388;
  box-shadow: var(--control-shadow-hover);
}

.wip-matrix-cell.unified-source:disabled {
  cursor: default;
  opacity: 1;
}

.wip-matrix-cell.current {
  box-shadow: inset 0 0 0 2px #706a62;
}

.wip-matrix-cell.missing {
  border-color: #e5a13b;
  background: #fff3d9;
  color: #76420a;
}

.wip-matrix-cell.delayed {
  border-color: #d71948;
  background: #fff0f3;
  color: #a30f36;
}

.wip-matrix-cell.done {
  border-color: #71a485;
  background: #edf7f0;
  color: #245f40;
}

.wip-matrix-cell.in-progress {
  border-color: #d0a263;
  background: #fff8e9;
  color: #7d4b12;
}

.wip-matrix-cell.scheduled {
  border-color: #9da6a1;
  background: #f1f3f2;
}

.wip-matrix-cell.not-applicable {
  border-style: dashed;
  color: var(--muted);
  background: #f7f7f5;
}

.wip-matrix-cell.mixed {
  border-color: #8c8f98;
  background: #f0f1f4;
  color: #4e5360;
}

.wip-cell-status {
  font-size: 12px;
  font-weight: 800;
}

.wip-cell-date {
  font-size: 10px;
  color: currentColor;
  white-space: nowrap;
}

.wip-health-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
  line-height: 1.15;
}

.wip-health-stack {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.wip-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 5px;
  border: 1px solid #8cb9aa;
  border-radius: 4px;
  background: #eef7f3;
  color: #176b57;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.wip-health-badge.delayed {
  background: #ffe5eb;
  color: #a30f36;
}

.wip-health-badge.missing {
  background: #fff0cd;
  color: #76420a;
}

.wip-health-badge.on-track {
  background: #e7f4eb;
  color: #245f40;
}

.wip-health-badge.not-started {
  background: #eeece7;
  color: #706a62;
}

.wip-health-badge.mixed {
  background: #e9ebf0;
  color: #4e5360;
}

.wip-matrix-scrollbar {
  margin-top: 7px;
}

.factory-wip-search-grid {
  grid-template-columns: minmax(320px, 1fr) auto auto;
}

.factory-wip-review-table th,
.factory-wip-review-table td {
  white-space: nowrap;
}

.factory-wip-review-table td:nth-child(6),
.factory-wip-review-table td:nth-child(7) {
  min-width: 220px;
  white-space: normal;
}

.internal-code-manager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.inline-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: auto;
  padding: 0;
}

.check-cell {
  width: 34px;
  min-width: 34px;
  text-align: center;
}

.wip-row-check,
.wip-style-check,
#wip-select-all {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

.status-choice-field {
  display: grid;
  gap: 6px;
}

.status-choice-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.status-choice-btn {
  border: 1px solid var(--line);
  cursor: pointer;
}

.status-choice-btn.active {
  outline: 2px solid #111827;
  outline-offset: 1px;
}

.wip-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(20, 20, 20, 0.28);
  backdrop-filter: blur(1px);
}

.wip-batch-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1100;
  width: min(450px, calc(100vw - 24px));
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 45px rgba(20, 20, 20, 0.18);
}

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

.wip-drawer-head h2 {
  margin: 0;
}

.wip-drawer-body {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.wip-drawer-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #f7f5f0;
}

.wip-selection-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.wip-selection-summary strong {
  color: var(--ink);
  font-size: 22px;
}

.wip-drawer-form {
  display: grid;
  gap: 13px;
}

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

.wip-code-details {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.wip-code-details summary {
  cursor: pointer;
  font-weight: 800;
}

.wip-drawer-open {
  overflow: hidden;
}

.dashboard-alert-list {
  max-height: 210px;
}

.dashboard-alert-card {
  border-left: 4px solid #d97706;
}

.dashboard-alert-info {
  align-items: flex-start;
  line-height: 1.35;
  white-space: normal;
}

.comment-entry-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.comment-entry-grid .comment-text-field {
  grid-column: 1 / -1;
}

.comment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comment-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 4px;
}

.comment-card,
.empty-note {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 9px;
  font-size: 13px;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 5px;
  color: var(--muted);
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.hs-code-list-table {
  min-width: 980px;
}

.hs-code-list-table th:nth-child(1),
.hs-code-list-table td:nth-child(1) {
  width: 150px;
}

.hs-code-list-table th:nth-child(2),
.hs-code-list-table td:nth-child(2) {
  width: 110px;
}

.hs-code-list-table th:nth-child(5),
.hs-code-list-table td:nth-child(5) {
  width: 46px;
}

.color-size-scroll::-webkit-scrollbar,
.forecast-scroll::-webkit-scrollbar,
.invoice-detail-scroll::-webkit-scrollbar,
.factory-management-scroll::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.color-size-scroll::-webkit-scrollbar-track,
.forecast-scroll::-webkit-scrollbar-track,
.invoice-detail-scroll::-webkit-scrollbar-track,
.factory-management-scroll::-webkit-scrollbar-track {
  background: #eee9df;
  border-radius: 7px;
}

.color-size-scroll::-webkit-scrollbar-thumb,
.forecast-scroll::-webkit-scrollbar-thumb,
.invoice-detail-scroll::-webkit-scrollbar-thumb,
.factory-management-scroll::-webkit-scrollbar-thumb {
  background: #6f655c;
  border: 3px solid #eee9df;
  border-radius: 8px;
}

.color-size-scroll::-webkit-scrollbar-thumb:hover,
.forecast-scroll::-webkit-scrollbar-thumb:hover,
.invoice-detail-scroll::-webkit-scrollbar-thumb:hover,
.factory-management-scroll::-webkit-scrollbar-thumb:hover {
  background: #f00643;
}

.master-list-scroll {
  overflow: auto;
}

.color-size-scroll {
  max-height: min(1180px, calc(100vh - 260px));
  overflow-x: scroll;
  overflow-y: auto;
  padding-bottom: 8px;
  scrollbar-gutter: stable both-edges;
}

.color-size-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f8f7;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

.client-year-panel {
  margin: 14px 0;
}

.dashboard-client-table {
  min-width: 760px;
}

.dashboard-summary-row td {
  background: #f1eee8;
  color: #212124;
  font-weight: 900;
  border-top: 2px solid var(--line);
}

.dashboard-count-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
}

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

body.role-guest .job-size-price-table th:nth-child(n + 8):nth-child(-n + 14),
body.role-guest .job-size-price-table td:nth-child(n + 8):nth-child(-n + 14),
body.no-prices .job-size-price-table th:nth-child(n + 8):nth-child(-n + 14),
body.no-prices .job-size-price-table td:nth-child(n + 8):nth-child(-n + 14),
body.role-guest #jobs > .summary-strip div:nth-child(2),
body.role-guest #jobs > .summary-strip div:nth-child(3),
body.role-guest #jobs > .summary-strip div:nth-child(4),
body.no-prices #jobs > .summary-strip div:nth-child(2),
body.no-prices #jobs > .summary-strip div:nth-child(3),
body.no-prices #jobs > .summary-strip div:nth-child(4),
body.role-guest #spo .data-table.editable th:nth-child(n + 8):nth-child(-n + 10),
body.role-guest #spo .data-table.editable td:nth-child(n + 8):nth-child(-n + 10),
body.role-guest #spo-total,
body.role-guest .spo-summary-strip div:has(#spo-total),
body.no-prices #spo .data-table.editable th:nth-child(n + 8):nth-child(-n + 10),
body.no-prices #spo .data-table.editable td:nth-child(n + 8):nth-child(-n + 10),
body.no-prices #spo-total,
body.no-prices .spo-summary-strip div:has(#spo-total),
body.role-guest .invoice-overview-table th:nth-child(6),
body.role-guest .invoice-overview-table td:nth-child(6),
body.role-guest .invoice-summary div:nth-child(3),
body.role-guest .invoice-table th:nth-child(n + 11):nth-child(-n + 14),
body.role-guest .invoice-table td:nth-child(n + 11):nth-child(-n + 14),
body.no-prices .invoice-overview-table th:nth-child(6),
body.no-prices .invoice-overview-table td:nth-child(6),
body.no-prices .invoice-summary div:nth-child(3),
body.no-prices .invoice-table th:nth-child(n + 11):nth-child(-n + 14),
body.no-prices .invoice-table td:nth-child(n + 11):nth-child(-n + 14),
body.role-guest #local-currency,
body.role-guest #local-rmb,
body.role-guest #local-rate,
body.role-guest #local-usd,
body.role-guest label:has(#local-currency),
body.role-guest label:has(#local-rmb),
body.role-guest label:has(#local-rate),
body.role-guest label:has(#local-usd),
body.no-prices #local-currency,
body.no-prices #local-rmb,
body.no-prices #local-rate,
body.no-prices #local-usd,
body.no-prices label:has(#local-currency),
body.no-prices label:has(#local-rmb),
body.no-prices label:has(#local-rate),
body.no-prices label:has(#local-usd),
body.role-guest #master-saved-view,
body.role-guest #master-customize,
body.role-guest #master-export-lines-xlsx,
body.role-guest #master-save-layout,
body.role-guest #master-delete-layout,
body.role-guest #master-customize-panel,
body.no-prices #master-saved-view,
body.no-prices #master-customize,
body.no-prices #master-export-lines-xlsx,
body.no-prices #master-save-layout,
body.no-prices #master-delete-layout,
body.no-prices #master-customize-panel,
body.role-guest #spo-master-saved-view,
body.role-guest #spo-master-customize,
body.role-guest #spo-master-save-layout,
body.role-guest #spo-master-delete-layout,
body.role-guest #spo-master-customize-panel,
body.no-prices #spo-master-saved-view,
body.no-prices #spo-master-customize,
body.no-prices #spo-master-save-layout,
body.no-prices #spo-master-delete-layout,
body.no-prices #spo-master-customize-panel {
  display: none !important;
}

.job-size-price-table {
  width: max-content;
  min-width: 1720px;
}

.master-list-table {
  min-width: 2200px;
}

.master-list-table tfoot td,
.summary-row td {
  background: #f1eee8;
  color: #212124;
  font-weight: 900;
  border-top: 2px solid var(--line);
}

.customize-panel {
  border-color: #ddd8cd;
}

.customize-controls {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.field-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px 12px;
}

.job-size-price-table th {
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
}

.column-fill-heading {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  padding: 0;
  text-align: center;
}

.column-fill-heading:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.readonly-price {
  background: #eeebe5;
  color: #4c4740;
  font-weight: 700;
}

.data-table.compact {
  min-width: 520px;
}

.user-management-table {
  min-width: 1420px;
  table-layout: fixed;
}

.user-management-table th:nth-child(1),
.user-management-table td:nth-child(1) {
  width: 150px;
}

.user-management-table th:nth-child(2),
.user-management-table td:nth-child(2) {
  width: 180px;
}

.user-management-table th:nth-child(3),
.user-management-table td:nth-child(3) {
  width: 170px;
}

.user-management-table th:nth-child(4),
.user-management-table td:nth-child(4) {
  width: 150px;
}

.user-management-table th:nth-child(5),
.user-management-table td:nth-child(5) {
  width: 230px;
}

.user-management-table th:nth-child(6),
.user-management-table td:nth-child(6) {
  width: 210px;
}

.user-management-table th:nth-child(7),
.user-management-table td:nth-child(7) {
  width: 145px;
}

.user-management-table th:nth-child(8),
.user-management-table td:nth-child(8) {
  width: 180px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.user-management-table th:nth-child(9),
.user-management-table td:nth-child(9) {
  width: 82px;
}

.user-management-table th:nth-child(10),
.user-management-table td:nth-child(10) {
  width: 52px;
}

.user-management-table input,
.user-management-table select {
  width: 100%;
}

.user-management-table .price-access-cell {
  vertical-align: middle;
}

.user-management-table .price-access-stack {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.user-management-table .price-access-stack .checkbox-line {
  width: 100%;
  justify-content: flex-start;
}

.user-management-table .price-access-stack input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr {
  transition:
    background-color var(--motion-fast) var(--ease-smooth),
    box-shadow var(--motion-fast) var(--ease-smooth);
}

.data-table tbody tr:hover td {
  background: #fbfaf7;
}

.user-management-table th:nth-child(8),
.user-management-table td:nth-child(8) {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.navigation-limits-scroll {
  height: 44px;
  overflow-y: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  padding-right: 4px;
  line-height: 1.35;
}

.client-management-scroll {
  max-height: 360px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.client-management-table {
  min-width: 760px;
  table-layout: fixed;
}

.client-management-table th:nth-child(1),
.client-management-table td:nth-child(1) {
  width: 250px;
}

.client-management-table th:nth-child(2),
.client-management-table td:nth-child(2) {
  width: 130px;
}

.client-management-table th:nth-child(3),
.client-management-table td:nth-child(3) {
  width: 180px;
}

.client-management-table th:nth-child(4),
.client-management-table td:nth-child(4) {
  width: 130px;
}

.client-management-table th:nth-child(5),
.client-management-table td:nth-child(5) {
  width: 70px;
  text-align: center;
}

.client-management-table input {
  width: 100%;
}

.factory-management-table {
  min-width: 2380px;
  table-layout: fixed;
}

.factory-management-scroll {
  max-width: 100%;
  max-height: 318px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  padding: 2px 0 4px;
  scrollbar-color: #6f655c #eee9df;
  scrollbar-width: auto;
  scrollbar-gutter: stable both-edges;
}

.factory-management-scroll::-webkit-scrollbar:horizontal {
  display: none;
  height: 0;
}

.factory-management-scrollbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: 100%;
  height: 16px;
  margin-top: 6px;
  border: 1px solid #d7d0c3;
  border-radius: 9px;
  background: #eee9df;
  cursor: pointer;
  overflow: hidden;
}

.factory-management-scrollbar:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.factory-management-scrollbar[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}

.factory-management-scrollbar-thumb {
  position: absolute;
  top: 2px;
  left: 0;
  height: 10px;
  min-width: 44px;
  border-radius: 7px;
  background: #6f655c;
  cursor: grab;
  transform: translateX(0);
  transition: background-color var(--motion-fast) var(--ease-smooth);
}

.factory-management-scrollbar-thumb:hover {
  background: #f00643;
}

.factory-management-scrollbar-thumb:active {
  cursor: grabbing;
}

.factory-management-table th:nth-child(1),
.factory-management-table td:nth-child(1) {
  width: 92px;
}

.factory-management-table th:nth-child(2),
.factory-management-table td:nth-child(2) {
  width: 220px;
}

.factory-management-table th:nth-child(3),
.factory-management-table td:nth-child(3) {
  width: 280px;
}

.factory-management-table th:nth-child(4),
.factory-management-table td:nth-child(4) {
  width: 120px;
}

.factory-management-table th:nth-child(5),
.factory-management-table td:nth-child(5) {
  width: 150px;
}

.factory-management-table th:nth-child(6),
.factory-management-table td:nth-child(6) {
  width: 180px;
}

.factory-management-table th:nth-child(7),
.factory-management-table td:nth-child(7) {
  width: 140px;
}

.factory-management-table th:nth-child(8),
.factory-management-table td:nth-child(8) {
  width: 105px;
}

.factory-management-table th:nth-child(9),
.factory-management-table td:nth-child(9) {
  width: 155px;
}

.factory-management-table th:nth-child(10),
.factory-management-table td:nth-child(10) {
  width: 180px;
}

.factory-management-table th:nth-child(11),
.factory-management-table td:nth-child(11) {
  width: 230px;
}

.factory-management-table th:nth-child(12),
.factory-management-table td:nth-child(12) {
  width: 300px;
}

.factory-management-table th:nth-child(13),
.factory-management-table td:nth-child(13) {
  width: 90px;
}

.factory-management-table th:nth-child(14),
.factory-management-table td:nth-child(14) {
  width: 250px;
}

.factory-management-table th:nth-child(15),
.factory-management-table td:nth-child(15) {
  width: 52px;
}

.factory-management-table input,
.factory-management-table select {
  width: 100%;
}

.factory-wip-stage-table {
  min-width: 620px;
  table-layout: fixed;
}

.factory-wip-stage-table th:nth-child(1),
.factory-wip-stage-table td:nth-child(1) {
  width: 72px;
}

.factory-wip-stage-table th:nth-child(2),
.factory-wip-stage-table td:nth-child(2) {
  width: 260px;
}

.factory-wip-stage-table th:nth-child(3),
.factory-wip-stage-table td:nth-child(3) {
  width: 210px;
}

.factory-wip-stage-table th:nth-child(4),
.factory-wip-stage-table td:nth-child(4) {
  width: 52px;
}

.factory-wip-stage-table input,
.factory-wip-stage-table select {
  width: 100%;
}

.factory-wip-stage-table .factory-wip-stage-visible {
  width: auto;
}

.data-table pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: inherit;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f0ede7;
  color: #36322d;
  font-size: 12px;
  z-index: 1;
}

.dashboard-table {
  min-width: 980px;
}

.data-table.editable input,
.data-table.editable select {
  min-width: 84px;
  padding: 6px 7px;
  min-height: 30px;
}

.data-table.editable th:nth-child(2),
.data-table.editable td:nth-child(2) select {
  min-width: 190px;
  font-size: 12px;
}

.data-table.editable th:nth-child(4),
.data-table.editable td:nth-child(4) input,
.data-table.editable th:nth-child(5),
.data-table.editable td:nth-child(5) input {
  min-width: 150px;
  font-size: 12px;
}

.data-table.editable th:nth-child(7),
.data-table.editable td:nth-child(7) input,
.data-table.editable th:nth-child(8),
.data-table.editable td:nth-child(8) input,
.data-table.editable th:nth-child(9),
.data-table.editable td:nth-child(9) input,
.data-table.editable th:nth-child(10),
.data-table.editable td:nth-child(10) input,
.data-table.editable th:nth-child(11),
.data-table.editable td:nth-child(11) input {
  min-width: 64px;
  max-width: 86px;
}

.master-invoice-input {
  min-width: 132px;
}

.master-shipped-qty-input {
  min-width: 92px;
}

.invoice-shipped-qty-input {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
}

.invoice-copy-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 0;
}

.status-pill.green {
  background: #dff3e8;
  color: var(--green);
}

.status-pill.amber {
  background: #fff2d9;
  color: var(--amber);
}

.status-pill.red {
  background: #fee4df;
  color: var(--red);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.summary-strip div {
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  background: #fff;
}

.summary-strip strong {
  font-size: 18px;
}

.list-summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
  box-shadow: none;
}

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

.find-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.two-column-form,
.style-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
  gap: 16px;
}

#clients .two-column-form {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
}

.client-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  align-content: start;
}

.wide-field {
  grid-column: span 2;
}

.style-layout.single {
  grid-template-columns: 1fr;
}

.style-form {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin-bottom: 12px;
}

.style-fabric-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.65fr) minmax(105px, 0.5fr) minmax(118px, 0.65fr) minmax(220px, 1.25fr);
  gap: 10px;
  align-items: end;
}

.style-subsection {
  display: grid;
  gap: 8px;
}

.style-subsection + .style-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-head {
  margin-bottom: 4px;
}

.search-builder {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: 32px 150px 130px minmax(220px, 1fr) 32px 32px;
  gap: 8px;
  align-items: center;
}

.search-row .add-condition {
  grid-column: 1;
  grid-row: 1;
}

.search-row select:first-of-type {
  grid-column: 2;
}

.search-row select:nth-of-type(2) {
  grid-column: 3;
}

.search-row input {
  grid-column: 4;
}

.search-row .clear-condition {
  grid-column: 5;
}

.search-row .remove-condition {
  grid-column: 6;
}

.client-find {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) auto;
}

.tool-converter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.tool-converter-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-textarea {
  min-height: 320px;
  resize: vertical;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  text-transform: none;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 0.7fr) auto auto;
  gap: 12px;
  align-items: end;
}

.import-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.import-preview-scroll {
  max-height: 620px;
  overflow: auto;
}

.import-preview-table {
  min-width: 1680px;
}

.import-validation-scroll {
  max-height: 720px;
  overflow: auto;
}

.import-validation-table {
  min-width: 1180px;
}

.import-validation-table td {
  vertical-align: top;
}

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

.validation-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.validation-summary-grid strong {
  display: block;
  font-size: 18px;
}

.validation-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.validation-detail-wrap {
  max-height: 260px;
  overflow: auto;
}

.validation-detail-table {
  min-width: 720px;
}

.validation-row-warning td {
  background: #fffdf7;
}

.validation-row-error td {
  background: #fff8f6;
}

.import-preview-table td {
  vertical-align: top;
}

.import-preview-table pre {
  min-width: 220px;
  max-width: 360px;
  max-height: 150px;
  overflow: auto;
}

.import-row-duplicate td {
  background: #fffaf0;
}

.import-row-error td {
  background: #fff1ef;
}

.import-messages {
  min-width: 260px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  color: var(--muted);
}

#clients .form-grid {
  align-items: start;
}

#clients .form-grid input,
#clients .form-grid select {
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
}

.invoice-search {
  max-width: 220px;
}

.invoice-overview-panel {
  margin-bottom: 14px;
}

.invoice-overview-scroll {
  max-height: 280px;
}

.invoice-overview-table tr {
  cursor: pointer;
}

.invoice-number-sort,
.invoice-payment-sort {
  cursor: pointer;
  user-select: none;
}

.invoice-overview-table tr.selected-row td {
  background: #eef6ff;
}

.invoice-overview-table tr.selected-row:hover td {
  background: #e4f1ff;
}

#factory-export-body tr.selected-factory-row td,
#spo-pdf-export-body tr.selected-factory-row td {
  background: #fff4cf;
}

#factory-export-body tr.selected-factory-row:hover td,
#spo-pdf-export-body tr.selected-factory-row:hover td {
  background: #ffedac;
}

.invoice-summary {
  margin-bottom: 12px;
}

.shipment-check-panel {
  margin: 12px 0;
  padding: 10px 12px;
  background: #f8fbfb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.shipment-check-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.shipment-check-head strong {
  font-size: 14px;
}

.shipment-check-head small {
  color: var(--muted);
  font-weight: 700;
}

.shipment-check-list {
  display: grid;
  gap: 6px;
}

.shipment-check-item {
  display: grid;
  grid-template-columns: 72px minmax(120px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
}

.shipment-check-item span {
  font-weight: 800;
}

.shipment-check-item.error span {
  color: var(--red);
}

.shipment-check-item.warning span {
  color: var(--amber);
}

.shipment-check-item strong {
  overflow-wrap: anywhere;
}

.shipment-check-item em {
  color: var(--ink);
  font-style: normal;
}

.shipment-check-empty {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.invoice-export-history-panel {
  margin: 12px 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.invoice-history-head strong {
  font-size: 14px;
}

.invoice-history-head small,
.invoice-history-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.invoice-history-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.invoice-history-item {
  display: grid;
  grid-template-columns: 150px 150px minmax(180px, 1fr) 110px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.invoice-history-item span,
.invoice-history-item small {
  color: var(--muted);
}

.invoice-history-item em {
  overflow-wrap: anywhere;
  font-style: normal;
}

.invoice-history-item code {
  grid-column: 3 / -1;
  color: var(--muted);
  font-family: var(--font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-detail-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.invoice-detail-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: 590px;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: #6f655c #eee9df;
  scrollbar-width: auto;
}

.invoice-detail-scroll::-webkit-scrollbar:horizontal {
  display: none;
  height: 0;
}

.custom-horizontal-scrollbar,
.invoice-detail-scrollbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: 100%;
  height: 16px;
  margin-top: 6px;
  border: 1px solid #d7d0c3;
  border-radius: 9px;
  background: #eee9df;
  cursor: pointer;
  overflow: hidden;
}

.custom-horizontal-scrollbar:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.custom-horizontal-scrollbar[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}

.custom-horizontal-scrollbar-thumb {
  position: absolute;
  top: 2px;
  left: 0;
  height: 10px;
  min-width: 44px;
  border-radius: 7px;
  background: #6f655c;
  cursor: grab;
  transform: translateX(0);
  transition: background-color var(--motion-fast) var(--ease-smooth);
}

.custom-horizontal-scrollbar-thumb:hover {
  background: #f00643;
}

.custom-horizontal-scrollbar-thumb:active {
  cursor: grabbing;
}

.invoice-table th:nth-child(9),
.invoice-table td:nth-child(9) {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.invoice-table th:nth-child(10),
.invoice-table td:nth-child(10) {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

.invoice-table th:nth-child(11),
.invoice-table td:nth-child(11) {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
}

.invoice-job-ex-rate-input {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  text-align: right;
}

.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.inline-filter select {
  height: 34px;
  min-height: 34px;
  min-width: 120px;
  padding: 6px 28px 6px 10px;
  text-transform: none;
}

.address-stack,
.invoice-stack,
.lookup-grid {
  display: grid;
  gap: 9px;
}

#client-billing,
#client-warehouse {
  min-height: 160px;
}

.manage-client-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.client-name-list {
  display: grid;
  gap: 7px;
}

.client-name-option,
.link-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 8px 10px;
  text-align: left;
}

.client-name-option:hover {
  border-color: #b8afa4;
  background: #fbfaf7;
  transform: translateY(-1px);
  box-shadow: var(--control-shadow-hover);
}

.client-name-option.active {
  border-color: var(--blue);
  background: #ffe6ee;
  color: #a0002c;
}

.link-button {
  border: 0;
  background: transparent;
  color: #a0002c;
  padding: 0;
  text-decoration: underline;
}

.mini-record {
  display: grid;
  gap: 4px;
}

.mini-record span,
.lookup-grid span {
  color: var(--muted);
  font-size: 13px;
}

.invoice-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}

.invoice-card strong {
  font-size: 15px;
}

.pdf-preview {
  overflow-x: auto;
}

.pdf-page {
  width: min(100%, 1060px);
  box-sizing: border-box;
  min-height: 600px;
  margin: 0 auto;
  padding: 18px;
  background: #fff;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.pdf-logo {
  width: 122px;
}

.pdf-title {
  font-size: 18px;
}

.pdf-header-job {
  min-width: 150px;
  text-align: right;
}

.pdf-header-job span {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.pdf-style,
.pdf-box {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  font-size: 11px;
  line-height: 1.15;
}

.pdf-box p {
  margin: 4px 0 0;
}

.pdf-header div {
  display: grid;
  gap: 4px;
}

.pdf-header span,
.pdf-grid span {
  color: var(--muted);
  font-size: 12px;
}

.pdf-grid .pdf-emphasis {
  color: #111827;
  font-weight: 900;
}

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

.factory-size-matrix {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
  line-height: 1.05;
}

.factory-size-matrix th,
.factory-size-matrix td {
  border: 1px solid #879693;
  padding: 3px 3px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.factory-color-block {
  margin-bottom: 7px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.factory-color-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid #879693;
  border-bottom: 0;
  background: #fff;
  font-size: 10.5px;
}

.factory-color-head span {
  min-width: 0;
}

.factory-color-head span:last-child {
  margin-left: auto;
}

.factory-color-head strong {
  color: var(--ink);
  margin-right: 4px;
}

.color-size-grid .pdf-line-label {
  width: 54px;
  text-align: left;
  background: #fff;
}

.color-size-grid .factory-id-row td {
  font-size: 8.5px;
  line-height: 1.05;
  text-align: left;
}

.color-size-grid .factory-qty-row td {
  font-weight: 800;
}

.all-color-total {
  margin: 6px 0 8px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.revision-box {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  background: #fff;
  font-size: 10.5px;
  line-height: 1.15;
}

.revision-box p {
  margin: 4px 0 0;
  font-size: 10.5px;
}

#factory-pdf-revisions {
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.15;
}

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

.lookup-grid textarea {
  margin-top: 8px;
  min-height: 74px;
  resize: vertical;
}

.sale-price-cell {
  max-width: 82px;
  min-width: 82px !important;
}

.invoice-table {
  width: max-content;
  min-width: 1760px;
}

.forecast-panel {
  min-height: 0;
}

.forecast-scroll {
  max-height: calc(100vh - 260px);
  overflow-x: scroll;
  overflow-y: auto;
  padding-bottom: 8px;
  scrollbar-gutter: stable both-edges;
}

.forecast-table {
  width: max-content;
  min-width: 1560px;
}

.forecast-table th,
.forecast-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.forecast-table th:nth-child(2),
.forecast-table td:nth-child(2) {
  min-width: 96px;
}

.forecast-table td:nth-child(7) {
  min-width: 240px;
  white-space: normal;
}

.forecast-table td:nth-child(13) {
  min-width: 180px;
}

.forecast-rmb-input {
  width: 112px;
}

.forecast-date-input {
  width: 150px;
}

.forecast-notes-input {
  width: 180px;
}

.link-button,
.text-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-button:hover,
.text-action:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.text-action {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
}

.pending-delete {
  opacity: 0.45;
  background: #f1f1f1;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.job-cancelled .panel:not(.job-search-panel),
.job-cancelled .summary-strip,
.job-invoiced .panel:not(.job-search-panel),
.job-invoiced .summary-strip {
  background: #f2f3f2;
}

.job-cancelled .form-panel,
.job-cancelled .data-table,
.job-invoiced .form-panel,
.job-invoiced .data-table {
  opacity: 0.72;
}

.job-invoiced .shipment-row {
  opacity: 1;
}

.pdf-footer {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

.pdf-page-break {
  margin-top: 18px;
}

.compact-pdf-header {
  margin-bottom: 20px;
}

.pdf-export-html,
.pdf-export-html body,
.pdf-export-html .pdf-preview,
.pdf-export-html .pdf-page {
  background: #fff !important;
}

.pdf-export-html,
.pdf-export-body {
  min-height: 100%;
}

.pdf-export-body .pdf-preview {
  min-height: 100vh;
}

.pdf-export-body .pdf-page {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pdf-export-body {
  margin: 0;
  background: #fff;
}

.pdf-export-body,
.pdf-export-body .pdf-preview,
.pdf-export-body .spo-pdf-preview,
.pdf-export-body .pdf-page,
.pdf-export-body .pdf-header,
.pdf-export-body .pdf-grid,
.pdf-export-body .pdf-style,
.pdf-export-body .pdf-box,
.pdf-export-body .revision-box,
.pdf-export-body .factory-color-block,
.pdf-export-body .factory-color-head,
.pdf-export-body .factory-size-matrix,
.pdf-export-body .factory-size-matrix th,
.pdf-export-body .factory-size-matrix td {
  background: #fff !important;
}

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  body * {
    visibility: hidden;
  }

  .pdf-preview,
  .pdf-preview * {
    visibility: visible;
  }

  .pdf-preview {
    position: static;
    inset: auto;
    overflow: visible;
  }

  .pdf-page {
    box-shadow: none;
    border: none;
    border-radius: 0;
    width: 100%;
    min-height: auto;
    page-break-after: always;
    break-after: page;
  }

  .pdf-page-break {
    margin-top: 0;
  }

  .pdf-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: none;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 560px;
  padding: 12px;
  background: #141414;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast.show {
  display: grid;
  animation: toast-in var(--motion-medium) var(--ease-smooth);
}

.recent-search-panel {
  position: absolute;
  z-index: 25;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform-origin: top left;
  animation: menu-drop-in var(--motion-fast) var(--ease-smooth);
}

.recent-search-panel[hidden] {
  display: none;
}

.recent-search-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}

.recent-search-value {
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.recent-search-value:hover {
  background: #fff3f6;
  transform: translateX(2px);
}

.metric-button {
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.metric-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--control-shadow-hover);
}

.deleted-panel {
  border-color: #d7b56d;
}

.shipping-invoice-pdf {
  padding: 28px;
  color: #172321;
  font-family: var(--font-sans);
  background: #ffffff;
}

.invoice-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 3px solid #1f4f4a;
}

.invoice-centered-title {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 800;
  color: #1f4f4a;
  text-align: center;
}

.invoice-brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.invoice-subbrand {
  margin-top: 4px;
  font-size: 12px;
  color: #53635f;
}

.invoice-title-block {
  min-width: 230px;
  text-align: right;
}

.invoice-title {
  font-size: 20px;
  font-weight: 800;
  color: #1f4f4a;
}

.invoice-number {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
}

.invoice-number-label {
  font-size: 10px;
  font-weight: 700;
  color: #667571;
  text-transform: uppercase;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 260px;
  gap: 14px;
  margin-top: 18px;
}

.invoice-address-box,
.invoice-info-box {
  min-height: 118px;
  padding: 12px;
  border: 1px solid #c8d4d1;
}

.invoice-address-box span,
.invoice-info-box span {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #667571;
  text-transform: uppercase;
}

.invoice-address-box strong,
.invoice-info-box strong {
  font-size: 12px;
}

.invoice-address-box p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.invoice-info-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.invoice-warning {
  margin-top: 12px;
  padding: 8px 10px;
  color: #7b4d00;
  background: #fff4d8;
  border: 1px solid #dfbd63;
}

.shipping-invoice-table {
  width: 100%;
  margin-top: 18px;
  font-size: 10px;
  border-collapse: collapse;
}

.shipping-invoice-table th {
  padding: 8px 6px;
  color: #ffffff;
  text-align: left;
  background: #1f4f4a;
  border: 1px solid #1f4f4a;
}

.shipping-invoice-table td {
  padding: 7px 6px;
  vertical-align: top;
  border: 1px solid #cad6d3;
}

.shipping-invoice-table tbody tr:nth-child(even) td {
  background: #f7faf9;
}

.shipping-invoice-table .num {
  text-align: right;
  white-space: nowrap;
}

.shipping-invoice-table tfoot td {
  font-weight: 800;
  background: #e8eeee;
}

.invoice-footer-note {
  margin-top: 16px;
  font-size: 10px;
  color: #6b7774;
}

.invoice-footer-note-strong {
  font-weight: 800;
  color: #172321;
}

.invoice-manufacturer-details {
  margin-top: 22px;
  padding-top: 12px;
  font-size: 10px;
  line-height: 1.5;
  color: #172321;
  border-top: 1px solid #c8d4d1;
}

.invoice-manufacturer-details strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.booking-doc-pdf {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  color: #111;
  font-family: var(--font-sans);
  font-size: 11px;
}

.booking-company-cn,
.booking-company-en,
.booking-title-cn,
.booking-title-en,
.booking-type {
  text-align: center;
  font-weight: 800;
}

.booking-company-cn {
  font-size: 14px;
  line-height: 1.1;
}

.booking-company-en {
  font-size: 13px;
  line-height: 1.1;
}

.booking-company-address {
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
}

.booking-title-cn {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.1;
}

.booking-title-en {
  font-size: 13px;
  line-height: 1.1;
}

.booking-type {
  font-size: 12px;
  line-height: 1.1;
  color: #425452;
}

.booking-route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #111;
}

.booking-route-grid > div {
  min-height: 54px;
  padding: 8px;
  background: #c0c0c0;
  border-right: 1px solid #111;
}

.booking-route-grid > div:last-child {
  border-right: 0;
}

.booking-route-grid span,
.booking-summary-label,
.booking-party-label {
  display: block;
  font-weight: 800;
}

.booking-route-grid strong {
  display: block;
  margin-top: 5px;
}

.booking-summary-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.booking-summary-grid > div {
  min-height: 40px;
  padding: 8px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.booking-summary-label {
  background: #c0c0c0;
}

.booking-po-values {
  white-space: pre-line;
}

.booking-party-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.booking-party-grid > div {
  min-height: 48px;
  padding: 8px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.booking-party-label {
  background: #c0c0c0;
}

.booking-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.booking-footer-grid > div {
  min-height: 54px;
  padding: 10px;
  background: #c0c0c0;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.booking-import-date {
  margin-top: -4px;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.customs-page {
  position: relative;
  box-sizing: border-box;
  color: #111;
  font-family: var(--font-sans);
  background: #fff;
  page-break-after: always;
  break-after: page;
}

.customs-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

.pdf-export-body .customs-page {
  overflow: hidden;
}

.pdf-export-body .customs-landscape {
  min-height: 702px;
}

.pdf-export-body .customs-portrait {
  min-height: 1030px;
}

.customs-landscape {
  width: 1044px;
  min-height: 702px;
  padding: 5px 8px;
}

.customs-portrait {
  width: 708px;
  min-height: 1030px;
  padding: 28px 24px;
}

.customs-title {
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 800;
  text-align: center;
}

.customs-declaration-topline {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  padding: 0 28px 0 24px;
  font-size: 10px;
  line-height: 1;
}

.customs-declaration-grid {
  display: grid;
  grid-template-columns:
    6.164fr 7.832fr 4.664fr 6.5fr 8.832fr
    10.832fr 12.332fr 11fr 5.5fr 8fr
    11.664fr 7.664fr 5.332fr 5.164fr 13fr
    13.832fr 4.164fr 6.832fr 10.164fr 9.164fr;
  border-top: 2px solid #111;
  border-left: 2px solid #111;
  font-size: 11px;
  line-height: 1.15;
}

.customs-grid-cell {
  min-height: 30px;
  padding: 2px 4px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.customs-span-1 { grid-column: span 1; }
.customs-span-2 { grid-column: span 2; }
.customs-span-3 { grid-column: span 3; }
.customs-span-4 { grid-column: span 4; }
.customs-span-5 { grid-column: span 5; }

.customs-declaration-docs {
  min-height: 40px;
  padding: 3px 4px;
  font-size: 11px;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
  border-left: 2px solid #111;
}

.customs-declaration-docs span {
  display: block;
  margin-top: 8px;
  padding-left: 128px;
  font-family: var(--font-sans);
}

.customs-declaration-marks {
  position: relative;
  min-height: 58px;
  padding: 4px;
  font-size: 11px;
  line-height: 1.25;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
  border-left: 2px solid #111;
}

.customs-declaration-marks span {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 56px;
  height: 24px;
  border-top: 2px solid #111;
  border-left: 2px solid #111;
}

.customs-declaration-confirm {
  display: grid;
  grid-template-columns: 1.55fr 0.48fr 1.7fr 0.55fr 2.4fr 0.62fr 3.8fr 0.55fr;
  font-size: 11px;
  line-height: 1;
  border-left: 2px solid #111;
}

.customs-declaration-confirm span,
.customs-declaration-confirm strong,
.customs-declaration-confirm em,
.customs-declaration-confirm i {
  min-height: 18px;
  padding: 3px 4px;
  font-style: normal;
  font-weight: 400;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.customs-declaration-confirm i {
  border-right: 2px solid #111;
}

.customs-declaration-table,
.customs-commercial-table,
.customs-packing-table,
.customs-elements-table {
  width: 100%;
  border-collapse: collapse;
}

.customs-declaration-table {
  table-layout: fixed;
  font-size: 10px;
  border-top: 1px solid #111;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  border-left: 1px solid #111;
}

.customs-declaration-table th,
.customs-declaration-table td {
  height: 38px;
  padding: 2px 4px;
  vertical-align: top;
  border-top: 1px solid #111;
  border-right: 0;
  border-bottom: 1px solid #111;
  border-left: 0;
}

.customs-declaration-table th {
  height: 20px;
  padding: 1px 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
}

.customs-declaration-table th:nth-child(1),
.customs-declaration-table td:nth-child(1) {
  width: 3.65%;
  text-align: center;
}

.customs-declaration-table th:nth-child(2),
.customs-declaration-table td:nth-child(2) {
  width: 7.41%;
}

.customs-declaration-table th:nth-child(3),
.customs-declaration-table td:nth-child(3) {
  width: 3.85%;
}

.customs-declaration-table th:nth-child(4),
.customs-declaration-table td:nth-child(4) {
  width: 18.97%;
}

.customs-declaration-table th:nth-child(5),
.customs-declaration-table td:nth-child(5) {
  width: 6.52%;
}

.customs-declaration-table th:nth-child(6),
.customs-declaration-table td:nth-child(6) {
  width: 3.26%;
}

.customs-declaration-table th:nth-child(7),
.customs-declaration-table td:nth-child(7) {
  width: 4.74%;
}

.customs-declaration-table th:nth-child(8),
.customs-declaration-table td:nth-child(8) {
  width: 6.92%;
}

.customs-declaration-table th:nth-child(9),
.customs-declaration-table td:nth-child(9) {
  width: 4.54%;
}

.customs-declaration-table th:nth-child(10),
.customs-declaration-table td:nth-child(10) {
  width: 6.22%;
}

.customs-declaration-table th:nth-child(11),
.customs-declaration-table td:nth-child(11) {
  width: 15.91%;
}

.customs-declaration-table th:nth-child(12),
.customs-declaration-table td:nth-child(12) {
  width: 6.52%;
}

.customs-declaration-table th:nth-child(13),
.customs-declaration-table td:nth-child(13) {
  width: 6.03%;
}

.customs-declaration-table th:nth-child(14),
.customs-declaration-table td:nth-child(14) {
  width: 5.43%;
}

.customs-declaration-table .num,
.customs-commercial-table .num,
.customs-packing-table .num {
  text-align: right;
  white-space: nowrap;
}

.customs-sign-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 2fr;
  min-height: 30px;
  font-size: 12px;
  border-right: 1px solid #111;
  border-bottom: 2px solid #111;
  border-left: 1px solid #111;
}

.customs-sign-row span {
  padding: 4px 5px;
}

.customs-stamp {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
}

.customs-red-stamp {
  right: 92px;
  bottom: 22px;
  width: 178px;
  opacity: 0.82;
}

.customs-blue-stamp {
  left: 50%;
  bottom: 132px;
  width: 360px;
  transform: translateX(-50%);
  opacity: 0.9;
}

.customs-packing-page .customs-blue-stamp {
  bottom: 208px;
}

.customs-elements-page .customs-blue-stamp {
  bottom: 88px;
}

.customs-doc-head {
  text-align: center;
}

.customs-doc-head h2 {
  margin: 0;
  font-size: 22px;
}

.customs-doc-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 400;
}

.customs-doc-head p {
  margin: 2px 0 10px;
  font-size: 12px;
}

.customs-doc-head h1 {
  margin: 6px 0 12px;
  font-size: 20px;
  text-decoration: underline;
}

.customs-doc-head h1 span {
  font-size: 18px;
}

.customs-invoice-meta {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 20px;
  margin-bottom: 28px;
  font-size: 12px;
}

.customs-invoice-meta div:last-child {
  display: grid;
  gap: 8px;
  text-align: right;
}

.customs-route-line {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 12px;
  border-top: 1px solid #111;
  border-bottom: 2px solid #111;
}

.customs-commercial-table {
  margin-top: 16px;
  font-size: 12px;
}

.customs-commercial-table th,
.customs-commercial-table td {
  padding: 4px;
}

.customs-commercial-table th {
  border-bottom: 1px solid #111;
}

.customs-commercial-table tfoot td,
.customs-packing-table tfoot td {
  padding-top: 8px;
  font-weight: 800;
  border-top: 1px solid #111;
}

.customs-origin-box {
  position: absolute;
  bottom: 60px;
  left: 28px;
  width: 440px;
  padding: 8px;
  font-size: 12px;
  border: 1px solid #111;
}

.customs-packing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  margin: 12px auto 20px;
  max-width: 620px;
  font-size: 15px;
}

.customs-packing-table {
  width: 620px;
  margin: 0 auto;
  font-size: 14px;
}

.customs-packing-table th,
.customs-packing-table td {
  padding: 4px 8px;
}

.customs-packing-table th {
  border-bottom: 2px solid #111;
}

.customs-packing-summary {
  margin-top: 90px;
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.customs-elements-table {
  margin-top: 80px;
  table-layout: fixed;
  font-size: 12px;
}

.customs-elements-table th,
.customs-elements-table td {
  padding: 4px;
  vertical-align: top;
  border: 1px solid #111;
}

.customs-elements-table th {
  font-weight: 400;
}

.customs-elements-notes {
  margin: 22px 0 0 5px;
  font-size: 13px;
  line-height: 1.8;
}

.customs-elements-notes span {
  display: inline-block;
  width: 150px;
}

.alpinestars-invoice-pdf {
  padding: 14px;
  font-family: var(--font-sans);
  color: #111;
}

.alpinestars-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.alpinestars-header-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr 0.95fr;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.alpinestars-box {
  min-height: 58px;
  padding: 5px 6px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.alpinestars-box span,
.alpinestars-route-grid span {
  display: block;
  margin-bottom: 3px;
  font-size: 7.5px;
  font-weight: 700;
  color: #222;
  text-transform: uppercase;
}

.alpinestars-box strong,
.alpinestars-route-grid strong {
  display: block;
  font-size: 9px;
}

.alpinestars-box p {
  margin: 3px 0 0;
  font-size: 8.5px;
  line-height: 1.25;
}

.alpinestars-route-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 8px;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.alpinestars-route-grid > div {
  min-height: 32px;
  padding: 5px 6px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.alpinestars-invoice-table {
  width: 100%;
  margin-top: 8px;
  font-size: 7.4px;
  table-layout: fixed;
  border-collapse: collapse;
}

.alpinestars-invoice-table th,
.alpinestars-invoice-table td {
  padding: 3px 4px;
  vertical-align: top;
  border: 1px solid #111;
}

.alpinestars-invoice-table th {
  font-weight: 800;
  text-align: center;
  background: #fff;
}

.alpinestars-invoice-table th:nth-child(1),
.alpinestars-invoice-table td:nth-child(1) {
  width: 7%;
}

.alpinestars-invoice-table th:nth-child(2),
.alpinestars-invoice-table td:nth-child(2),
.alpinestars-invoice-table th:nth-child(3),
.alpinestars-invoice-table td:nth-child(3) {
  width: 7%;
}

.alpinestars-invoice-table th:nth-child(4),
.alpinestars-invoice-table td:nth-child(4) {
  width: 17%;
}

.alpinestars-invoice-table th:nth-child(5),
.alpinestars-invoice-table td:nth-child(5) {
  width: 8%;
}

.alpinestars-invoice-table th:nth-child(6),
.alpinestars-invoice-table td:nth-child(6) {
  width: 20%;
}

.alpinestars-invoice-table th:nth-child(7),
.alpinestars-invoice-table td:nth-child(7),
.alpinestars-invoice-table th:nth-child(8),
.alpinestars-invoice-table td:nth-child(8) {
  width: 6%;
  text-align: center;
}

.alpinestars-invoice-table th:nth-child(9),
.alpinestars-invoice-table td:nth-child(9),
.alpinestars-invoice-table th:nth-child(10),
.alpinestars-invoice-table td:nth-child(10),
.alpinestars-invoice-table th:nth-child(11),
.alpinestars-invoice-table td:nth-child(11) {
  width: 7%;
}

.alpinestars-invoice-table .num,
.alpinestars-invoice-table tfoot td {
  text-align: right;
  white-space: nowrap;
}

.alpinestars-amount-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  margin-top: 8px;
  border: 1px solid #111;
}

.alpinestars-amount-row span,
.alpinestars-amount-row strong {
  padding: 5px 6px;
  font-size: 8.5px;
}

.alpinestars-amount-row span {
  border-right: 1px solid #111;
}

.alpinestars-footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.9fr;
  gap: 14px;
  margin-top: 10px;
  font-size: 8.5px;
  line-height: 1.35;
}

.alpinestars-footer-grid p {
  margin: 4px 0 0;
}

.alpinestars-signature {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 54px;
  border-top: 1px solid #111;
}

.polaris-invoice-pdf {
  padding: 12px;
  font-family: var(--font-sans);
  color: #111;
}

.polaris-title {
  margin-bottom: 8px;
  padding: 5px 0;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  background: #0070c0;
}

.polaris-header-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.polaris-seller,
.polaris-info {
  padding: 5px 6px;
  font-size: 8px;
  line-height: 1.35;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.polaris-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.polaris-info > div {
  min-height: 18px;
  padding: 4px 5px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.polaris-info span,
.polaris-address-grid span {
  display: block;
  margin-bottom: 2px;
  font-size: 7.5px;
  font-weight: 800;
}

.polaris-info strong,
.polaris-address-grid strong {
  display: block;
  font-size: 8.5px;
}

.polaris-address-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1.4fr;
  border-left: 1px solid #111;
}

.polaris-address-grid > div {
  min-height: 54px;
  padding: 5px 6px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.polaris-address-grid p {
  margin: 3px 0 0;
  font-size: 8px;
  line-height: 1.25;
}

.polaris-invoice-table {
  width: 100%;
  margin-top: 8px;
  font-size: 6.8px;
  table-layout: fixed;
  border-collapse: collapse;
}

.polaris-invoice-table th,
.polaris-invoice-table td {
  padding: 3px 3px;
  vertical-align: top;
  border: 1px solid #111;
}

.polaris-invoice-table th {
  font-weight: 800;
  color: #fff;
  text-align: center;
  background: #0070c0;
}

.polaris-invoice-table th:nth-child(1),
.polaris-invoice-table td:nth-child(1) {
  width: 7%;
}

.polaris-invoice-table th:nth-child(2),
.polaris-invoice-table td:nth-child(2) {
  width: 11%;
}

.polaris-invoice-table th:nth-child(3),
.polaris-invoice-table td:nth-child(3) {
  width: 17%;
}

.polaris-invoice-table th:nth-child(4),
.polaris-invoice-table td:nth-child(4) {
  width: 10%;
}

.polaris-invoice-table th:nth-child(5),
.polaris-invoice-table td:nth-child(5) {
  width: 9%;
}

.polaris-invoice-table th:nth-child(6),
.polaris-invoice-table td:nth-child(6) {
  width: 5%;
}

.polaris-invoice-table th:nth-child(7),
.polaris-invoice-table td:nth-child(7) {
  width: 6%;
}

.polaris-invoice-table th:nth-child(8),
.polaris-invoice-table td:nth-child(8) {
  width: 8%;
}

.polaris-invoice-table th:nth-child(9),
.polaris-invoice-table td:nth-child(9) {
  width: 18%;
}

.polaris-invoice-table th:nth-child(10),
.polaris-invoice-table td:nth-child(10) {
  width: 7%;
}

.polaris-invoice-table th:nth-child(11),
.polaris-invoice-table td:nth-child(11),
.polaris-invoice-table th:nth-child(12),
.polaris-invoice-table td:nth-child(12) {
  width: 8%;
}

.polaris-invoice-table .num,
.polaris-invoice-table tfoot td {
  text-align: right;
  white-space: nowrap;
}

.polaris-invoice-table tfoot td:first-child {
  text-align: left;
}

.ssdesign-invoice-pdf {
  padding: 12px;
  font-family: var(--font-sans);
  color: #111;
}

.ssdesign-brand {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.ssdesign-brand-sub {
  margin: 2px 0 8px;
  font-size: 9px;
  text-align: center;
}

.ssdesign-title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.ssdesign-top-grid {
  display: grid;
  grid-template-columns: 70px 1fr 92px 150px;
  grid-template-areas:
    "seller-label seller-body invoice-label invoice-value"
    "seller-label seller-body date-label date-value";
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.ssdesign-mid-grid {
  display: grid;
  grid-template-columns: 90px 1.4fr 120px 1fr;
  grid-template-areas:
    "consignee-label consignee-body notify1-label notify1-body"
    "consignee-label consignee-body notify2-label notify2-body";
  margin-top: 12px;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.ssdesign-seller-label {
  grid-area: seller-label;
}

.ssdesign-seller-body {
  grid-area: seller-body;
}

.ssdesign-invoice-label {
  grid-area: invoice-label;
}

.ssdesign-invoice-value {
  grid-area: invoice-value;
}

.ssdesign-date-label {
  grid-area: date-label;
}

.ssdesign-date-value {
  grid-area: date-value;
}

.ssdesign-consignee-label {
  grid-area: consignee-label;
}

.ssdesign-consignee-body {
  grid-area: consignee-body;
}

.ssdesign-notify1-label {
  grid-area: notify1-label;
}

.ssdesign-notify1-body {
  grid-area: notify1-body;
}

.ssdesign-notify2-label {
  grid-area: notify2-label;
}

.ssdesign-notify2-body {
  grid-area: notify2-body;
}

.ssdesign-route-grid {
  display: grid;
  grid-template-columns: 130px 1fr 130px 1fr 130px 1fr;
  margin-top: 10px;
  border-top: 1px solid #111;
  border-left: 1px solid #111;
}

.ssdesign-field-label,
.ssdesign-side-label,
.ssdesign-notify-label {
  font-weight: 800;
  background: #c0c0c0;
}

.ssdesign-field-label,
.ssdesign-field-body,
.ssdesign-side-label,
.ssdesign-side-value,
.ssdesign-notify-label,
.ssdesign-notify-body,
.ssdesign-route-grid > div {
  min-height: 24px;
  padding: 5px 6px;
  font-size: 8px;
  line-height: 1.25;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}

.ssdesign-field-body strong {
  display: block;
  font-size: 8.5px;
}

.ssdesign-field-body p {
  margin: 3px 0 0;
}

.ssdesign-invoice-table {
  width: 100%;
  margin-top: 10px;
  font-size: 7.2px;
  table-layout: fixed;
  border-collapse: collapse;
}

.ssdesign-invoice-table th,
.ssdesign-invoice-table td {
  padding: 3px 4px;
  vertical-align: top;
  border: 1px solid #111;
}

.ssdesign-invoice-table th {
  font-weight: 800;
  text-align: center;
  background: #c0c0c0;
}

.ssdesign-invoice-table th:nth-child(1),
.ssdesign-invoice-table td:nth-child(1) {
  width: 9%;
}

.ssdesign-invoice-table th:nth-child(2),
.ssdesign-invoice-table td:nth-child(2) {
  width: 9%;
}

.ssdesign-invoice-table th:nth-child(3),
.ssdesign-invoice-table td:nth-child(3) {
  width: 9%;
}

.ssdesign-invoice-table th:nth-child(4),
.ssdesign-invoice-table td:nth-child(4) {
  width: 9%;
}

.ssdesign-invoice-table th:nth-child(5),
.ssdesign-invoice-table td:nth-child(5) {
  width: 6%;
}

.ssdesign-invoice-table th:nth-child(6),
.ssdesign-invoice-table td:nth-child(6) {
  width: 19%;
}

.ssdesign-invoice-table th:nth-child(7),
.ssdesign-invoice-table td:nth-child(7) {
  width: 21%;
}

.ssdesign-invoice-table th:nth-child(8),
.ssdesign-invoice-table td:nth-child(8) {
  width: 8%;
}

.ssdesign-invoice-table th:nth-child(9),
.ssdesign-invoice-table td:nth-child(9) {
  width: 8%;
}

.ssdesign-invoice-table th:nth-child(10),
.ssdesign-invoice-table td:nth-child(10) {
  width: 8%;
}

.ssdesign-invoice-table .num,
.ssdesign-invoice-table tfoot td {
  text-align: right;
  white-space: nowrap;
}

.ssdesign-invoice-table tfoot td:first-child {
  font-weight: 800;
  text-align: left;
  background: #c0c0c0;
}

.ssdesign-manufacturer {
  margin-top: 8px;
  font-size: 8px;
  line-height: 1.3;
}

.ssdesign-manufacturer strong {
  display: block;
  margin-bottom: 3px;
}

.ssdesign-manufacturer p {
  margin: 0;
}

.invoice-manufacturer-details p {
  margin: 0;
}

@media (max-width: 1180px) {
  .form-grid,
  .form-panel .form-grid,
  .document-settings-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .document-settings-grid.two-column {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .document-profile-identity-grid,
  .document-profile-fields-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .find-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .invoice-nav-toolbar {
    grid-template-columns: minmax(300px, 1fr) auto;
  }

  .invoice-position-control {
    display: none;
  }

  .invoice-action-group summary {
    padding: 8px 8px;
    font-size: 12px;
  }

  .invoice-nav-main .invoice-search {
    min-width: 150px;
    max-width: 190px;
  }

  .wip-matrix-panel .panel-head {
    align-items: flex-start;
  }

  .wip-matrix-head-actions {
    flex-direction: column;
    align-items: flex-end;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .nav-list {
    flex: none;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar,
  .split,
  .workspace-grid,
  .two-column-form,
  .style-layout,
  .tool-converter-grid,
  .import-grid,
  .style-fabric-row,
  .job-style-meta-row,
  .job-style-fabric-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .global-search {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .document-profile-workspace {
    grid-template-columns: 1fr;
  }

  .document-profile-list {
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-row,
  .summary-strip,
  .pdf-grid,
  .lookup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wip-search-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

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

  .wip-unified-import-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .wip-health-filters {
    grid-template-columns: repeat(6, minmax(88px, 1fr));
  }
}

@media (max-width: 620px) {
  .main {
    padding: 14px;
  }

  .nav-list,
  .metric-row,
  .summary-strip,
  .form-grid,
  .form-panel .form-grid,
  .document-settings-grid,
  .document-settings-grid.two-column,
  .find-grid,
  .pdf-grid,
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .document-settings-grid .field-span-2 {
    grid-column: auto;
  }

  .document-settings-grid .row-start {
    grid-column-start: auto;
  }

  .document-profile-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-profile-identity-grid,
  .document-profile-fields-grid {
    grid-template-columns: 1fr;
  }

  .document-profile-fields-grid .profile-manufacturer-field {
    grid-column: auto;
  }

  .wip-matrix-panel .panel-head,
  .wip-matrix-head-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .wip-directory-toolbar,
  .wip-master-create,
  .wip-search-grid {
    grid-template-columns: 1fr;
  }

  .wip-health-filter {
    border-bottom: 1px solid var(--line);
  }

  .wip-date-grid,
  .wip-alert-grid {
    grid-template-columns: 1fr;
  }

  .pdf-page {
    padding: 16px;
  }
}
