:root {
  --bg: #0d0f12;
  --panel: #171b20;
  --panel-2: #20262d;
  --text: #f4f7fb;
  --muted: #9aa6b2;
  --line: #303842;
  --red: #b51218;
  --accent: #b51218;
  --green: #20b26b;
  --amber: #f2a93b;
  --blue: #5aa7ff;
  --white: #ffffff;
  --header: #08090b;
  --input-bg: #0b0d10;
  --secondary: #2a313a;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #edf1f5;
  --text: #05080c;
  --muted: #2f3a46;
  --line: #b8c2cc;
  --red: #d71920;
  --accent: #d71920;
  --header: #ffffff;
  --input-bg: #ffffff;
  --secondary: #e3e8ee;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: #05080c;
  border-color: #b7c2ce;
}

[data-theme="light"] th,
[data-theme="light"] .jobs-edit-table th {
  color: #26313d;
}

[data-theme="light"] td,
[data-theme="light"] .jobs-edit-table td {
  color: #05080c;
}

[data-theme="light"] .job-group-divider span,
[data-theme="light"] .manual-preview-job-bar span {
  color: #26313d;
}

[data-theme="light"] .job-notes-edit span {
  color: #2f3a46;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cloud-auth-pending > .app-header,
.cloud-auth-pending > main {
  visibility: hidden;
}

.site-login-gate[hidden] {
  display: none;
}

.site-login-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background: var(--bg);
}

.site-login-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .22);
}

.site-login-logo {
  width: 150px;
  height: auto;
}

[data-theme="dark"] .site-login-logo {
  content: url("./assets/ozrite-logo-dark.png");
}

.site-login-heading {
  display: grid;
  gap: 5px;
}

.site-login-heading span {
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.site-login-heading h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.site-login-form {
  display: grid;
  gap: 14px;
}

.site-login-form label {
  display: grid;
  gap: 6px;
}

.site-login-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-login-form input,
.site-login-form button {
  min-height: 48px;
  font-size: 16px;
}

.site-login-message {
  min-height: 18px;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .site-login-gate {
    padding: 14px;
  }

  .site-login-panel {
    padding: 24px 20px;
  }
}

[hidden] {
  display: none !important;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-logo {
  width: 156px;
  max-height: 72px;
  object-fit: contain;
  background: var(--white);
  border-radius: 6px;
  padding: 5px 7px;
}

[data-theme="dark"] .brand-logo {
  content: url("./assets/ozrite-logo-dark.png");
  background: transparent;
  filter: none;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; line-height: 1.1; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 16px; }
p { color: var(--muted); }

.tabs {
  display: flex;
  justify-content: center;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

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

button {
  border: 0;
  background: var(--red);
  color: var(--white);
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  text-transform: none;
}

button.secondary { background: var(--secondary); color: var(--text); }
button.danger { background: #7d1f24; }
button:disabled { opacity: .45; cursor: not-allowed; }

[data-theme="light"] button:not(.secondary):not(.tab):not(.bucket-tab):not(.settings-tab):not(.label-preview-tab),
[data-theme="light"] .bucket-tab.active,
[data-theme="light"] .settings-tab.active,
[data-theme="light"] .label-preview-tab.active {
  color: #fff;
}

.theme-toggle {
  justify-self: end;
  min-width: 88px;
}

.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 9px 8px;
  white-space: nowrap;
}

.tab.active {
  color: var(--text);
  border-color: #56616e;
  background: #18202a;
}

[data-theme="light"] .tab.active {
  border-color: #c5ced8;
  background: #edf1f5;
}

main {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-title-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
  min-width: 128px;
}

.settings-title-actions #settings-edit-toggle {
  width: 100%;
}

.settings-user-session {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  min-height: 40px;
  margin-top: 10px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-user-session[hidden] {
  display: none;
}

.settings-user-session > div {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.settings-user-session span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-user-session strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settings:not(.settings-editing) [data-settings-panel]:not([data-settings-panel="backup"]) input:disabled,
#settings:not(.settings-editing) [data-settings-panel]:not([data-settings-panel="backup"]) select:disabled,
#settings:not(.settings-editing) [data-settings-panel]:not([data-settings-panel="backup"]) textarea:disabled {
  opacity: 1;
  color: var(--muted);
  background: var(--panel-2);
  border-color: transparent;
  cursor: not-allowed;
}

#settings:not(.settings-editing) [data-settings-panel]:not([data-settings-panel="backup"]) button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

#settings:not(.settings-editing) details.settings-add-card {
  opacity: .68;
}

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

.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .6fr);
  gap: 16px;
  margin-top: 16px;
}

#dashboard {
  min-height: calc(100vh - 132px);
}

.dashboard-title {
  align-items: center;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dashboard-display-logo {
  display: none;
  width: 148px;
  max-height: 62px;
  object-fit: contain;
}

[data-theme="dark"] .dashboard-display-logo {
  content: url("./assets/ozrite-logo-dark.png");
}

.dashboard-display-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.dashboard-clock {
  display: grid;
  justify-items: end;
  min-width: 210px;
  text-transform: uppercase;
}

.dashboard-clock strong {
  color: var(--text);
  font-size: 44px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.dashboard-clock span {
  color: var(--muted);
  margin-top: 6px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .06em;
}

.dashboard-fullscreen {
  min-width: 116px;
}

body.factory-display-mode {
  overflow-x: hidden;
}

body.factory-display-mode .app-header {
  display: none !important;
}

body.factory-display-mode main {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 22px 26px 28px;
}

body.factory-display-mode #dashboard {
  min-height: calc(100vh - 50px);
}

body.factory-display-mode .dashboard-fullscreen {
  display: none;
}

body.factory-display-mode .dashboard-display-logo {
  display: block;
}

body.factory-display-mode .dashboard-heading h2 {
  font-size: 32px;
}

body.factory-display-mode .dashboard-clock strong {
  font-size: 64px;
}

body.factory-display-mode .dashboard-clock span {
  margin-top: 8px;
  font-size: 21px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
}

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

.factory-metric {
  min-height: 148px;
  display: grid;
  align-content: center;
  border-color: rgba(215, 25, 32, .28);
  background:
    linear-gradient(135deg, rgba(215, 25, 32, .14), transparent 58%),
    var(--panel);
}

.factory-metric strong {
  font-size: clamp(54px, 5.8vw, 104px);
  letter-spacing: 0;
}

.factory-metric span {
  font-size: clamp(15px, 1.1vw, 22px);
  text-transform: uppercase;
}

.dashboard-powdercoat {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(260px, 1.35fr) repeat(3, minmax(108px, .62fr)) minmax(280px, 1.55fr);
  align-items: stretch;
  gap: 0;
  margin-top: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
}

.dashboard-powdercoat > div {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: center;
  padding: 14px 18px;
  border-left: 1px solid var(--line);
}

.dashboard-powdercoat > div:first-child {
  border-left: 0;
}

.dashboard-powdercoat-title {
  background: rgba(215, 25, 32, .06);
}

.dashboard-powdercoat-title span,
.dashboard-powdercoat-date small,
.dashboard-powdercoat-date span,
.dashboard-powdercoat-stat span,
.dashboard-powdercoat-colours small {
  color: var(--muted);
  font-size: clamp(11px, .75vw, 15px);
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-powdercoat-title span {
  color: var(--red);
}

.dashboard-powdercoat-title strong {
  margin-top: 7px;
  color: var(--text);
  font-size: clamp(16px, 1.05vw, 21px);
  line-height: 1.05;
  white-space: nowrap;
  text-transform: uppercase;
}

.dashboard-powdercoat.is-empty {
  border-color: var(--line);
  border-left-color: var(--muted);
}

.dashboard-powdercoat.is-empty .dashboard-powdercoat-title {
  background: var(--panel-2);
}

.dashboard-powdercoat.is-empty .dashboard-powdercoat-title strong {
  color: var(--muted);
}

.dashboard-powdercoat.is-empty .dashboard-powdercoat-title span {
  color: var(--muted);
}

.dashboard-powdercoat-date strong {
  margin: 3px 0;
  font-size: clamp(23px, 1.65vw, 34px);
  line-height: 1;
  text-transform: uppercase;
}

.dashboard-powdercoat-stat {
  justify-items: center;
  text-align: center;
}

.dashboard-powdercoat-stat strong {
  font-size: clamp(36px, 2.7vw, 52px);
  line-height: .95;
}

.dashboard-powdercoat-colours strong {
  margin-top: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(15px, 1vw, 20px);
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.dashboard-stage {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.dashboard-command-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.dashboard-stage-secondary {
  grid-template-columns: 1.1fr .9fr;
}

.dashboard-card {
  min-height: 100%;
}

.dashboard-card h3 {
  font-size: clamp(18px, 1.35vw, 26px);
  text-transform: uppercase;
}

.snapshot-list,
.analytics-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.snapshot-row,
.analytics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.snapshot-row span,
.analytics-row span {
  color: var(--muted);
  font-weight: 700;
}

.snapshot-row strong,
.analytics-row strong {
  text-align: right;
  font-size: 16px;
}

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

.factory-focus-item {
  min-height: 100px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.factory-focus-item strong {
  font-size: clamp(38px, 3.4vw, 64px);
  line-height: 1;
}

.factory-focus-item span {
  color: var(--muted);
  font-weight: 950;
  text-transform: uppercase;
}

.factory-rank-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.factory-rank {
  display: grid;
  gap: 8px;
}

.factory-rank-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: clamp(17px, 1.25vw, 24px);
  font-weight: 950;
}

.factory-rank-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factory-rank-head span {
  color: var(--muted);
}

.factory-rank-bar {
  height: 18px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.factory-rank-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #f3c23b);
}

.factory-pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.factory-pulse {
  min-height: 118px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.factory-pulse strong {
  font-size: clamp(44px, 4vw, 74px);
  line-height: 1;
}

.factory-pulse span {
  color: var(--muted);
  font-weight: 950;
  text-transform: uppercase;
}

.factory-pulse.danger { border-color: rgba(215,25,32,.55); }
.factory-pulse.warn { border-color: rgba(243,194,59,.62); }
.factory-pulse.good { border-color: rgba(43,164,94,.6); }
.factory-pulse.sun { border-color: rgba(255,211,89,.6); }

.factory-action-list,
.factory-asap-list,
.factory-highlight-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.factory-action-item,
.factory-asap-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: linear-gradient(135deg, rgba(215, 25, 32, .18), var(--panel-2));
  border: 1px solid rgba(215, 25, 32, .42);
  border-radius: 8px;
}

.factory-action-item.delivery {
  background: linear-gradient(135deg, rgba(43, 164, 94, .18), var(--panel-2));
  border-color: rgba(43, 164, 94, .46);
}

.factory-action-item.pickup {
  background: linear-gradient(135deg, rgba(255, 211, 89, .2), var(--panel-2));
  border-color: rgba(255, 211, 89, .48);
}

.factory-action-main,
.factory-action-meta,
.factory-asap-main,
.factory-asap-meta {
  display: grid;
  gap: 4px;
}

.factory-action-main strong,
.factory-asap-main strong {
  font-size: clamp(30px, 2.7vw, 54px);
  line-height: .9;
  letter-spacing: 0;
}

.factory-action-main span,
.factory-asap-main span {
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 950;
  text-transform: uppercase;
}

.factory-action-meta,
.factory-asap-meta {
  min-width: 170px;
  justify-items: end;
  text-align: right;
  text-transform: uppercase;
}

.factory-action-meta b,
.factory-asap-meta b {
  color: var(--danger);
  font-size: clamp(18px, 1.3vw, 26px);
}

.factory-action-item.delivery .factory-action-meta b {
  color: #2ba45e;
}

.factory-action-item.pickup .factory-action-meta b {
  color: #d39c00;
}

.factory-action-meta span,
.factory-action-meta small,
.factory-asap-meta span,
.factory-asap-meta small {
  color: var(--muted);
  font-weight: 950;
  font-size: clamp(12px, .9vw, 17px);
}

.factory-mix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.factory-mix-section {
  min-width: 0;
}

.factory-mix-section h4 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 950;
  text-transform: uppercase;
}

.factory-mix-section .factory-rank-list {
  margin-top: 0;
}

.factory-mix-section .factory-rank {
  gap: 6px;
}

.factory-mix-section .factory-rank-head {
  font-size: clamp(15px, 1.05vw, 20px);
}

.factory-mix-section .factory-rank-bar {
  height: 14px;
}

.factory-highlight,
.factory-empty {
  min-height: 52px;
  display: grid;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 850;
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 8px 0 12px;
}

input, select {
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 10px;
}

input[type="search"] {
  min-width: 320px;
  flex: 1;
}

.field-label, .field-inline, .check {
  color: var(--muted);
  font-weight: 800;
}

.field-inline input { width: 110px; margin-left: 8px; }
.hint { font-size: 13px; }

.input-stack {
  display: grid;
  gap: 16px;
}

.input-method-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: 820px;
  margin-bottom: 14px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.input-method-tab {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.input-method-tab.active {
  color: #fff;
  background: var(--red);
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  margin-left: 5px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.input-method-tab.active .beta-badge {
  color: #111;
  background: #fff;
  border-color: #fff;
}

.input-method-panel[hidden] {
  display: none !important;
}

.shopify-heading {
  align-items: flex-start;
}

.shopify-heading p {
  margin-top: 4px;
}

.shopify-connection-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.shopify-connection-badge.connected {
  color: #0b6b42;
  background: #dff7ea;
  border-color: #97dab8;
}

.shopify-import-state {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.shopify-import-state > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.shopify-import-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.shopify-import-toolbar input[type="search"] {
  min-width: 0;
}

.shopify-order-results,
.shopify-pre-draft {
  display: grid;
  gap: 8px;
}

.shopify-order-results {
  max-height: 460px;
  overflow: auto;
}

.shopify-order-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.shopify-order-card:has(input:checked) {
  border-color: var(--red);
  box-shadow: inset 3px 0 0 var(--red);
}

.shopify-order-card.is-imported {
  opacity: .62;
  cursor: default;
}

.shopify-order-card.is-non-production {
  opacity: .72;
  cursor: default;
}

.shopify-order-card input {
  min-height: 18px;
  width: 18px;
}

.shopify-order-primary,
.shopify-order-secondary {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shopify-order-primary strong,
.shopify-order-secondary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopify-order-card small {
  color: var(--muted);
  font-weight: 800;
}

.shopify-import-status {
  min-width: 86px;
  text-align: center;
  white-space: nowrap;
}

.shopify-selection-actions,
.shopify-draft-actions {
  margin-top: 12px;
}

.shopify-pre-draft {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.shopify-preview-order {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shopify-preview-order-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  background: var(--panel-2);
}

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

.shopify-preview-order-head > div strong {
  font-size: 15px;
}

.shopify-preview-order-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shopify-preview-order-head .icon-delete-line {
  margin-left: auto;
}

.shopify-review-status {
  margin-left: auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.shopify-review-status.has-issues {
  color: #8a4d00;
  background: #fff0d2;
  border-color: #e6b85d;
}

.shopify-review-status.is-ready {
  color: #0b6b42;
  background: #dff7ea;
  border-color: #97dab8;
}

.shopify-order-fields,
.shopify-review-grid {
  display: grid;
  gap: 8px;
}

.shopify-order-fields {
  grid-template-columns: 100px minmax(190px, 1.2fr) 120px 130px 150px minmax(220px, 1.5fr);
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.shopify-review-blinds {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.shopify-order-snapshot {
  margin: 12px 12px 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.shopify-order-snapshot > header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.shopify-order-snapshot > header > div:first-child {
  display: grid;
  gap: 2px;
}

.shopify-order-snapshot > header span,
.shopify-order-snapshot small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.shopify-order-snapshot > header > div:first-child > span {
  text-transform: uppercase;
}

.shopify-snapshot-badges {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.shopify-snapshot-badges span {
  padding: 4px 7px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.shopify-snapshot-meta {
  display: grid;
  grid-template-columns: minmax(170px, .45fr) minmax(260px, 1fr);
  gap: 10px;
  padding: 8px 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.shopify-snapshot-items {
  display: grid;
}

.shopify-snapshot-item {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) 40px minmax(0, 1.5fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.shopify-snapshot-item:last-child {
  border-bottom: 0;
}

.shopify-snapshot-item.is-addon {
  background: color-mix(in srgb, var(--warning) 9%, transparent);
}

.shopify-snapshot-item > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shopify-snapshot-item > div:first-child strong {
  font-size: 11px;
  line-height: 1.25;
}

.shopify-snapshot-qty {
  text-align: center;
}

.shopify-snapshot-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
  font-size: 10px;
}

.shopify-review-blind {
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-left: 4px solid #22a66a;
  border-radius: 6px;
}

.shopify-review-blind.has-issues {
  border-left-color: #d58b18;
}

.shopify-review-blind-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.shopify-review-blind-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.shopify-review-grid {
  grid-template-columns: 130px minmax(190px, 1.4fr) 92px 100px minmax(160px, 1.1fr) 130px 138px 110px 92px minmax(150px, 1fr) minmax(170px, 1.2fr);
  padding: 10px;
}

.shopify-review-field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.shopify-review-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.shopify-review-field input,
.shopify-review-field select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.shopify-review-field.has-error > span {
  color: var(--danger);
}

.shopify-review-field.has-error input,
.shopify-review-field.has-error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.shopify-source-details {
  border-top: 1px solid var(--line);
}

.shopify-source-details summary {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.shopify-source-details > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}

.shopify-source-details > div > * {
  padding: 5px 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
}

[data-theme="dark"] .shopify-review-status.has-issues {
  color: #ffd38a;
  background: #4a3011;
  border-color: #765021;
}

[data-theme="dark"] .shopify-review-status.is-ready,
[data-theme="dark"] .shopify-connection-badge.connected {
  color: #8aefba;
  background: #113b2a;
  border-color: #246b4b;
}

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

.manual-job-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.manual-job-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.manual-job-form [hidden] {
  display: none !important;
}

.manual-job-form label.manual-label-error {
  color: #ff8a90;
}

.manual-job-form label.manual-optional-field {
  opacity: .54;
}

.manual-job-form label.manual-optional-field:focus-within {
  opacity: 1;
}

.manual-job-form .manual-field-error {
  border-color: #ff5f66;
  background: rgba(215, 25, 32, .14);
  box-shadow: 0 0 0 2px rgba(215, 25, 32, .28);
}

[data-theme="light"] .manual-job-form .manual-field-error {
  background: #fff1f2;
}

.manual-job-form .span-2 {
  grid-column: span 2;
}

.manual-job-form .span-4 {
  grid-column: 1 / -1;
}

.form-subhead {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  padding-top: 4px;
  padding-bottom: 8px;
  text-transform: none;
}

.manual-blind-summary {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px;
  overflow: auto;
}

.manual-summary-empty,
.manual-summary-head {
  color: var(--muted);
}

.manual-summary-head {
  margin-bottom: 8px;
}

.manual-reorder-list {
  display: grid;
  gap: 10px;
}

.manual-preview-job {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  overflow: auto;
}

.manual-preview-job.dragging {
  opacity: .62;
}

.manual-preview-job.drag-over {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(215, 25, 32, .28);
}

.manual-preview-job-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 1120px;
  padding: 7px 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.manual-preview-job-bar span {
  color: var(--muted);
}

.manual-drag-handle {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: grab;
  font-size: 11px;
}

.manual-drag-handle:active {
  cursor: grabbing;
}

.manual-preview-sheet {
  min-width: 1120px;
  background: #fff;
  color: #000;
  padding: 8px;
  border-radius: 6px;
}

.manual-preview-sheet .compact-table th,
.manual-preview-sheet .compact-table td {
  color: #000;
  border-color: #111;
  height: 18px;
  font-size: 7.4px;
  text-align: center;
  text-transform: uppercase;
}

.manual-preview-sheet .compact-table th {
  background: #f1f1f1;
}

.manual-preview-table .manual-preview-action-cell {
  width: 34px;
  min-width: 34px;
}

.manual-preview-table .icon-delete-line {
  width: 22px;
  height: 22px;
  min-height: 22px;
  font-size: 14px;
}

.manual-job-form textarea {
  min-height: 90px;
  margin: 0;
}

.manual-extras-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.manual-extra-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
  white-space: nowrap;
}

.manual-extra-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.manual-job-form .manual-custom-due,
.manual-job-form .manual-delivery-suburb,
.manual-job-form .manual-custom-field {
  display: none;
}

.manual-job-form .manual-custom-due.show,
.manual-job-form .manual-delivery-suburb.show,
.manual-job-form .manual-custom-field.show {
  display: grid;
}

.data-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.table-edit {
  width: 100%;
  min-width: 90px;
  min-height: 30px;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  text-align: center;
}

.table-edit.size-edit {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.table-edit.blind-no-edit,
.table-edit.tube-edit,
.table-edit.side-edit {
  width: 64px;
  min-width: 64px;
  max-width: 72px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.table-edit.due-edit,
.table-edit.order-edit {
  width: 82px;
  min-width: 82px;
  max-width: 92px;
}

.table-edit.type-edit,
.table-edit.control-edit {
  min-width: 104px;
}

.table-edit.hardware-edit {
  min-width: 92px;
}

.table-edit.suburb-edit {
  min-width: 96px;
}

.table-edit.customer-edit,
.table-edit.blind-type-edit,
.table-edit.fabric-edit,
.table-edit.bottom-rail-edit,
.table-edit.extras-edit,
.table-edit.notes-edit {
  min-width: 132px;
}

.jobs-edit-table {
  table-layout: auto;
  min-width: 0;
  width: 100%;
}

.mobile-job-cards {
  display: none;
}

.jobs-edit-table th,
.jobs-edit-table td {
  padding: 4px 2px;
}

.jobs-edit-table th {
  font-size: 9px;
  letter-spacing: 0;
  white-space: normal;
  line-height: 1.05;
}

.jobs-edit-table td {
  font-size: 10px;
}

.jobs-edit-table .table-edit,
.jobs-edit-table .sheet-select {
  min-width: 0;
  min-height: 26px;
  height: 26px;
  padding: 2px 3px;
  font-size: 9.5px;
  border-radius: 5px;
  text-align: center;
  text-align-last: center;
}

.jobs-edit-table .order-edit { width: 56px; }
.jobs-edit-table .customer-edit { width: 110px; }
.jobs-edit-table .due-edit { width: 50px; text-align: center; }
.jobs-edit-table .type-edit { width: 64px; }
.jobs-edit-table .suburb-edit { width: 76px; }
.jobs-edit-table .supply-type-edit { width: 80px; }
.jobs-edit-table .blind-no-edit { width: 50px; text-align: center; }
.jobs-edit-table .blind-type-edit { width: 118px; }
.jobs-edit-table .fabric-edit { width: 76px; }
.jobs-edit-table .size-edit { width: 50px; text-align: center; }
.jobs-edit-table .hardware-edit { width: 62px; }
.jobs-edit-table .control-edit { width: 56px; }
.jobs-edit-table .side-edit { width: 42px; text-align: center; }
.jobs-edit-table .tube-edit { width: 56px; text-align: center; }
.jobs-edit-table .bottom-rail-edit { width: 106px; }
.jobs-edit-table .extras-edit { width: 96px; }
.jobs-edit-table .notes-edit { width: 100%; }
.jobs-edit-table .sheet-select { width: 58px; }

.jobs-edit-table .status {
  min-width: 0;
  padding: 3px 4px;
  font-size: 9px;
  line-height: 1.05;
  white-space: normal;
  text-align: center;
}

.jobs-edit-table td:nth-child(1),
.jobs-edit-table th:nth-child(1),
.jobs-edit-table td:nth-child(2),
.jobs-edit-table th:nth-child(2) {
  width: 24px;
}

.jobs-edit-table td:nth-child(3),
.jobs-edit-table th:nth-child(3) {
  width: 50px;
}

.jobs-edit-table td:nth-child(4),
.jobs-edit-table th:nth-child(4),
.jobs-edit-table td:nth-child(7),
.jobs-edit-table th:nth-child(7),
.jobs-edit-table td:nth-child(9),
.jobs-edit-table th:nth-child(9),
.jobs-edit-table td:nth-child(12),
.jobs-edit-table th:nth-child(12),
.jobs-edit-table td:nth-child(13),
.jobs-edit-table th:nth-child(13),
.jobs-edit-table td:nth-child(16),
.jobs-edit-table th:nth-child(16),
.jobs-edit-table td:nth-child(17),
.jobs-edit-table th:nth-child(17) {
  width: 56px;
}

.jobs-edit-table td:nth-child(5),
.jobs-edit-table th:nth-child(5),
.jobs-edit-table td:nth-child(8),
.jobs-edit-table th:nth-child(8),
.jobs-edit-table td:nth-child(14),
.jobs-edit-table th:nth-child(14),
.jobs-edit-table td:nth-child(15),
.jobs-edit-table th:nth-child(15) {
  width: 72px;
}

.jobs-edit-table td:nth-child(6),
.jobs-edit-table th:nth-child(6),
.jobs-edit-table td:nth-child(10),
.jobs-edit-table th:nth-child(10),
.jobs-edit-table td:nth-child(11),
.jobs-edit-table th:nth-child(11),
.jobs-edit-table td:nth-child(18),
.jobs-edit-table th:nth-child(18),
.jobs-edit-table td:nth-child(19),
.jobs-edit-table th:nth-child(19),
.jobs-edit-table td:nth-child(20),
.jobs-edit-table th:nth-child(20) {
  width: auto;
}

.jobs-edit-table .icon-delete-line {
  width: 22px;
  height: 22px;
  min-height: 22px;
  font-size: 14px;
}

.sheet-select {
  min-width: 94px;
  min-height: 30px;
  height: 30px;
  border-radius: 6px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 900;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.4fr) minmax(220px, .8fr);
  gap: 12px;
  margin-bottom: 14px;
}

.workflow-tables {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.bucket-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bucket-tab {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 7px 14px;
}

.bucket-tab.active {
  background: var(--accent);
  color: #fff;
}

.workflow-search-results:empty {
  display: none;
}

.workflow-search-results {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.workflow-search-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.workflow-search-head strong {
  font-size: 13px;
}

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

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

.workflow-search-card {
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.workflow-search-card strong,
.workflow-search-card span,
.workflow-search-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-search-card strong {
  font-size: 12px;
}

.workflow-search-card span,
.workflow-search-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.workflow-actions {
  margin-top: 12px;
}

.workflow-action-panel {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.workflow-action-panel.active {
  display: flex;
}

.workflow-bucket {
  display: none;
}

.workflow-bucket.active {
  display: block;
}

.workflow-table-panel {
  overflow: hidden;
}

.workflow-table-panel .data-table {
  margin-top: 12px;
}

.workflow-stat.compact {
  min-width: 110px;
  text-align: right;
}

.release-page-list.compact {
  min-width: 220px;
  margin-top: 0;
}

.workflow-card {
  display: grid;
  align-content: start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.workflow-card h3 {
  margin-bottom: 4px;
}

.workflow-stat {
  display: grid;
  gap: 2px;
}

.workflow-stat strong {
  font-size: 34px;
  line-height: 1;
}

.workflow-stat span,
.workflow-stat small {
  color: var(--muted);
  font-weight: 800;
}

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

.release-page-chip {
  display: grid;
  gap: 8px;
  min-height: 54px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  border-radius: 8px;
}

.release-page-chip > button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.release-page-chip span {
  color: var(--muted);
  font-size: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  z-index: 1;
  color: #cbd3dc;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

td {
  font-size: 14px;
}

td input[type="checkbox"][data-job-select] {
  display: block;
  margin: 0 auto;
}

tr.group-row td {
  background: var(--panel-2);
  color: var(--white);
  font-weight: 900;
  border-top: 7px solid var(--panel);
  border-bottom: 1px solid #46515f;
  padding: 6px 8px;
}

tr.group-footer-row td {
  background: rgba(255, 255, 255, .025);
  border-bottom: 7px solid var(--panel);
  padding: 5px 8px 8px;
}

.job-notes-edit {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.job-notes-edit span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: none;
}

.job-notes-edit .notes-edit {
  width: 100%;
  min-width: 0;
  max-width: none;
}

[data-theme="light"] tr.group-row td {
  color: var(--text);
}

#jobs .data-table tr.needs-release-fix td {
  background: rgba(215, 25, 32, .12);
  border-top-color: rgba(255, 138, 144, .45);
  border-bottom-color: rgba(255, 138, 144, .45);
}

#jobs .data-table tr.needs-release-fix td:first-child {
  border-left: 4px solid #ff5f66;
}

#jobs .data-table td.needs-fix-cell {
  background: rgba(242, 169, 59, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 111, .55);
}

#jobs .data-table td.needs-fix-cell .table-edit {
  border-color: #ffc46f;
  background: #151006;
}

.job-group-divider {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.job-group-divider[draggable="true"] {
  cursor: grab;
}

.job-group-divider.sheet-dragging {
  opacity: .62;
}

.job-group-divider.sheet-drag-over {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 6px;
}

.job-drag-handle {
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: grab;
  font-size: 10px;
}

.job-drag-handle:active {
  cursor: grabbing;
}

.job-group-divider .job-group-title {
  font-size: 12px;
  min-width: max-content;
}

.job-group-divider span {
  color: #cbd3dc;
  font-size: 11px;
  font-weight: 900;
}

.job-group-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.order-move-actions {
  display: inline-flex;
  gap: 4px;
}

.job-group-actions select {
  min-height: 28px;
  height: 28px;
  min-width: 112px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 900;
}

.job-group-actions .mini-btn {
  white-space: nowrap;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10.5px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.archive-sheet-summary {
  margin: 0 0 12px;
}

.archive-empty,
.archive-loaded-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.archive-empty {
  color: var(--muted);
  font-weight: 800;
}

.archive-loaded-bar strong,
.archive-loaded-bar span {
  display: block;
}

.archive-loaded-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.icon-delete-line {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: #7d1f24;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.draft { background: rgba(242,169,59,.18); color: #ffc46f; }
.status.released { background: rgba(32,178,107,.16); color: #74e2ac; }
.status.partial { background: rgba(242,169,59,.16); color: #ffc46f; }
.status.hold { background: rgba(215,25,32,.18); color: #ff8a90; }
.status.complete { background: rgba(90,167,255,.18); color: #9dccff; }
.status.archived { background: rgba(154,166,178,.18); color: #cbd3dc; }
.status.ready { background: rgba(32,178,107,.16); color: #74e2ac; }
.status.warning { background: rgba(242,169,59,.16); color: #ffc46f; }
.status.not-required { background: rgba(154,166,178,.12); color: #9aa6b2; }

[data-theme="light"] .status.draft,
[data-theme="light"] .status.warning,
[data-theme="light"] .status.partial {
  background: #f7dfbd;
  color: #7a3f00;
}

[data-theme="light"] .status.released,
[data-theme="light"] .status.ready {
  background: #cfeeda;
  color: #075a2c;
}

[data-theme="light"] .status.hold {
  background: #f4c9cb;
  color: #7d1015;
}

[data-theme="light"] .status.archived,
[data-theme="light"] .status.not-required {
  background: #dfe5eb;
  color: #26313d;
}

.mini-btn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.mini-btn.danger {
  background: #7d1f24;
}

.queue-list, .hold-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.queue-item, .hold-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-item strong, .hold-item strong {
  font-size: 20px;
}

.label-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.label-batch-panel {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.4fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.label-batch-panel h3 {
  margin-bottom: 4px;
}

.label-batch-panel p {
  color: var(--muted);
  margin: 0;
}

.label-batch-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.label-batch-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.label-batch-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

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

.label-grid .panel {
  display: grid;
  gap: 12px;
}

.label-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.label-preview-tab {
  background: var(--secondary);
  color: var(--text);
}

.label-preview-tab.active {
  background: var(--red);
}

.label-preview-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
  max-width: 100%;
  overflow: hidden;
  padding-bottom: 8px;
}

.label-preview-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.label-preview-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.label-card {
  --label-scale: 1.42;
  width: calc(var(--label-width) * var(--label-scale));
  height: calc(var(--label-height) * var(--label-scale));
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  background: white;
  color: black;
  border: 1px solid #d3d7dd;
  box-shadow: 0 16px 36px rgba(0,0,0,.32);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  justify-self: center;
  break-after: page;
  page-break-after: always;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.label-card *,
.label-card *::before,
.label-card *::after {
  box-sizing: border-box;
}

.label-card.large {
  --label-width: 62mm;
  --label-height: 100mm;
  padding: calc(4mm * var(--label-scale));
}

.label-card.large.finished {
  padding: calc(3.2mm * var(--label-scale));
}

.label-card.large.skin {
  padding: calc(2.5mm * var(--label-scale));
}

.label-card.channel {
  --label-width: 62mm;
  --label-height: 100mm;
  padding: calc(4mm * var(--label-scale));
}

.label-card.cut {
  --label-width: 87mm;
  --label-height: 17mm;
  padding: calc(1.5mm * var(--label-scale));
}

.label-card.cut-sheet {
  --label-width: 62mm;
  --label-height: 100mm;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
}

.label-date {
  display: grid;
  place-items: center;
  background: black;
  color: white;
  font-weight: 950;
  line-height: .92;
  text-align: center;
  border-radius: 2px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.large .label-date {
  position: absolute;
  left: calc(4mm * var(--label-scale));
  top: calc(4mm * var(--label-scale));
  width: calc(20mm * var(--label-scale));
  height: calc(24mm * var(--label-scale));
  font-size: calc(8mm * var(--label-scale));
}

.large {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr auto;
  gap: calc(1.8mm * var(--label-scale));
  text-align: center;
}

.skin {
  grid-template-rows:
    calc(29mm * var(--label-scale))
    calc(25mm * var(--label-scale))
    1fr;
  gap: calc(1.35mm * var(--label-scale));
}

.skin-identity-block,
.skin-detail-block {
  display: grid;
  min-height: 0;
  gap: calc(.9mm * var(--label-scale));
}

.skin-detail-block {
  align-self: start;
  gap: 0;
  grid-template-rows: calc(15mm * var(--label-scale)) calc(12.5mm * var(--label-scale));
  border: 2px solid #000;
  border-radius: 2px;
  overflow: hidden;
}

.skin-identity-block {
  grid-template-rows: calc(9mm * var(--label-scale)) 1fr;
}

.large .label-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(12mm * var(--label-scale));
}

.large .label-logo {
  display: block;
  max-width: calc(30mm * var(--label-scale));
  max-height: calc(14mm * var(--label-scale));
  object-fit: contain;
  filter: grayscale(1) contrast(1.15);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.skin .skin-mark {
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  border-radius: 2px;
  font-size: calc(5.6mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  padding: calc(.3mm * var(--label-scale));
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.skin-customer-block {
  display: grid;
  grid-template-rows: 1fr calc(7mm * var(--label-scale));
  min-height: 0;
  overflow: hidden;
  border: 2px solid #000;
  border-radius: 2px;
  text-align: center;
}

.skin-customer-block > strong {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: calc(.45mm * var(--label-scale));
  font-size: calc(3.65mm * var(--label-scale));
  font-weight: 950;
  line-height: .9;
  overflow-wrap: anywhere;
}

.skin-meta-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 0;
  border-top: 1px solid #000;
}

.skin-meta-grid b {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: calc(.25mm * var(--label-scale));
  background: #eee;
  border-right: 1px solid #000;
  font-size: calc(3.2mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.skin-meta-grid b:last-child {
  border-right: 0;
}

.skin .label-size {
  border: 2px solid #000;
  padding: calc(1.5mm * var(--label-scale));
}

.skin .skin-cut-size {
  display: grid;
  grid-template-rows: calc(4.2mm * var(--label-scale)) 1fr;
  border: 2px solid #000;
  border-radius: 2px;
  min-height: 0;
  padding: 0;
  text-align: center;
  overflow: hidden;
}

.skin .skin-cut-title {
  display: grid;
  place-items: center;
  border-bottom: 1px solid #000;
  font-size: calc(2.2mm * var(--label-scale));
  font-weight: 950;
  line-height: .9;
  background: #eee;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.skin .skin-cut-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}

.skin .skin-cut-values div {
  display: grid;
  grid-template-rows: calc(4.2mm * var(--label-scale)) 1fr;
  align-items: stretch;
  min-width: 0;
}

.skin .skin-cut-values div:first-child {
  border-right: 1px solid #000;
}

.skin .skin-cut-values span,
.skin .skin-cut-values strong {
  display: grid;
  place-items: center;
  text-align: center;
  min-width: 0;
}

.skin .skin-cut-values span {
  border-bottom: 1px solid #000;
  background: #eee;
  font-size: calc(1.9mm * var(--label-scale));
  font-weight: 950;
  line-height: .9;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.skin .skin-cut-values strong {
  font-size: calc(7.2mm * var(--label-scale));
  font-weight: 950;
  line-height: .88;
  white-space: nowrap;
}

.skin-product-row {
  display: grid;
  grid-template-rows: 1fr 1fr;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.skin-product-row strong,
.skin-product-row span {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: calc(.55mm * var(--label-scale));
  text-align: center;
  line-height: .95;
}

.skin-product-row strong {
  background: #000;
  color: #fff;
  font-size: calc(3.15mm * var(--label-scale));
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.skin-product-row span {
  font-size: calc(3.05mm * var(--label-scale));
  font-weight: 950;
}

.skin .label-spec-grid {
  align-self: stretch;
  font-size: calc(2.1mm * var(--label-scale));
  min-height: 0;
  border: 0;
  border-top: 1px solid #000;
}

.skin .label-spec-grid span,
.skin .label-spec-grid strong {
  min-height: 0;
  padding: calc(.25mm * var(--label-scale));
  line-height: .9;
}

.skin .label-spec-grid strong {
  overflow-wrap: anywhere;
  font-size: inherit;
  font-weight: 950;
}

.large .label-job-number {
  display: grid;
  place-items: center;
  text-align: center;
  background: #000;
  color: #fff;
  border-radius: 2px;
  font-size: calc(8mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  padding: calc(1.5mm * var(--label-scale));
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.large .label-main {
  margin-left: calc(25mm * var(--label-scale));
  display: grid;
  gap: calc(2.2mm * var(--label-scale));
}

.large .label-customer {
  font-size: calc(7mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
}

.large .label-size {
  display: grid;
  place-items: center;
  text-align: center;
  font-size: calc(6.3mm * var(--label-scale));
  font-weight: 900;
}

.large .label-type,
.large .label-fabric {
  display: grid;
  place-items: center;
  text-align: center;
  font-size: calc(4.2mm * var(--label-scale));
  font-weight: 850;
}

.large .label-spec-grid {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #000;
  font-size: calc(3.1mm * var(--label-scale));
  font-weight: 900;
}

.large .label-spec-grid span,
.large .label-spec-grid strong {
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid #000;
  padding: calc(.7mm * var(--label-scale));
}

.large .label-spec-grid span {
  background: #eee;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.large.skin .label-spec-grid {
  align-self: stretch;
  border: 0;
  border-top: 1px solid #000;
  font-size: calc(3.05mm * var(--label-scale));
}

.large.skin .label-spec-grid span,
.large.skin .label-spec-grid strong {
  padding: calc(.35mm * var(--label-scale));
  line-height: .92;
}

.large .label-count {
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px solid #000;
  font-size: calc(6.5mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  padding: calc(1.4mm * var(--label-scale));
}

.large.finished {
  grid-template-rows:
    calc(10mm * var(--label-scale))
    calc(21mm * var(--label-scale))
    calc(13mm * var(--label-scale))
    calc(17mm * var(--label-scale))
    1fr;
  gap: calc(1.2mm * var(--label-scale));
}

.finished .label-brand {
  min-height: 0;
}

.finished .label-logo {
  max-width: calc(24mm * var(--label-scale));
  max-height: calc(9mm * var(--label-scale));
}

.finished .label-job-number {
  font-size: calc(5.2mm * var(--label-scale));
  padding: calc(.55mm * var(--label-scale));
}

.finished .label-customer {
  display: grid;
  place-items: center;
  min-height: 0;
  font-size: calc(4.7mm * var(--label-scale));
  line-height: .9;
  overflow-wrap: anywhere;
}

.finished-customer-block {
  display: grid;
  grid-template-rows: 1fr calc(7.5mm * var(--label-scale));
  min-height: 0;
  overflow: hidden;
  border: 2px solid #000;
  border-radius: 2px;
  text-align: center;
}

.finished-customer-block > strong {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: calc(.55mm * var(--label-scale));
  background: #000;
  color: #fff;
  font-size: calc(4.7mm * var(--label-scale));
  font-weight: 950;
  line-height: .9;
  overflow-wrap: anywhere;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.finished-meta-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr 1.35fr;
  min-height: 0;
  border-top: 1px solid #000;
}

.finished-meta-grid b {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: calc(.35mm * var(--label-scale));
  border-right: 1px solid #000;
  text-align: center;
  line-height: 1;
  background: #eee;
  font-size: calc(2.7mm * var(--label-scale));
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.finished-meta-grid b:last-child {
  border-right: 0;
  font-size: calc(2.55mm * var(--label-scale));
}

.finished-size-block,
.finished-product-block {
  display: grid;
  min-height: 0;
  overflow: hidden;
  text-align: center;
  border: 2px solid #000;
  border-radius: 2px;
}

.finished-size-block {
  grid-template-rows: calc(4mm * var(--label-scale)) 1fr;
}

.finished-size-block span {
  display: grid;
  place-items: center;
  background: #eee;
  border-bottom: 1px solid #000;
  font-size: calc(2mm * var(--label-scale));
  font-weight: 950;
  line-height: .9;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.finished-size-block strong {
  display: grid;
  place-items: center;
  font-size: calc(5.1mm * var(--label-scale));
  font-weight: 950;
  line-height: .95;
}

.finished-product-block {
  grid-template-rows: 1fr 1fr;
}

.finished-product-block strong,
.finished-product-block span {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: calc(.45mm * var(--label-scale));
  line-height: .9;
  overflow-wrap: anywhere;
}

.finished-product-block strong {
  background: #000;
  color: #fff;
  font-size: calc(3.15mm * var(--label-scale));
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.finished-product-block span {
  font-size: calc(3mm * var(--label-scale));
  font-weight: 950;
}

.finished .label-spec-grid {
  align-self: stretch;
  font-size: calc(2.25mm * var(--label-scale));
}

.finished .label-spec-grid span,
.finished .label-spec-grid strong {
  padding: calc(.3mm * var(--label-scale));
  line-height: .9;
}

.finished .label-count {
  font-size: calc(5.4mm * var(--label-scale));
  padding: calc(.4mm * var(--label-scale));
}

.large .label-bottom {
  position: absolute;
  left: calc(4mm * var(--label-scale));
  right: calc(4mm * var(--label-scale));
  bottom: calc(4mm * var(--label-scale));
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: calc(4.2mm * var(--label-scale));
  font-weight: 900;
}

.cut {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: calc(3mm * var(--label-scale));
  align-items: center;
}

.channel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: calc(2.8mm * var(--label-scale));
  text-align: center;
  align-items: stretch;
}

.channel .channel-order {
  background: #000;
  color: #fff;
  border-radius: 2px;
  padding: calc(1.6mm * var(--label-scale));
  font-size: calc(8mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.channel .label-customer {
  font-size: calc(7mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.channel .channel-grid {
  display: grid;
  grid-template-columns: calc(22mm * var(--label-scale)) 1fr;
  border: 1px solid #000;
  align-self: stretch;
}

.channel .channel-grid span,
.channel .channel-grid strong {
  display: grid;
  place-items: center;
  min-height: calc(12mm * var(--label-scale));
  padding: calc(1.2mm * var(--label-scale));
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  text-align: center;
  text-transform: uppercase;
}

.channel .channel-grid span:nth-last-child(-n + 2),
.channel .channel-grid strong:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.channel .channel-grid strong {
  border-right: 0;
  font-size: calc(4.8mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
}

.channel .channel-grid span {
  background: #f0f0f0;
  font-size: calc(2.3mm * var(--label-scale));
  font-weight: 950;
  line-height: 1.05;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cut .label-date {
  width: calc(14mm * var(--label-scale));
  height: calc(13mm * var(--label-scale));
  font-size: calc(3.6mm * var(--label-scale));
}

.cut .label-customer {
  font-size: calc(5.2mm * var(--label-scale));
  font-weight: 950;
  line-height: .95;
}

.cut-label-main {
  min-width: 0;
}

.cut .cut-label-name {
  font-size: calc(3.35mm * var(--label-scale));
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cut .label-size {
  font-size: calc(3.3mm * var(--label-scale));
  font-weight: 900;
}

.cut .label-part {
  font-size: calc(3.7mm * var(--label-scale));
  font-weight: 950;
  text-align: right;
}

.cut-sheet-slot {
  min-height: 0;
  position: relative;
}

.cut-sheet-slot:not(:last-child) {
  border-bottom: 0;
}

.cut-sheet-slot:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom: 2px dotted rgba(0, 0, 0, .78);
  z-index: 3;
  pointer-events: none;
}

.cut-sheet-slot.empty {
  min-height: calc(20mm * var(--label-scale));
}

.cut-sheet .label-card.cut-mini {
  --label-width: 62mm;
  --label-height: 20mm;
  width: calc(62mm * var(--label-scale));
  height: calc(20mm * var(--label-scale));
  padding: calc(1.15mm * var(--label-scale)) calc(1.7mm * var(--label-scale));
  border: 0;
  box-shadow: none;
  border-radius: 0;
  display: grid;
  grid-template-columns: calc(16mm * var(--label-scale)) 1fr;
  align-items: center;
  gap: calc(1.9mm * var(--label-scale));
  break-after: auto;
  page-break-after: auto;
}

.cut-sheet .cut-mini .label-date {
  width: calc(16mm * var(--label-scale));
  height: calc(17.7mm * var(--label-scale));
  font-size: calc(4.1mm * var(--label-scale));
  line-height: .86;
}

.cut-sheet .cut-mini .label-customer {
  font-size: calc(6.2mm * var(--label-scale));
  line-height: .88;
}

.cut-sheet .cut-mini .cut-label-name {
  font-size: calc(4.05mm * var(--label-scale));
  line-height: .95;
}

.cut-sheet .cut-mini .label-size {
  font-size: calc(4.05mm * var(--label-scale));
  line-height: .95;
}

.cut-sheet .cut-mini .label-part {
  display: none;
}

.optimisation-panel {
  margin-bottom: 14px;
}

.optimisation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.optimisation-totals {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  min-width: 180px;
  text-align: right;
}

.optimisation-totals strong {
  font-size: 20px;
}

.optimisation-totals span {
  color: var(--muted);
  font-weight: 800;
}

.optimisation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.optimisation-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.optimisation-card h4 {
  margin: 0 0 2px;
  font-size: 15px;
}

.bar-plan {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bar-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.bar-plan-head span {
  color: var(--muted);
  font-weight: 800;
}

.bar-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bar-pieces span {
  background: #0b0d10;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 800;
}

[data-theme="light"] .optimisation-card {
  background: #eef3f7;
  border-color: #aebac6;
}

[data-theme="light"] .bar-pieces span {
  background: #ffffff;
  border-color: #8fa0b0;
  color: #05080c;
}

[data-theme="light"] .bar-plan-head span,
[data-theme="light"] .optimisation-totals span {
  color: #2f3a46;
}

.oversize-warning {
  margin-top: 10px;
  color: #ffb0b4;
  font-weight: 900;
}

.settings-save-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(32, 178, 107, .14);
}

.settings-save-state.is-saving .settings-save-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(242, 169, 59, .14);
}

.settings-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.settings-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-tab {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 7px 16px;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--panel-2);
}

.settings-tab.active {
  background: var(--accent);
  color: #fff;
}

.settings-search {
  display: grid;
  gap: 5px;
  width: min(360px, 36vw);
}

.settings-search span,
.setting-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-search input {
  min-height: 38px;
}

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

.settings-search-summary {
  display: none;
  margin: -2px 0 12px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--panel-2);
  border-left: 3px solid var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.settings-search-summary.show {
  display: block;
}

.settings-panel {
  display: none;
  min-width: 0;
}

.settings-panel.active {
  display: block;
}

.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.settings-panel-head h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.settings-eyebrow {
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.settings-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.settings-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
}

.settings-group:last-child {
  border-radius: 0 0 8px 8px;
}

.settings-backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border-inline: 1px solid var(--line);
}

.cloud-version-history {
  gap: 14px;
  min-width: 0;
}

.cloud-current-version {
  display: grid;
  grid-template-columns: .55fr 1fr 1fr 2fr;
  border: 1px solid var(--line);
  border-left: 4px solid #198754;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.cloud-current-version > div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
}

.cloud-current-version > div:last-child {
  border-right: 0;
}

.cloud-current-version span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-current-version strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.cloud-version-number strong {
  color: #20a56b;
  font-size: 15px;
}

.cloud-version-table td:nth-child(1),
.cloud-version-table td:nth-child(2),
.cloud-version-table td:last-child {
  white-space: nowrap;
}

#settings .cloud-version-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.cloud-version-table table {
  width: 100%;
  table-layout: fixed;
}

.cloud-version-table th:nth-child(1) { width: 175px; }
.cloud-version-table th:nth-child(2) { width: 150px; }
.cloud-version-table th:last-child { width: 154px; }

.cloud-version-table td:nth-child(3) {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.cloud-version-table tr.is-current td {
  background: rgba(25, 135, 84, .08);
}

.cloud-current-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #198754;
  color: white;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-version-actions {
  display: flex;
  gap: 6px;
}

.cloud-version-actions .mini-btn {
  flex: 1 1 0;
  white-space: nowrap;
}

.cloud-history-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-history-label button {
  text-transform: none;
}

.settings-divider-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 -4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-divider-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.settings-backup-action {
  align-content: space-between;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-backup-action h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.settings-backup-action p {
  max-width: 560px;
}

.settings-backup-action button {
  justify-self: start;
  min-width: 180px;
}

.settings-backup-note {
  margin: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 3px solid var(--amber);
  border-radius: 0 0 8px 8px;
}

.cloud-device-safety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 3px solid var(--amber);
  border-radius: 0 0 8px 8px;
}

.cloud-device-safety > div {
  display: grid;
  gap: 3px;
}

.cloud-device-safety span {
  color: var(--muted);
  font-size: 11px;
}

.cloud-access-head {
  align-items: center;
}

.cloud-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.cloud-status-pill.is-cloud {
  border-color: #198754;
  background: rgba(25, 135, 84, .13);
  color: #53d58e;
}

[data-theme="light"] .cloud-status-pill.is-cloud {
  color: #12633f;
}

.cloud-status-pill.is-warning {
  border-color: var(--amber);
  background: rgba(255, 184, 0, .12);
  color: var(--amber);
}

.cloud-status-section {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-left: 4px solid var(--line);
}

.cloud-status-section.is-cloud { border-left-color: #198754; }
.cloud-status-section.is-warning { border-left-color: var(--amber); }

.cloud-status-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cloud-status-summary h4,
.cloud-status-summary p {
  margin: 0;
}

.cloud-status-summary p {
  margin-top: 4px;
}

.cloud-connection-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border: 3px solid rgba(154, 166, 178, .22);
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(154, 166, 178, .08);
}

.cloud-connection-dot.is-cloud {
  border-color: rgba(25, 135, 84, .22);
  background: #20b26b;
  box-shadow: 0 0 0 4px rgba(25, 135, 84, .1);
}

.cloud-connection-dot.is-warning {
  border-color: rgba(242, 169, 59, .22);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(242, 169, 59, .1);
}

.cloud-sync-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.cloud-sync-facts > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 14px;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
}

.cloud-sync-facts > div:last-child {
  border-right: 0;
}

.cloud-sync-facts strong {
  font-size: 13px;
}

.cloud-sync-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.cloud-login-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto;
  align-items: end;
  gap: 10px;
}

.cloud-owner-setup {
  border-left: 4px solid var(--red);
}

.cloud-owner-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(125px, .6fr) minmax(150px, .8fr) minmax(115px, .55fr) minmax(115px, .55fr) auto;
  align-items: end;
  gap: 10px;
}

.cloud-setup-identity {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cloud-current-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 300px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.cloud-current-user > div {
  display: grid;
  gap: 1px;
}

.cloud-current-user span,
.cloud-current-user small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.cloud-current-user strong {
  font-size: 14px;
}

.cloud-conflict-actions {
  display: grid;
  gap: 4px;
  min-width: 360px;
  padding: 12px;
  border: 1px solid var(--amber);
  border-radius: 7px;
  background: rgba(242, 169, 59, .08);
}

.cloud-conflict-actions > span {
  color: var(--muted);
  font-size: 11px;
}

.cloud-conflict-actions > div {
  display: flex;
  gap: 7px;
  margin-top: 6px;
}

.cloud-user-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(130px, .65fr) minmax(150px, .8fr) minmax(130px, .6fr) auto;
  align-items: end;
  gap: 10px;
}

.cloud-add-employee {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.cloud-add-employee > summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.cloud-add-employee > summary::-webkit-details-marker { display: none; }

.cloud-add-employee > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
}

.cloud-add-employee[open] > summary { border-bottom: 1px solid var(--line); }
.cloud-add-employee[open] > summary::before { content: "−"; }
.cloud-add-employee .cloud-user-form { padding: 14px; }

.cloud-new-user-access {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel-2);
}

.cloud-new-user-access[hidden] {
  display: none;
}

.cloud-access-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cloud-access-caption span {
  color: var(--muted);
  font-size: 11px;
}

.cloud-users-table input,
.cloud-users-table select {
  min-height: 34px;
  padding: 6px 8px;
}

.cloud-users-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.cloud-owner-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(25, 135, 84, .14);
  color: #53d58e;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

[data-theme="light"] .cloud-owner-badge { color: #12633f; }

.cloud-user-actions {
  display: flex;
  gap: 6px;
}

.cloud-user-access-row td {
  padding: 14px;
  background: var(--panel-2);
  border-top: 0;
}

.cloud-user-access-row p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.cloud-pin-reset {
  display: grid;
  grid-template-columns: 150px minmax(220px, 360px);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cloud-pin-reset span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-section-access-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

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

.cloud-access-group > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
}

.cloud-section-access-grid label {
  display: grid;
  gap: 5px;
}

.cloud-section-access-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.view.cloud-read-only:not(#dashboard)::before {
  content: "View only";
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.cloud-role-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.cloud-role-card h5,
.cloud-role-card p {
  margin: 0;
}

.cloud-role-card h5 {
  font-size: 14px;
}

.cloud-role-card p {
  font-size: 11px;
}

.cloud-role-card span {
  align-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-rollout-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.cloud-rollout-list li {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.cloud-rollout-list li:last-child {
  border-right: 0;
}

.cloud-rollout-list li > span {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}

.cloud-rollout-list strong {
  font-size: 12px;
}

.cloud-rollout-list p {
  margin: 3px 0 0;
  font-size: 10px;
}

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

.settings-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-group-head h4 {
  margin: 0 0 3px;
  font-size: 15px;
}

.settings-group-head p {
  max-width: 860px;
  font-size: 12px;
}

.settings-group-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button-link.mini-btn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.settings-add-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-add-card summary {
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}

.settings-add-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.settings-labelled-form {
  align-items: end;
  padding: 12px;
}

.setting-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.setting-field input,
.setting-field select {
  width: 100%;
  min-width: 0;
}

.setting-field-wide {
  min-width: 190px;
}

.stock-form,
.powder-form,
.optional-extra-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 10px;
}

.powder-form,
.optional-extra-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  padding: 0;
}

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

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

.deduction-form button {
  justify-self: start;
}

.component-extra-form,
.powder-item-form,
.fabric-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
}

.powder-item-form,
.fabric-form {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.component-extra-form button,
.powder-item-form button,
.fabric-form button {
  justify-self: start;
}

.settings-rule-note {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--panel-2);
  border-left: 3px solid var(--amber);
  font-size: 12px;
}

.settings-rule-note strong {
  flex: 0 0 auto;
  color: var(--text);
}

#settings .data-table {
  max-width: 100%;
  overflow: visible;
}

#settings .data-table table {
  width: 100%;
}

#settings .data-table th {
  white-space: normal;
  line-height: 1.05;
}

#settings .data-table input,
#settings .data-table select {
  width: 100%;
  min-width: 0;
}

.settings-rules-table {
  table-layout: fixed;
}

.settings-rules-table th:first-child {
  width: 19%;
}

.settings-rules-table th:last-child {
  width: 76px;
}

.settings-rules-table td:not(:first-child):not(:last-child) input {
  text-align: center;
}

.settings-stock-table,
.settings-fabric-table,
.settings-extra-table,
.settings-colour-table {
  table-layout: fixed;
}

.settings-stock-table th:last-child,
.settings-fabric-table th:last-child,
.settings-extra-table th:last-child,
.settings-colour-table th:last-child {
  width: 88px;
}

.settings-card-list,
.settings-product-cards {
  display: grid;
  gap: 10px;
}

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

.settings-rule-card,
.settings-product-card {
  min-width: 0;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-rule-card-head,
.settings-product-card-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.settings-rule-title-pair {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr);
  gap: 10px;
  flex: 1 1 auto;
}

.settings-rule-name {
  flex: 1 1 auto;
}

.settings-rule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.settings-rule-fields-four {
  grid-template-columns: repeat(4, minmax(115px, 1fr));
}

.settings-rule-split {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(520px, 1.6fr);
  gap: 10px;
  margin-top: 10px;
}

.settings-fieldset,
.settings-check-fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.settings-fieldset legend,
.settings-check-fieldset legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.settings-product-card {
  display: grid;
  gap: 10px;
}

.settings-product-card-title {
  align-items: baseline;
}

.settings-product-card-title strong {
  font-size: 14px;
}

.settings-product-card-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.settings-empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.stock-input,
.deduction-input,
.max-size-input,
.powder-item-input,
.component-extra-input,
.fabric-input,
.optional-extra-input {
  width: 100%;
}

.powder-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  padding: 5px 8px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
  text-transform: none;
  white-space: nowrap;
}

.powder-check:has(input:checked) {
  border-color: rgba(32, 178, 107, .7);
  background: rgba(32, 178, 107, .11);
}

.powder-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

#settings input:focus-visible,
#settings select:focus-visible,
#settings button:focus-visible,
#settings summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.powdercoat-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.powdercoat-summary .metric strong {
  font-size: clamp(24px, 2vw, 38px);
}

.powdercoat-summary .metric span {
  text-transform: uppercase;
}

.powdercoat-manual-panel {
  margin-bottom: 16px;
}

.powdercoat-history-panel {
  margin-top: 16px;
}

.powdercoat-manual-form {
  display: grid;
  grid-template-columns: 82px minmax(150px, 1fr) minmax(140px, .8fr) minmax(130px, .8fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.powdercoat-row-input {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.powdercoat-quantity-with-unit {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.powdercoat-quantity-with-unit strong {
  font-size: .78rem;
  white-space: nowrap;
}

.manual-powdercoat-qty-input {
  max-width: 82px;
}

.manual-field-error {
  border-color: #e01822 !important;
  box-shadow: 0 0 0 2px rgba(224, 24, 34, .22);
}

.powdercoat-sheet {
  color: #111;
  background: #fff;
  text-transform: none;
}

.powdercoat-letterhead {
  display: grid;
  grid-template-columns: 42mm 1fr;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.powdercoat-logo {
  width: 36mm;
  max-height: 16mm;
  object-fit: contain;
}

.powdercoat-contact {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: #111;
  font-size: 10px;
  text-align: right;
}

.powdercoat-contact strong {
  font-size: 14px;
}

.powdercoat-title {
  margin: 8px 0;
  color: #111;
  font-size: 20px;
  text-align: center;
  text-transform: uppercase;
}

.powdercoat-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 12px;
  color: #111;
  font-size: 12px;
  text-align: center;
}

.powdercoat-dates strong {
  border: 1px solid #111;
  padding: 6px;
}

.powdercoat-group {
  margin-bottom: 12px;
}

.powdercoat-group h4 {
  margin: 0;
  padding: 7px 8px 5px;
  background: transparent;
  color: #000;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

#powdercoat-print-sheet .compact-table th:nth-child(1),
#powdercoat-print-sheet .compact-table td:nth-child(1) { width: 12%; }
#powdercoat-print-sheet .compact-table th:nth-child(2),
#powdercoat-print-sheet .compact-table td:nth-child(2) { width: 28%; }
#powdercoat-print-sheet .compact-table th:nth-child(3),
#powdercoat-print-sheet .compact-table td:nth-child(3) { width: 22%; }
#powdercoat-print-sheet .compact-table th:nth-child(4),
#powdercoat-print-sheet .compact-table td:nth-child(4) { width: 38%; }

.stock-length-input,
.deduction-number-input,
.max-size-number-input {
  max-width: 180px;
}

.print-sheet {
  display: block;
  background: white;
  color: black;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  margin: 0 0 14px;
  padding: 10px;
  max-width: 210mm;
  box-shadow: 0 18px 45px rgba(0,0,0,.24);
  text-transform: uppercase;
}

#powdercoat-print-sheet {
  text-transform: none;
}

.landscape-sheet {
  max-width: 297mm;
}

.sheet-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #111;
  margin-bottom: 5px;
  padding-bottom: 3px;
}

.sheet-header h3 {
  color: black;
  font-size: 18px;
  font-style: italic;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.sheet-header span,
.sheet-subhead {
  color: #222;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-logo-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-bottom: 2px solid #111;
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.sheet-logo-header h3 {
  justify-self: center;
  font-size: 19px;
  text-align: center;
  white-space: nowrap;
}

.sheet-logo-header span {
  justify-self: end;
}

.sheet-logo {
  justify-self: start;
  width: 32mm;
  max-height: 11mm;
  object-fit: contain;
  opacity: .82;
  filter: grayscale(1) contrast(1.08);
}

.print-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.print-group {
  border: 1px solid #111;
  margin-bottom: 6px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #000;
  color: #fff;
  padding: 3px 5px;
  font-size: 8px;
  font-style: italic;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.print-group-title span {
  font-size: 7px;
  white-space: nowrap;
}

.print-section-label {
  background: #000;
  color: #fff;
  font-size: 9px;
  font-style: italic;
  font-weight: 950;
  margin: 6px 0 4px;
  padding: 3px 5px;
  text-align: center;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cutlist-reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cut-section-head {
  background: #000;
  color: #fff;
  font-size: 9px;
  font-style: italic;
  font-weight: 950;
  margin-bottom: 5px;
  padding: 6px 5px;
  text-align: center;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cut-print-group {
  margin-bottom: 7px;
}

.cutlist-reference-table {
  table-layout: fixed;
}

.cutlist-reference-table th:nth-child(1),
.cutlist-reference-table td:nth-child(1) { width: 12%; }
.cutlist-reference-table th:nth-child(2),
.cutlist-reference-table td:nth-child(2) { width: 18%; }
.cutlist-reference-table th:nth-child(3),
.cutlist-reference-table td:nth-child(3) { width: 46%; }
.cutlist-reference-table th:nth-child(4),
.cutlist-reference-table td:nth-child(4) { width: 15%; }
.cutlist-reference-table th:nth-child(5),
.cutlist-reference-table td:nth-child(5) { width: 9%; }

.cutlist-reference-table.custom-powder-cut-table th:nth-child(1),
.cutlist-reference-table.custom-powder-cut-table td:nth-child(1) { width: 22%; }
.cutlist-reference-table.custom-powder-cut-table th:nth-child(2),
.cutlist-reference-table.custom-powder-cut-table td:nth-child(2) { width: 58%; }
.cutlist-reference-table.custom-powder-cut-table th:nth-child(3),
.cutlist-reference-table.custom-powder-cut-table td:nth-child(3) { width: 20%; }

.cutlist-reference-table .bar-number {
  font-size: 9px;
  font-weight: 950;
}

.compact-table {
  min-width: 0;
  width: 100%;
  border-collapse: collapse;
}

.compact-table th,
.compact-table td {
  border: 1px solid #111;
  color: #000;
  padding: 2px 3px;
  text-align: center;
  font-size: 8px;
  font-weight: 850;
  height: 14px;
  line-height: 1.05;
  overflow: hidden;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.compact-table th {
  position: static;
  background: #f4f4f4;
  letter-spacing: 0;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-sheet-table {
  table-layout: fixed;
}

.job-order-col { width: 4.5%; }
.job-customer-col { width: 13.5%; }
.job-due-col { width: 5%; }
.job-order-type-col { width: 6%; }
.job-blind-col { width: 4%; }
.job-blind-type-col { width: 10%; }
.job-fabric-col { width: 10%; }
.job-width-col { width: 5.5%; }
.job-drop-col { width: 5.5%; }
.job-channel-col { width: 6%; }
.job-control-side-col { width: 5%; }
.job-tube-col { width: 5%; }
.job-bottom-bar-col { width: 8.5%; }
.job-control-col { width: 6%; }
.job-extras-col { width: 8%; }
.job-tick-col { width: 2.5%; }

.job-sheet-table td,
.job-sheet-table th {
  word-break: break-word;
}

.job-sheet-table .order-cell {
  font-weight: 950;
  white-space: nowrap;
}

.tick-heading-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 10px;
  line-height: 1;
}

.job-sheet-table th,
.job-sheet-table td {
  height: 14px;
  text-align: center;
}

.job-sheet-table .job-blind-type-cell,
.job-sheet-table .job-control-cell.job-highlight-motor,
.job-sheet-table .job-control-cell.job-highlight-battery {
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-sheet-table .job-highlight-motor {
  background: #ffe100;
}

.job-sheet-table .job-highlight-battery {
  background: #ff9fcb;
}

.job-sheet-table .job-highlight-zip-spring {
  background: #f4a33b;
}

.job-sheet-table .job-highlight-valance,
.data-table .job-highlight-valance,
.compact-table .job-highlight-valance,
td.job-highlight-valance {
  background: #ffe100;
  color: #050505;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-sheet-table .job-highlight-strap,
.data-table .job-highlight-strap,
.compact-table .job-highlight-strap,
td.job-highlight-strap,
.mobile-job-field.job-highlight-strap {
  background: #ffe100;
  color: #050505;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

td.job-highlight-strap .table-edit,
.mobile-job-field.job-highlight-strap .table-edit {
  background: #ffe100;
  border-color: #050505;
  color: #050505;
  font-weight: 950;
}

td.job-highlight-valance .table-edit,
td.job-highlight-valance .skin-list-input,
td.job-highlight-valance .cutlist-input,
td.job-highlight-valance .channel-list-input {
  background: #ffe100;
  border-color: #050505;
  color: #050505;
  font-weight: 950;
}

.job-sheet-table .job-highlight-custom-fabric,
.data-table .job-highlight-custom-fabric,
.compact-table .job-highlight-custom-fabric,
td.job-highlight-custom-fabric {
  background: #5aa7ff;
  color: #050505;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

td.job-highlight-custom-fabric .table-edit,
td.job-highlight-custom-fabric .skin-list-input {
  background: #5aa7ff;
  border-color: #050505;
  color: #050505;
  font-weight: 950;
}

.job-sheet-table .job-highlight-custom-powder,
.data-table .job-highlight-custom-powder,
.compact-table .job-highlight-custom-powder,
td.job-highlight-custom-powder,
.mobile-job-field.job-highlight-custom-powder {
  background: #5aa7ff;
  color: #050505;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

td.job-highlight-custom-powder .table-edit,
td.job-highlight-custom-powder .channel-list-input,
.mobile-job-field.job-highlight-custom-powder .table-edit {
  background: #5aa7ff;
  border-color: #050505;
  color: #050505;
  font-weight: 950;
}

.job-sheet-table .job-highlight-asap,
.data-table .job-highlight-asap,
.compact-table .job-highlight-asap,
td.job-highlight-asap {
  background: #d71920;
  color: #ffffff;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

td.job-highlight-asap .table-edit {
  background: #d71920;
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 950;
}

.data-table td.skin-roll-join {
  background: #d97706;
  color: #fff;
  font-weight: 900;
}

[data-theme="light"] .data-table td.skin-roll-join {
  background: #b45309;
  color: #fff;
}

.job-sheet-table .job-order-type-delivery {
  background: #6fd36f;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-sheet-table .job-order-type-pickup {
  background: #ffe100;
  font-weight: 950;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-note-row td {
  background: #ffe100;
  font-size: 7.6px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center !important;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-custom-order-notes {
  background: #ffe100;
  color: #050505;
  font-size: 7.6px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center !important;
  text-transform: uppercase;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-extra-row td {
  background: #fff;
  font-size: 7.4px;
  font-weight: 950;
  height: 14px;
  line-height: 1.05;
  text-align: center !important;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-inline-extra {
  font-size: 7px;
  font-weight: 950;
  line-height: 1.05;
  text-align: center !important;
  vertical-align: middle !important;
}

.job-merged-extra {
  padding: 3px 4px !important;
  line-height: 1.2;
  vertical-align: middle !important;
}

.job-spacer-row td {
  height: 6px;
  padding: 0;
  background: #fff;
  border: 0;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.job-sheet-full .job-sheet-table th,
.job-sheet-full .job-sheet-table td {
  height: 17px;
  padding: 2.5px 3px;
  font-size: 8.8px;
}

.job-sheet-full .job-note-row td,
.job-sheet-full .job-extra-row td {
  font-size: 8px;
}

.job-sheet-roomy .job-sheet-table th,
.job-sheet-roomy .job-sheet-table td {
  height: 20px;
  padding: 3px 3.5px;
  font-size: 9.6px;
}

.job-sheet-roomy .job-spacer-row td {
  height: 9px;
}

.channel-list-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.cutlist-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.skin-list-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

#cutlist-table {
  margin-bottom: 18px;
}

#cut-optimisation {
  margin-top: 18px;
}

.hardware-edit-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.hardware-edit-stack .table-edit {
  width: 100%;
  min-width: 0;
}

.hardware-config-edit {
  font-size: 10px;
}

.hardware-operation-note {
  display: block;
  padding: 3px 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

#cutlist-print-sheet .compact-table {
  table-layout: fixed;
}

#cutlist-print-sheet .compact-table th,
#cutlist-print-sheet .compact-table td {
  font-size: 8px;
  height: 15px;
  padding: 1.6px 2.4px;
  text-align: center;
  word-break: break-word;
}

#cutlist-print-sheet .tick-cell::after {
  width: 9px;
  height: 9px;
}

#jobs .data-table th,
#jobs .data-table td,
#cutlist .data-table th,
#cutlist .data-table td,
#skins .data-table th,
#skins .data-table td,
#channels .data-table th,
#channels .data-table td,
#powdercoat .data-table th,
#powdercoat .data-table td {
  height: 38px;
  text-align: center;
  text-transform: none;
  vertical-align: middle;
}

.tick-cell::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid #111;
  vertical-align: middle;
}

body.print-cutlist-sheet #cutlist-print-sheet {
  width: 204mm;
  max-width: none;
  padding: 0;
}

body.print-cutlist-sheet #cutlist-print-sheet .sheet-header h3 {
  font-size: 20px;
}

body.print-cutlist-sheet #cutlist-print-sheet .sheet-header span,
body.print-cutlist-sheet #cutlist-print-sheet .sheet-subhead {
  font-size: 8.5px;
}

body.print-cutlist-sheet #cutlist-print-sheet .cutlist-reference-grid {
  gap: 7px;
}

body.print-cutlist-sheet #cutlist-print-sheet .cut-section-head {
  font-size: 10.5px;
  padding: 7px 5px;
}

body.print-cutlist-sheet #cutlist-print-sheet .print-group {
  margin-bottom: 7px;
}

body.print-cutlist-sheet #cutlist-print-sheet .print-group-title {
  font-size: 9px;
  padding: 4px 5px;
}

body.print-cutlist-sheet #cutlist-print-sheet .print-group-title span {
  font-size: 7.5px;
}

#cutlist-print-sheet .print-group-title.custom-powder-group-title {
  background: #5aa7ff;
  color: #050505;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

#cutlist-print-sheet .custom-powder-cut-group {
  border: 2px solid #111;
}

body.print-cutlist-sheet #cutlist-print-sheet .compact-table th,
body.print-cutlist-sheet #cutlist-print-sheet .compact-table td {
  font-size: 8.2px;
  height: 15.5px;
  padding: 1.8px 2.6px;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-balanced .compact-table th,
body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-balanced .compact-table td {
  height: 19px;
  padding: 2.2px 3px;
  font-size: 9.2px;
  line-height: 1.1;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-roomy .compact-table th,
body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-roomy .compact-table td {
  height: 23px;
  padding: 2.8px 3.4px;
  font-size: 10.3px;
  line-height: 1.12;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-balanced .print-group-title {
  padding: 4.5px 6px;
  font-size: 9.8px;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-roomy .print-group-title {
  padding: 5.5px 6px;
  font-size: 10.5px;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-balanced .print-group-title span,
body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-roomy .print-group-title span {
  font-size: 8px;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-balanced .bar-number {
  font-size: 11px;
}

body.print-cutlist-sheet #cutlist-print-sheet.cutlist-print-roomy .bar-number {
  font-size: 12px;
}

body.print-cutlist-sheet #cutlist-print-sheet .bar-number {
  font-size: 10px;
}

body.print-cutlist-sheet #cutlist-print-sheet .tick-cell::after {
  width: 9.5px;
  height: 9.5px;
}

body.print-cutlist-sheet #cutlist-print-sheet .sheet-footer {
  font-size: 7.8px;
  margin-top: 8px;
}

body.print-skins-sheet #skins-print-sheet {
  width: 204mm;
  max-width: none;
  padding: 0;
}

body.print-channels-sheet #channels-print-sheet {
  width: 204mm;
  max-width: none;
  padding: 0;
}

body.print-skins-sheet #skins-print-sheet .sheet-header h3,
body.print-channels-sheet #channels-print-sheet .sheet-header h3 {
  font-size: 20px;
}

body.print-skins-sheet #skins-print-sheet .sheet-header span,
body.print-skins-sheet #skins-print-sheet .sheet-subhead,
body.print-channels-sheet #channels-print-sheet .sheet-header span,
body.print-channels-sheet #channels-print-sheet .sheet-subhead {
  font-size: 8.5px;
}

#cutlist-print-sheet .sheet-logo-header,
#skins-print-sheet .sheet-logo-header,
#channels-print-sheet .sheet-logo-header,
#powdercoat-print-sheet .sheet-logo-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-bottom: 2px solid #111;
  margin-bottom: 5px;
  padding-bottom: 4px;
}

#cutlist-print-sheet .sheet-logo-header h3,
#skins-print-sheet .sheet-logo-header h3,
#channels-print-sheet .sheet-logo-header h3,
#powdercoat-print-sheet .sheet-logo-header h3 {
  justify-self: center;
  font-size: 18px;
  text-align: center;
  white-space: nowrap;
}

#cutlist-print-sheet .sheet-logo-header span,
#skins-print-sheet .sheet-logo-header span,
#channels-print-sheet .sheet-logo-header span,
#powdercoat-print-sheet .sheet-logo-header span {
  justify-self: end;
  font-size: 8px;
}

#cutlist-print-sheet .sheet-logo,
#skins-print-sheet .sheet-logo,
#channels-print-sheet .sheet-logo,
#powdercoat-print-sheet .sheet-logo {
  justify-self: start;
  width: 28mm;
  max-height: 10mm;
}

body.print-skins-sheet #skins-print-sheet .print-two-col {
  grid-template-columns: 1fr;
  gap: 0;
}

body.print-channels-sheet #channels-print-sheet.channels-print-one-col .print-two-col {
  grid-template-columns: 1fr;
  gap: 0;
}

body.print-channels-sheet #channels-print-sheet.channels-print-two-col .print-two-col {
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

body.print-skins-sheet #skins-print-sheet .print-group,
body.print-channels-sheet #channels-print-sheet .print-group {
  margin-bottom: 8px;
}

body.print-skins-sheet #skins-print-sheet .print-group-title,
body.print-channels-sheet #channels-print-sheet .print-group-title {
  font-size: 10px;
  padding: 5px 7px;
}

body.print-skins-sheet #skins-print-sheet .print-group-title span,
body.print-channels-sheet #channels-print-sheet .print-group-title span {
  font-size: 8.2px;
}

body.print-skins-sheet #skins-print-sheet .compact-table th,
body.print-skins-sheet #skins-print-sheet .compact-table td {
  font-size: 9px;
  height: 19px;
  padding: 2.5px 3.5px;
  line-height: 1.05;
}

body.print-channels-sheet #channels-print-sheet .compact-table th,
body.print-channels-sheet #channels-print-sheet .compact-table td {
  font-size: 9.4px;
  height: 21px;
  padding: 2.8px 4px;
  line-height: 1.05;
}

body.print-skins-sheet #skins-print-sheet.list-print-full .compact-table th,
body.print-skins-sheet #skins-print-sheet.list-print-full .compact-table td {
  font-size: 8.5px;
  height: 17.5px;
  padding: 2px 3px;
}

body.print-channels-sheet #channels-print-sheet.list-print-full .compact-table th,
body.print-channels-sheet #channels-print-sheet.list-print-full .compact-table td {
  font-size: 8.4px;
  height: 17px;
  padding: 2px 3px;
}

body.print-skins-sheet #skins-print-sheet.list-print-dense .compact-table th,
body.print-skins-sheet #skins-print-sheet.list-print-dense .compact-table td,
body.print-channels-sheet #channels-print-sheet.list-print-dense .compact-table th,
body.print-channels-sheet #channels-print-sheet.list-print-dense .compact-table td {
  font-size: 10.2px;
  height: 24px;
  padding: 3.2px 4.5px;
}

body.print-skins-sheet #skins-print-sheet .tick-cell::after,
body.print-channels-sheet #channels-print-sheet .tick-cell::after {
  width: 10.5px;
  height: 10.5px;
}

body.print-skins-sheet #skins-print-sheet .sheet-footer,
body.print-channels-sheet #channels-print-sheet .sheet-footer {
  font-size: 7.8px;
  margin-top: 8px;
}

#skins-print-sheet .compact-table,
#channels-print-sheet .compact-table {
  table-layout: fixed;
}

#skins-print-sheet .compact-table th,
#skins-print-sheet .compact-table td,
#channels-print-sheet .compact-table th,
#channels-print-sheet .compact-table td {
  font-size: 7.2px;
  height: 14px;
  padding: 1.3px 2px;
  text-align: center;
  word-break: break-word;
}

#skins-print-sheet .print-group-title,
#channels-print-sheet .print-group-title {
  font-size: 8px;
}

#skins-print-sheet .compact-table th:nth-child(1),
#skins-print-sheet .compact-table td:nth-child(1) { width: 8%; }
#skins-print-sheet .compact-table th:nth-child(2),
#skins-print-sheet .compact-table td:nth-child(2) { width: 20%; }
#skins-print-sheet .compact-table th:nth-child(3),
#skins-print-sheet .compact-table td:nth-child(3) { width: 15%; }
#skins-print-sheet .compact-table th:nth-child(4),
#skins-print-sheet .compact-table td:nth-child(4) { width: 14%; }
#skins-print-sheet .compact-table th:nth-child(5),
#skins-print-sheet .compact-table td:nth-child(5) { width: 9%; }
#skins-print-sheet .compact-table th:nth-child(6),
#skins-print-sheet .compact-table td:nth-child(6) { width: 9%; }
#skins-print-sheet .compact-table th:nth-child(7),
#skins-print-sheet .compact-table td:nth-child(7) { width: 7%; }
#skins-print-sheet .compact-table th:nth-child(8),
#skins-print-sheet .compact-table td:nth-child(8) { width: 14%; }
#skins-print-sheet .compact-table th:nth-child(9),
#skins-print-sheet .compact-table td:nth-child(9) { width: 4%; }

#channels-print-sheet .compact-table th:nth-child(1),
#channels-print-sheet .compact-table td:nth-child(1) { width: 11%; }
#channels-print-sheet .compact-table th:nth-child(2),
#channels-print-sheet .compact-table td:nth-child(2) { width: 20%; }
#channels-print-sheet .compact-table th:nth-child(3),
#channels-print-sheet .compact-table td:nth-child(3) { width: 10%; }
#channels-print-sheet .compact-table th:nth-child(4),
#channels-print-sheet .compact-table td:nth-child(4) { width: 18%; }
#channels-print-sheet .compact-table th:nth-child(5),
#channels-print-sheet .compact-table td:nth-child(5) { width: 22%; }
#channels-print-sheet .compact-table th:nth-child(6),
#channels-print-sheet .compact-table td:nth-child(6) { width: 12%; }
#channels-print-sheet .compact-table th:nth-child(7),
#channels-print-sheet .compact-table td:nth-child(7) { width: 7%; }

#skins-print-sheet .tick-cell::after,
#channels-print-sheet .tick-cell::after {
  width: 8px;
  height: 8px;
}

.sheet-footer {
  border-top: 1px solid #bbb;
  color: #222;
  font-size: 7px;
  font-weight: 900;
  margin-top: 7px;
  padding-top: 3px;
  text-align: center;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #ffffff;
  color: #111;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .18s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 981px) and (max-width: 1400px) {
  .app-header {
    grid-template-columns: 220px minmax(0, 1fr) 90px;
    gap: 8px;
    padding: 12px 14px;
  }

  .brand-logo {
    width: 118px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .tabs {
    gap: 2px;
  }

  .tab {
    padding: 8px 6px;
    font-size: 14px;
  }

  .shopify-order-fields {
    grid-template-columns: 100px minmax(180px, 1fr) 110px 125px 140px minmax(200px, 1.2fr);
  }

  .shopify-review-grid {
    grid-template-columns: 120px minmax(180px, 1.4fr) 85px 95px minmax(150px, 1fr) 120px;
  }
}

@media (max-width: 980px) {
  .app-header, .page-title { align-items: stretch; flex-direction: column; }
  .app-header { display: flex; }
  .brand { flex: 0 0 auto; min-width: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .label-grid, .label-batch-panel, .stock-form, .deduction-form, .max-size-form, .powder-form, .powder-item-form, .component-extra-form, .powdercoat-manual-form, .fabric-form, .optional-extra-form, .manual-job-form, .workflow-grid, .dashboard-grid, .dashboard-stage, .dashboard-stage-secondary, .dashboard-command-grid, .powdercoat-summary { grid-template-columns: 1fr; }
  .label-batch-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .label-batch-actions { justify-content: stretch; }
  .label-batch-actions button { flex: 1; }
  .manual-job-form .span-2, .manual-job-form .span-4 { grid-column: auto; }
  .optimisation-head { flex-direction: column; }
  .optimisation-totals { text-align: left; }
  input[type="search"] { min-width: 0; }
  .dashboard-powdercoat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-powdercoat-title, .dashboard-powdercoat-date, .dashboard-powdercoat-colours { grid-column: span 3; }
  .dashboard-powdercoat > div { min-height: 82px; }
  .dashboard-powdercoat-title strong { white-space: normal; }
  .dashboard-display-controls { justify-content: space-between; }
  .dashboard-clock { justify-items: start; }
  .settings-title-actions {
    align-self: flex-start;
    justify-content: flex-start;
  }
  .shopify-import-toolbar { grid-template-columns: 1fr 1fr; }
  .shopify-import-toolbar input { grid-column: 1 / -1; }
  .shopify-order-fields, .shopify-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shopify-order-fields .is-wide, .shopify-review-grid .is-wide { grid-column: span 2; }
}

@media (max-width: 720px) {
  .shopify-import-state {
    justify-items: start;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .app-header {
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    position: relative;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 156px;
    max-height: 58px;
    padding: 4px 6px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand p {
    display: none;
  }

  .tabs {
    margin: 0 -12px;
    padding: 0 12px 8px;
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .input-method-tabs {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .input-method-tab:last-child {
    grid-column: 1 / -1;
  }

  .shopify-order-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .shopify-order-secondary {
    grid-column: 2 / -1;
  }

  .shopify-preview-order-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .shopify-review-status {
    order: 3;
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .shopify-order-fields,
  .shopify-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopify-order-fields .is-wide,
  .shopify-review-grid .is-wide {
    grid-column: 1 / -1;
  }

  .shopify-review-blind-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shopify-review-blind-head span {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shopify-order-snapshot > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .shopify-snapshot-badges {
    margin-left: 0;
  }

  .shopify-snapshot-meta,
  .shopify-snapshot-item {
    grid-template-columns: 1fr;
  }

  .shopify-snapshot-qty {
    text-align: left;
  }

  .tab {
    min-width: 0;
    min-height: 42px;
    padding: 9px 6px;
    border-color: var(--line);
    background: var(--panel);
    font-size: 13px;
    white-space: normal;
  }

  .theme-toggle {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    min-width: 72px;
    min-height: 36px;
    padding: 7px 10px;
  }

  main {
    width: 100%;
    max-width: none;
    padding: 14px 10px 28px;
  }

  h2 {
    font-size: 22px;
  }

  .page-title {
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-title p {
    font-size: 13px;
  }

  .settings-title-actions {
    display: flex;
    width: max-content;
    max-width: 100%;
  }

  .settings-user-session { justify-content: space-between; }

  .dashboard-display-controls {
    align-items: stretch;
  }

  .dashboard-clock strong {
    font-size: 36px;
  }

  body.factory-display-mode main {
    padding: 14px 10px 24px;
  }

  body.factory-display-mode .dashboard-clock strong {
    font-size: 42px;
  }

  body.factory-display-mode .dashboard-clock span {
    font-size: 16px;
  }

  body.factory-display-mode .dashboard-display-logo {
    width: 112px;
    max-height: 48px;
  }

  body.factory-display-mode .dashboard-heading h2 {
    font-size: 24px;
  }

  .panel,
  .toolbar,
  .data-table,
  .workflow-search-results {
    border-radius: 8px;
  }

  .panel {
    padding: 12px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-table-panel,
  .release-page-list.compact,
  .print-sheet {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
  }

  .release-page-list.compact {
    margin-top: 0;
  }

  .field-inline input {
    margin-left: 0;
  }

  #job-print-sheet,
  #archive-print-sheet {
    overflow: hidden;
  }

  #job-print-sheet .job-sheet-print-header > span,
  #archive-print-sheet .job-sheet-print-header > span {
    display: none;
  }

  #job-print-sheet .compact-table,
  #archive-print-sheet .compact-table {
    table-layout: fixed;
    width: 100%;
  }

  #active-move-target[hidden],
  #move-selected-active[hidden] {
    display: none !important;
  }

  .toolbar,
  .action-row,
  .workflow-action-panel,
  .release-page-actions,
  .sheet-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .workflow-action-panel:not(.active) {
    display: none;
  }

  .workflow-action-panel.active {
    display: grid;
  }

  .action-row button,
  .toolbar button,
  .workflow-action-panel button,
  .workflow-action-panel select,
  .toolbar select,
  .toolbar input,
  .field-inline,
  .field-inline input,
  input,
  select,
  textarea {
    width: 100%;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  button {
    padding: 11px 13px;
  }

  textarea {
    min-height: 170px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .label-batch-options,
  .label-batch-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metric {
    padding: 12px;
  }

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

  .snapshot-row,
  .analytics-row,
  .queue-item,
  .hold-item,
  .archive-empty,
  .archive-loaded-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .manual-job-form {
    gap: 10px;
  }

  .manual-job-form label {
    font-size: 12px;
  }

  .manual-extra-check {
    min-height: 38px;
    padding: 8px 10px;
  }

  .manual-preview-job {
    overflow: hidden;
  }

  .manual-preview-job-bar,
  .manual-preview-sheet {
    min-width: 0;
    width: 100%;
  }

  .manual-preview-job-bar {
    flex-wrap: wrap;
  }

  .manual-preview-sheet {
    padding: 4px;
  }

  .manual-preview-sheet .compact-table {
    min-width: 0;
    table-layout: fixed;
  }

  .manual-preview-sheet .compact-table th,
  .manual-preview-sheet .compact-table td {
    height: auto;
    padding: 2px 1px;
    font-size: clamp(4.8px, 1.55vw, 7px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .bucket-tabs,
  .settings-tabs,
  .label-preview-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .bucket-tab,
  .settings-tab,
  .label-preview-tab {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
  }

  .workflow-table-panel {
    overflow: visible;
  }

  #jobs .data-table {
    background: transparent;
    border: 0;
    max-width: none;
    overflow: visible;
  }

  #jobs .data-table > table {
    display: none;
  }

  #jobs .mobile-job-cards {
    display: grid;
    gap: 14px;
  }

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

  .mobile-job-group-head {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }

  .mobile-job-group-head .job-group-divider {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .mobile-job-group-head .job-group-title {
    font-size: 15px;
    line-height: 1.2;
    min-width: 0;
  }

  .mobile-job-group-head .job-drag-handle {
    width: 100%;
    background: var(--secondary);
    color: var(--text);
  }

  .mobile-job-group-head .order-move-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mobile-job-group-head .job-group-actions {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .mobile-job-lines {
    display: grid;
    gap: 10px;
  }

  .mobile-job-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
  }

  .mobile-job-card.needs-release-fix {
    border-color: rgba(255, 95, 102, .8);
    box-shadow: inset 4px 0 0 #ff5f66, 0 8px 22px rgba(0,0,0,.16);
  }

  .mobile-job-card-top {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .mobile-select-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
  }

  .mobile-select-line input {
    width: 20px;
    height: 20px;
    min-height: 20px;
  }

  .mobile-card-sheet {
    min-width: 0;
  }

  .mobile-card-sheet .sheet-select {
    min-height: 34px;
    height: 34px;
    font-size: 12px;
  }

  .mobile-card-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-job-field {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .mobile-job-field.wide {
    grid-column: 1 / -1;
  }

  .mobile-job-field > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-job-field.job-highlight-asap {
    background: transparent;
    color: var(--text);
  }

  .mobile-job-field.job-highlight-asap .table-edit {
    background: #d71920;
    border-color: #ffb0b4;
    color: #fff;
    font-weight: 950;
  }

  .mobile-job-field .table-edit,
  .mobile-job-field .sheet-select {
    min-height: 42px;
    height: auto;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
    text-align-last: auto;
  }

  .mobile-job-field .size-edit,
  .mobile-job-field .blind-no-edit,
  .mobile-job-field .tube-edit,
  .mobile-job-field .side-edit,
  .mobile-job-field .order-edit,
  .mobile-job-field .due-edit {
    text-align: center;
    text-align-last: center;
  }

  .mobile-job-more {
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  .mobile-job-more summary {
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--secondary);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
  }

  .mobile-job-more summary::-webkit-details-marker {
    display: none;
  }

  .mobile-job-more summary::after {
    content: " +";
  }

  .mobile-job-more[open] summary {
    margin-bottom: 10px;
  }

  .mobile-job-more[open] summary::after {
    content: " -";
  }

  .mobile-job-notes {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
  }

  .mobile-job-notes .job-notes-edit {
    grid-template-columns: 1fr;
  }

  .data-table {
    max-width: calc(100vw - 20px);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
  }

  .jobs-edit-table {
    min-width: 0;
    table-layout: auto;
  }

  .data-table table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 10px;
  }

  .data-table tr:not(.group-row):not(.group-footer-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .data-table td {
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: start;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .data-table td::before {
    content: attr(data-label);
    min-height: 12px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
  }

  .data-table td[data-label=""]::before {
    display: none;
  }

  .data-table .group-row,
  .data-table .group-footer-row {
    display: block;
  }

  .data-table .group-row td,
  .data-table .group-footer-row td {
    display: block;
    padding: 0;
  }

  .data-table .group-row td::before,
  .data-table .group-footer-row td::before {
    display: none;
  }

  tr.group-row td {
    border-top: 0;
    border-bottom: 0;
    background: transparent;
  }

  tr.group-footer-row td {
    background: transparent;
    border-bottom: 0;
  }

  .jobs-edit-table .table-edit,
  .jobs-edit-table .sheet-select,
  .table-edit,
  .sheet-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    height: auto;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.05;
  }

  .jobs-edit-table .order-edit,
  .jobs-edit-table .customer-edit,
  .jobs-edit-table .due-edit,
  .jobs-edit-table .type-edit,
  .jobs-edit-table .supply-type-edit,
  .jobs-edit-table .blind-no-edit,
  .jobs-edit-table .blind-type-edit,
  .jobs-edit-table .fabric-edit,
  .jobs-edit-table .size-edit,
  .jobs-edit-table .hardware-edit,
  .jobs-edit-table .control-edit,
  .jobs-edit-table .side-edit,
  .jobs-edit-table .tube-edit,
  .jobs-edit-table .bottom-rail-edit,
  .jobs-edit-table .extras-edit,
  .jobs-edit-table .sheet-select {
    width: 100%;
  }

  .jobs-edit-table th {
    font-size: 10px;
  }

  .jobs-edit-table td {
    font-size: 12px;
  }

  .jobs-edit-table .status {
    justify-content: center;
    min-height: 34px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .jobs-edit-table .icon-delete-line {
    width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 18px;
  }

  #jobs .jobs-edit-table tr:not(.group-row):not(.group-footer-row) td:nth-child(6),
  #jobs .jobs-edit-table tr:not(.group-row):not(.group-footer-row) td:nth-child(11),
  #jobs .jobs-edit-table tr:not(.group-row):not(.group-footer-row) td:nth-child(12),
  #jobs .jobs-edit-table tr:not(.group-row):not(.group-footer-row) td:nth-child(19),
  #jobs .jobs-edit-table tr:not(.group-row):not(.group-footer-row) td:nth-child(20) {
    grid-column: 1 / -1;
  }

  .job-group-divider {
    gap: 6px;
  }

  .job-group-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .job-group-actions select,
  .job-group-actions .mini-btn {
    min-height: 36px;
    height: 36px;
    font-size: 12px;
  }

  .job-drag-handle,
  .manual-drag-handle,
  .mini-btn,
  .icon-delete-line {
    min-height: 36px;
  }

  .job-notes-edit {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .workflow-search-grid,
  .release-page-list {
    grid-template-columns: 1fr;
  }

  .label-grid {
    gap: 10px;
  }

  .label-preview-stage {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .label-card {
    --label-scale: 1.35;
  }

  .print-sheet {
    width: 100%;
    max-width: 100%;
    padding: 7px;
  }

  #cutlist-print-sheet .sheet-logo-header,
  #skins-print-sheet .sheet-logo-header,
  #channels-print-sheet .sheet-logo-header,
  #powdercoat-print-sheet .sheet-logo-header {
    grid-template-columns: 68px minmax(0, 1fr) 58px;
    gap: 4px;
  }

  #cutlist-print-sheet .sheet-logo-header h3,
  #skins-print-sheet .sheet-logo-header h3,
  #channels-print-sheet .sheet-logo-header h3,
  #powdercoat-print-sheet .sheet-logo-header h3 {
    min-width: 0;
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
  }

  #cutlist-print-sheet .sheet-logo-header span,
  #skins-print-sheet .sheet-logo-header span,
  #channels-print-sheet .sheet-logo-header span,
  #powdercoat-print-sheet .sheet-logo-header span {
    min-width: 0;
    font-size: 6px;
    line-height: 1.05;
    text-align: right;
    white-space: normal;
  }

  #cutlist-print-sheet .sheet-logo,
  #skins-print-sheet .sheet-logo,
  #channels-print-sheet .sheet-logo,
  #powdercoat-print-sheet .sheet-logo {
    width: 66px;
    max-height: 28px;
  }

  .stock-form,
  .deduction-form,
  .max-size-form,
  .powder-form,
  .powder-item-form,
  .component-extra-form,
  .powdercoat-manual-form,
  .fabric-form,
  .optional-extra-form {
    gap: 8px;
  }

  .powder-check {
    min-height: 34px;
    margin: 4px 8px 4px 0;
  }

  #toast {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

@media (max-width: 430px) {
  .brand-logo {
    width: 132px;
  }

  .brand h1 {
    max-width: 120px;
  }

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

  .tab {
    padding-inline: 10px;
  }

  .label-card {
    --label-scale: 1.12;
  }
}

@media (max-width: 1100px) {
  .deduction-form,
  .component-extra-form {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .settings-rule-split {
    grid-template-columns: 1fr;
  }

  .settings-product-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .cloud-access-head {
    align-items: flex-start;
  }

  .cloud-status-summary {
    align-items: flex-start;
  }

  .cloud-status-section {
    grid-template-columns: 1fr;
  }

  .cloud-current-user {
    min-width: 0;
    width: 100%;
  }

  .cloud-conflict-actions {
    min-width: 0;
    width: 100%;
  }

  .cloud-conflict-actions > div,
  .cloud-conflict-actions button {
    width: 100%;
  }

  .cloud-sync-facts,
  .cloud-role-grid,
  .cloud-rollout-list {
    grid-template-columns: 1fr;
  }

  .cloud-sync-facts > div,
  .cloud-rollout-list li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cloud-sync-facts > div:last-child,
  .cloud-rollout-list li:last-child {
    border-bottom: 0;
  }

  .cloud-login-form {
    grid-template-columns: 1fr;
  }

  .cloud-owner-form {
    grid-template-columns: 1fr;
  }

  .cloud-user-form {
    grid-template-columns: 1fr;
  }

  .cloud-section-access-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cloud-current-version {
    grid-template-columns: 1fr 1fr;
  }

  .cloud-current-version > div:nth-child(2) {
    border-right: 0;
  }

  .cloud-current-change {
    grid-column: 1 / -1;
  }

  .cloud-pin-reset {
    grid-template-columns: 1fr;
  }

  .cloud-users-table table,
  .cloud-users-table tbody,
  .cloud-users-table tr:not(.cloud-user-access-row),
  .cloud-users-table td,
  .cloud-version-table table,
  .cloud-version-table tbody,
  .cloud-version-table tr,
  .cloud-version-table td {
    display: block;
    width: 100%;
  }

  .cloud-users-table thead,
  .cloud-version-table thead { display: none; }

  .cloud-users-table tr:not(.cloud-user-access-row),
  .cloud-version-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .cloud-users-table td,
  .cloud-version-table td {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    white-space: normal !important;
  }

  .cloud-users-table td::before,
  .cloud-version-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .cloud-user-access-row { display: table-row; }
  .cloud-user-access-row td { display: table-cell; }

  .cloud-login-form button,
  .cloud-owner-form button {
    width: 100%;
  }

  .settings-toolbar {
    display: grid;
    align-items: stretch;
  }

  .settings-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    overflow: visible;
    padding: 4px;
  }

  .settings-tab {
    width: 100%;
    white-space: normal;
  }

  .settings-search {
    width: 100%;
  }

  .settings-backup-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .settings-backup-action {
    min-height: 0;
  }

  .settings-backup-action button {
    width: 100%;
  }

  .settings-panel-head,
  .settings-group-head,
  .settings-rule-card-head,
  .settings-product-card-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-group-head-actions {
    width: 100%;
  }

  .settings-group-head-actions > * {
    flex: 1;
  }

  .settings-panel-head,
  .settings-group {
    padding: 14px;
  }

  .settings-count {
    align-self: flex-start;
  }

  .settings-labelled-form,
  .stock-form,
  .powder-form,
  .optional-extra-form,
  .deduction-form,
  .component-extra-form,
  .powder-item-form,
  .fabric-form,
  .settings-rule-title-pair,
  .settings-rule-fields,
  .settings-rule-fields-four {
    grid-template-columns: 1fr;
  }

  .deduction-form .setting-field-wide {
    grid-column: auto;
  }

  .settings-labelled-form button,
  .deduction-form button,
  .component-extra-form button,
  .powder-item-form button,
  .fabric-form button {
    width: 100%;
  }

  .settings-rule-note {
    display: grid;
  }

  .settings-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .powder-check {
    width: 100%;
    min-width: 0;
    margin: 0;
    white-space: normal;
  }

  #settings .data-table table,
  #settings .data-table thead,
  #settings .data-table tbody {
    display: block;
  }

  #settings .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  #settings .data-table tbody {
    display: grid;
    gap: 10px;
  }

  #settings .data-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 11px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  #settings .data-table td {
    display: grid;
    min-width: 0;
    gap: 4px;
    height: auto;
    padding: 0;
    border: 0;
  }

  #settings .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #settings .data-table td:first-child,
  #settings .data-table td:last-child {
    grid-column: 1 / -1;
  }

  #settings .data-table td:last-child button {
    width: 100%;
  }
}

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

  body { background: white; color: black; }
  .app-header, .toolbar, .action-row, #toast, button { display: none !important; }
  main { max-width: none; padding: 0; }
  .view { display: none !important; }
  .view.active { display: block !important; }
  .view.active .data-table,
  .view.active #cut-optimisation,
  .view.active > .panel:not(.optimisation-panel) {
    display: none !important;
  }
  .view.active .print-sheet {
    display: block !important;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  body.print-job-sheet #jobs > :not(.workflow-tables) {
    display: none !important;
  }
  body.print-job-sheet .workflow-tables {
    display: block !important;
    margin: 0;
  }
  body.print-job-sheet .workflow-table-panel {
    display: none !important;
  }
  body.print-job-sheet .workflow-table-panel[data-workflow-panel="active"] {
    display: block !important;
    border: 0;
    padding: 0;
    background: white;
  }
  body.print-job-sheet .workflow-table-panel[data-workflow-panel="active"] > :not(#job-print-sheet) {
    display: none !important;
  }
  body.print-job-sheet #job-print-sheet {
    display: flex !important;
    flex-direction: column;
    width: 291mm;
    min-height: 204mm;
    max-width: none;
    margin: 0 auto;
    transform: scale(.95);
    transform-origin: top center;
  }
  body.print-archive-job-sheet #jobs > :not(.workflow-tables) {
    display: none !important;
  }
  body.print-archive-job-sheet .workflow-tables {
    display: block !important;
    margin: 0;
  }
  body.print-archive-job-sheet .workflow-table-panel {
    display: none !important;
  }
  body.print-archive-job-sheet .workflow-table-panel[data-workflow-panel="archive"] {
    display: block !important;
    border: 0;
    padding: 0;
    background: white;
  }
  body.print-archive-job-sheet .workflow-table-panel[data-workflow-panel="archive"] > :not(#archive-print-sheet) {
    display: none !important;
  }
  body.print-archive-job-sheet #archive-print-sheet {
    display: flex !important;
    flex-direction: column;
    width: 291mm;
    min-height: 204mm;
    max-width: none;
    margin: 0 auto;
  }
  body.print-powdercoat-sheet .view {
    display: none !important;
  }
  body.print-powdercoat-sheet #powdercoat {
    display: block !important;
  }
  body.print-powdercoat-sheet #powdercoat > :not(#powdercoat-print-sheet) {
    display: none !important;
  }
  body.print-powdercoat-sheet #powdercoat-print-sheet {
    display: block !important;
    width: 200mm;
    max-width: none;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  body.print-powdercoat-sheet #powdercoat-print-sheet .compact-table th,
  body.print-powdercoat-sheet #powdercoat-print-sheet .compact-table td {
    font-size: 9px;
    height: 18px;
    text-align: center;
  }
  body.print-channels-sheet .view {
    display: none !important;
  }
  body.print-channels-sheet #channels {
    display: block !important;
  }
  body.print-channels-sheet #channels > :not(#channels-print-sheet) {
    display: none !important;
  }
  body.print-channels-sheet #channels-print-sheet {
    display: block !important;
    width: 204mm;
    max-width: none;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  body.print-job-sheet #job-print-sheet .job-sheet-table,
  body.print-archive-job-sheet #archive-print-sheet .job-sheet-table {
    flex: 0 0 auto;
  }
  body.print-job-sheet #job-print-sheet.job-sheet-full .job-sheet-table,
  body.print-archive-job-sheet #archive-print-sheet.job-sheet-full .job-sheet-table {
    flex: 1 1 auto;
  }
  body.print-job-sheet #job-print-sheet .job-sheet-table th,
  body.print-job-sheet #job-print-sheet .job-sheet-table td,
  body.print-archive-job-sheet #archive-print-sheet .job-sheet-table th,
  body.print-archive-job-sheet #archive-print-sheet .job-sheet-table td {
    height: 5.1mm;
    padding: .85mm .65mm;
    font-size: 6pt;
    line-height: 1.05;
  }
  body.print-job-sheet #job-print-sheet.job-sheet-full .job-sheet-table th,
  body.print-job-sheet #job-print-sheet.job-sheet-full .job-sheet-table td,
  body.print-archive-job-sheet #archive-print-sheet.job-sheet-full .job-sheet-table th,
  body.print-archive-job-sheet #archive-print-sheet.job-sheet-full .job-sheet-table td {
    height: 4.4mm;
    padding: .68mm .52mm;
    font-size: 5.8pt;
  }
  body.print-job-sheet #job-print-sheet .job-spacer-row td,
  body.print-archive-job-sheet #archive-print-sheet .job-spacer-row td {
    height: 1.5mm;
    padding: 0;
    border: 0 !important;
    background: white !important;
  }
  body.print-job-sheet #job-print-sheet.job-sheet-full .job-spacer-row td,
  body.print-archive-job-sheet #archive-print-sheet.job-sheet-full .job-spacer-row td {
    height: 1.1mm;
  }
  body.print-job-sheet #job-print-sheet .sheet-footer,
  body.print-archive-job-sheet #archive-print-sheet .sheet-footer {
    margin-top: auto;
  }
  #cutlist-print-sheet,
  #skins-print-sheet,
  #channels-print-sheet {
    width: 200mm;
    max-width: none;
    margin: 0 auto;
  }
  .landscape-sheet {
    width: 287mm;
    max-width: none;
  }
  .page-title {
    display: none;
  }
  .panel, .data-table { border: 0; background: white; }
  .optimisation-card, .bar-pieces span { background: white; }
  .optimisation-grid { grid-template-columns: 1fr 1fr; }
  .optimisation-card { break-inside: avoid; page-break-inside: avoid; }
  table { min-width: 0; font-size: 10px; }
  th, td { border-color: #999; padding: 4px 5px; }
  p, .hint { color: #333; }
  .print-two-col { gap: 4px; }
  #skins-print-sheet .print-two-col {
    grid-template-columns: 1fr;
  }
  #channels-print-sheet .print-two-col {
    grid-template-columns: 1fr 1fr;
  }
  body.print-channels-sheet #channels-print-sheet.channels-print-one-col .print-two-col,
  body.print-skins-sheet #skins-print-sheet .print-two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  body.print-channels-sheet #channels-print-sheet.channels-print-two-col .print-two-col {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .print-group { margin-bottom: 4px; }
  .compact-table th,
  .compact-table td {
    padding: 1.4px 2px;
    font-size: 7.2px;
  }
  body.print-skins-sheet #skins-print-sheet .print-group,
  body.print-channels-sheet #channels-print-sheet .print-group {
    margin-bottom: 8px;
  }
  body.print-skins-sheet #skins-print-sheet .print-group-title,
  body.print-channels-sheet #channels-print-sheet .print-group-title {
    font-size: 10px;
    padding: 5px 7px;
  }
  body.print-skins-sheet #skins-print-sheet .print-group-title span,
  body.print-channels-sheet #channels-print-sheet .print-group-title span {
    font-size: 8.2px;
  }
  body.print-skins-sheet #skins-print-sheet .compact-table th,
  body.print-skins-sheet #skins-print-sheet .compact-table td {
    font-size: 9px;
    height: 19px;
    padding: 2.5px 3.5px;
    line-height: 1.05;
    text-align: center;
  }
  body.print-channels-sheet #channels-print-sheet .compact-table th,
  body.print-channels-sheet #channels-print-sheet .compact-table td {
    font-size: 9.4px;
    height: 21px;
    padding: 2.8px 4px;
    line-height: 1.05;
    text-align: center;
  }
  body.print-skins-sheet #skins-print-sheet.list-print-full .compact-table th,
  body.print-skins-sheet #skins-print-sheet.list-print-full .compact-table td {
    font-size: 8.5px;
    height: 17.5px;
    padding: 2px 3px;
  }
  body.print-channels-sheet #channels-print-sheet.list-print-full .compact-table th,
  body.print-channels-sheet #channels-print-sheet.list-print-full .compact-table td {
    font-size: 8.4px;
    height: 17px;
    padding: 2px 3px;
  }
  body.print-skins-sheet #skins-print-sheet.list-print-dense .compact-table th,
  body.print-skins-sheet #skins-print-sheet.list-print-dense .compact-table td,
  body.print-channels-sheet #channels-print-sheet.list-print-dense .compact-table th,
  body.print-channels-sheet #channels-print-sheet.list-print-dense .compact-table td {
    font-size: 10.2px;
    height: 24px;
    padding: 3.2px 4.5px;
  }
  body.print-skins-sheet #skins-print-sheet .tick-cell::after,
  body.print-channels-sheet #channels-print-sheet .tick-cell::after {
    width: 10.5px;
    height: 10.5px;
  }

  body.print-finished-labels,
  body.print-skin-labels,
  body.print-channel-labels,
  body.print-cut-sheet-labels {
    margin: 0;
  }

  .print-finished-labels .app-header,
  .print-finished-labels .page-title,
  .print-finished-labels .label-grid,
  .print-finished-labels .label-batch-panel,
  .print-finished-labels .label-preview-tabs,
  .print-skin-labels .app-header,
  .print-skin-labels .page-title,
  .print-skin-labels .label-grid,
  .print-skin-labels .label-batch-panel,
  .print-skin-labels .label-preview-tabs,
  .print-channel-labels .app-header,
  .print-channel-labels .page-title,
  .print-channel-labels .label-grid,
  .print-channel-labels .label-batch-panel,
  .print-channel-labels .label-preview-tabs,
  .print-cut-sheet-labels .app-header,
  .print-cut-sheet-labels .page-title,
  .print-cut-sheet-labels .label-grid,
  .print-cut-sheet-labels .label-batch-panel,
  .print-cut-sheet-labels .label-preview-tabs {
    display: none !important;
  }

  .print-finished-labels main,
  .print-skin-labels main,
  .print-channel-labels main,
  .print-cut-sheet-labels main {
    padding: 0;
  }

  .print-finished-labels .view,
  .print-skin-labels .view,
  .print-channel-labels .view,
  .print-cut-sheet-labels .view {
    display: none !important;
  }

  .print-finished-labels #labels,
  .print-skin-labels #labels,
  .print-channel-labels #labels,
  .print-cut-sheet-labels #labels {
    display: block !important;
  }

  .print-finished-labels .label-preview-stage,
  .print-skin-labels .label-preview-stage,
  .print-channel-labels .label-preview-stage,
  .print-cut-sheet-labels .label-preview-stage {
    display: block;
  }

  .print-finished-labels .label-preview-shell,
  .print-skin-labels .label-preview-shell,
  .print-channel-labels .label-preview-shell,
  .print-cut-sheet-labels .label-preview-shell {
    display: contents;
  }

  .print-finished-labels .label-preview-caption,
  .print-skin-labels .label-preview-caption,
  .print-channel-labels .label-preview-caption,
  .print-cut-sheet-labels .label-preview-caption {
    display: none;
  }

  .print-finished-labels .label-card,
  .print-skin-labels .label-card,
  .print-channel-labels .label-card,
  .print-cut-sheet-labels .label-card {
    --label-scale: 1;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .print-finished-labels .label-card:not(.finished),
  .print-skin-labels .label-card:not(.skin),
  .print-channel-labels .label-card:not(.channel),
  .print-cut-sheet-labels #label-preview-stage > .label-preview-shell > .label-card:not(.cut-sheet) {
    display: none;
  }
}

@media print {
  body.print-finished-labels,
  body.print-skin-labels {
    width: 62mm;
    height: 100mm;
  }

  body.print-finished-labels .label-card.finished,
  body.print-skin-labels .label-card.skin {
    width: 62mm;
    height: 100mm;
  }
}

@media print {
  body.print-channel-labels {
    width: 62mm;
    height: 100mm;
  }

  body.print-channel-labels .label-card.channel {
    width: 62mm;
    height: 100mm;
  }
}

@media print {
  body.print-cut-sheet-labels {
    width: 62mm;
    height: 100mm;
  }

  body.print-cut-sheet-labels .label-card.cut-sheet {
    width: 62mm;
    height: 100mm;
  }
}

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