:root {
  color-scheme: light;
  --bg: #f5f0e6;
  --bg-2: #dcebe5;
  --panel: #fffdf7;
  --panel-strong: #edf5f1;
  --line: rgba(22, 67, 63, 0.18);
  --line-strong: rgba(22, 67, 63, 0.42);
  --divider: #245b56;
  --text: #173b37;
  --muted: #60746f;
  --accent: #e45b32;
  --accent-2: #087d74;
  --accent-3: #126b85;
  --danger: #bd3535;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-soft: rgba(22, 67, 63, 0.045);
  --input: #ffffff;
  --shadow: 0 22px 55px rgba(31, 78, 70, 0.13);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(228, 91, 50, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(8, 125, 116, 0.18), transparent 36%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  color: var(--text);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(22, 67, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 67, 63, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  filter: blur(14px);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
  gap: 20px;
  padding: 20px;
}

.sidebar,
.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
}

.sidebar-content {
  display: grid;
  gap: 20px;
}

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

.brand,
.hero,
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.brand {
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 2vw, 2rem);
  line-height: 1.05;
}

.hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  max-width: 62ch;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.stat-card {
  min-width: 110px;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-card strong {
  font-size: 1.8rem;
}

.panel {
  padding: 18px;
}

.designer-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.4;
}

.machine-draft-editor {
  display: grid;
  gap: 14px;
}

.draft-toolbar {
  display: grid;
  gap: 12px;
}

.draft-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.draft-field input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.draft-field input:focus {
  border-color: rgba(8, 125, 116, 0.62);
  box-shadow: 0 0 0 3px rgba(8, 125, 116, 0.14);
}

.letter-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.letter-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  min-width: 36px;
  height: 36px;
  cursor: pointer;
}

.letter-chip.active {
  color: var(--text);
  border-color: rgba(8, 125, 116, 0.46);
  background: rgba(8, 125, 116, 0.12);
}

.draft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.search-field input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.search-field input:focus {
  border-color: rgba(8, 125, 116, 0.62);
  box-shadow: 0 0 0 3px rgba(8, 125, 116, 0.14);
}

.draft-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  padding: 14px;
}

.draft-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}

.badge {
  color: var(--accent);
  border-color: rgba(228, 91, 50, 0.32);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-item,
.product-card,
.machine-card,
.info-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stack-item,
.machine-card,
.info-row {
  padding: 14px;
}

.stack-item {
  display: grid;
  gap: 4px;
}

.stack-item strong {
  display: flex;
  justify-content: space-between;
}

.value-danger {
  color: var(--danger);
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.hint-text {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.form-grid input,
.machine-toolbar select,
.select-button,
.ghost-button,
.primary-button {
  font: inherit;
}

.form-grid input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.machine-toolbar select {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.form-grid input:focus {
  border-color: rgba(18, 107, 133, 0.62);
  box-shadow: 0 0 0 3px rgba(18, 107, 133, 0.14);
}

.form-grid input.readonly {
  opacity: 0.72;
  cursor: not-allowed;
}

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

.primary-button,
.ghost-button {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.page-switch-button {
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
  font: inherit;
  text-decoration: none;
}

.primary-button {
  border-color: var(--accent);
  background: linear-gradient(135deg, #ed7047, var(--accent));
  color: #ffffff;
}

.ghost-button {
  background: var(--surface);
}

.danger-action {
  border-color: rgba(189, 53, 53, 0.48);
  color: var(--danger);
}

.primary-button:hover,
.ghost-button:hover,
.page-switch-button:hover,
.tab:hover,
.select-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.tabs,
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.tab.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.page-switch-button.active {
  color: #ffffff;
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.page-navigation {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

[hidden] {
  display: none !important;
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 92px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 92px;
}

body.sidebar-collapsed .brand {
  padding: 16px 12px;
  justify-content: center;
}

body.sidebar-collapsed .brand > div {
  display: none;
}

body.sidebar-collapsed .brand-actions {
  flex-direction: column;
  width: 100%;
}

body.sidebar-collapsed .sidebar-content {
  display: none;
}

.is-hidden {
  display: none !important;
}

.page-view {
  grid-column: 1 / -1;
}

.dashboard-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.lookup-view {
  display: grid;
  gap: 20px;
}

.lookup-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
}

.lookup-hero-copy {
  display: grid;
  gap: 10px;
  max-width: 58ch;
}

.lookup-hero-meta {
  display: grid;
  gap: 12px;
  min-width: min(360px, 100%);
}

.lookup-meta-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}

.lookup-meta-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.lookup-nav {
  display: flex;
  align-items: flex-end;
}

.lookup-workbench {
  display: grid;
  gap: 18px;
}

.lookup-grid {
  display: grid;
  gap: 18px;
}

.lookup-form {
  align-items: end;
}

.lookup-actions {
  display: flex;
  align-items: flex-end;
}

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

.lookup-result-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(8, 125, 116, 0.14), transparent 32%),
    var(--surface);
}

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

.lookup-result-head h3 {
  margin-top: 4px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

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

.lookup-result-grid .info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.lookup-result-grid .info-row strong {
  color: var(--text);
  font-weight: 700;
}

body.focus-machine .grid-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.focus-machine .machine-panel {
  min-height: 70vh;
}

.machine-panel {
  min-height: 400px;
}

.machine-layout {
  display: grid;
  gap: 16px;
}

.product-table {
  display: grid;
  gap: 0;
  border: 4px solid var(--divider);
  border-radius: 18px;
  overflow: hidden;
  background: var(--divider);
}

.product-table-header,
.product-table-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(140px, 1.8fr) minmax(70px, 0.65fr) minmax(80px, 0.65fr) minmax(90px, 0.7fr) minmax(90px, 0.8fr) minmax(90px, 0.7fr);
  gap: 0;
}

.mobile-price-label {
  display: none;
}

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

.correction-input[aria-invalid="true"] {
  border-color: #a32424;
}

.product-table-cell .print-correction {
  display: none;
}

.product-table-empty .product-table-cell {
  grid-column: 1 / -1;
}

.product-table-header {
  color: #ffffff;
  background: var(--divider);
  font-weight: 700;
}

.product-table-header > div {
  padding: 12px 14px;
  border-right: 4px solid rgba(255, 255, 255, 0.18);
}

.product-table-header > div:last-child {
  border-right: 0;
}

.product-table-row {
  border-top: 4px solid var(--divider);
}

.product-table-cell {
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  display: grid;
  gap: 6px;
  align-content: center;
  border-right: 4px solid var(--divider);
  background: #fffdf7;
}

.product-table-cell:last-child {
  border-right: 0;
}

.product-table-cell strong {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.25;
}

.product-table-cell span {
  color: var(--muted);
  font-size: 0.82rem;
}

.slot-cell strong,
.amount-cell strong {
  font-size: 1.35rem;
}

.image-cell {
  padding: 10px;
}

.product-image-wrap {
  position: relative;
  width: 100%;
}

.image-cell img,
.lookup-product-image img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.product-image-placeholder {
  width: 100%;
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.82rem;
}

.lookup-product-image {
  max-width: 220px;
}

.table-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 4px solid var(--divider);
  border-radius: 22px;
  background:
    linear-gradient(180deg, var(--surface), var(--surface-soft)),
    var(--panel);
  overflow: hidden;
}

.table-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--divider);
  color: var(--muted);
  font-size: 0.85rem;
}

.table-row-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 0;
  align-items: stretch;
  overflow-x: auto;
  border: 4px solid var(--divider);
  border-radius: 18px;
  background: var(--divider);
}

.table-cell {
  position: relative;
  min-width: 0;
  width: 100%;
  min-height: 140px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  border-right: 4px solid var(--divider);
  background: #fffdf7;
}

.table-cell:last-child {
  border-right: 0;
}

.table-cell.empty {
  color: var(--muted);
  background: #edf5f1;
}

.table-cell-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.table-cell-title {
  font-weight: 700;
  line-height: 1.2;
}

.table-cell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.78rem;
}

.table-cell-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-cell-image {
  width: 100%;
  min-height: 100px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--line);
  background:
    radial-gradient(circle at 30% 20%, rgba(228, 91, 50, 0.18), transparent 40%),
    var(--surface-soft);
  display: grid;
  place-items: center;
}

.table-cell-image img,
.product-media img,
.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-media.placeholder {
  color: var(--muted);
  font-size: 0.82rem;
}

.select-button {
  border: 0;
  background: transparent;
  color: var(--accent-3);
  cursor: pointer;
}

.product-library {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.product-card {
  padding: 14px;
  display: grid;
  gap: 8px;
  cursor: grab;
}

.product-card .product-media + .topline {
  margin-top: 2px;
}

.product-card .topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.product-card .title {
  font-weight: 600;
}

.product-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.product-card .meta .chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.product-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.search-hint {
  margin-top: 10px;
  margin-bottom: 12px;
}

.image-preview-wrap {
  display: grid;
  gap: 10px;
}

.image-preview {
  max-height: 180px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.image-preview:not([src]) {
  display: none;
}

.debug-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.debug-panel {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #173b37;
  color: #d9f3ec;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  min-height: 88px;
}

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

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.info-row span:last-child {
  color: var(--muted);
}

.muted-inline {
  color: var(--muted);
}

.dashboard-status {
  margin: 10px 0 16px;
}

.product-table-empty .product-table-cell:first-child {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app-shell,
  .grid-layout {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .sidebar {
    width: auto;
  }

  body.sidebar-collapsed .brand > div {
    display: block;
  }

  body.sidebar-collapsed .brand-actions {
    flex-direction: row;
  }

  body.sidebar-collapsed .sidebar-content {
    display: grid;
  }

  .sidebar {
    position: relative;
    top: 0;
  }
}

@media screen and (max-width: 760px) {
  .hero {
    flex-direction: column;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

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

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

.machine-stage,
.right-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.right-rail {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding-right: 2px;
}

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

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

.machine-topbar-copy h1 {
  margin-top: 2px;
}

.machine-topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

  .machine-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

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

.collapsible-panel.is-collapsed .panel-body {
  display: none;
}

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

.panel-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.panel-toggle:hover {
  border-color: var(--line-strong);
}

.machine-panel {
  min-height: 400px;
}

.machine-layout {
  display: grid;
  gap: 14px;
}

.machine-card {
  display: grid;
  gap: 12px;
}

.machine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-card.editing {
  cursor: default;
}

.product-card-head {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.product-card-title {
  display: grid;
  gap: 8px;
}

.product-inline-form {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

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

.inline-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-grid input {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.inline-grid input:focus {
  border-color: rgba(8, 125, 116, 0.62);
  box-shadow: 0 0 0 3px rgba(8, 125, 116, 0.14);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .app-shell,
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .right-rail {
    position: relative;
    top: 0;
    max-height: none;
  }
}

@media screen and (max-width: 760px) {
  .machine-topbar,
  .lookup-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .machine-topbar-actions {
    justify-content: flex-start;
  }

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

  .product-card-head {
    grid-template-columns: 1fr;
  }

  .product-table-header {
    display: none;
  }

  .mobile-price-label {
    display: block;
  }

  .product-table-row {
    grid-template-columns: 1fr;
  }

  .product-table-cell {
    min-height: auto;
    border-right: 0;
    border-bottom: 4px solid var(--divider);
  }

  .product-table-cell:last-child {
    border-bottom: 0;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

.print-picklist-meta {
  display: none;
}

.articles-view { display: grid; gap: 20px; width: 100%; }
.article-workbench { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; margin-top: 20px; }
.article-workbench > div { min-width: 0; }
.article-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.article-filters .search-field { flex: 1 1 240px; }
.article-slot-filter { display: grid; gap: 8px; flex: 0 1 140px; }
.article-list { max-height: 620px; overflow: auto; margin: 16px 0; border: 2px solid var(--divider); border-radius: var(--radius-md); }
.article-table { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0; text-align: left; }
.article-table th { position: sticky; top: 0; z-index: 1; background: var(--divider); color: #fff; }
.article-table th, .article-table td { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-table th:last-child, .article-table td:last-child { border-right: 0; }
.article-table td:first-child { width: 18%; font-weight: 700; }
.article-table td:nth-child(2) { overflow-wrap: anywhere; }
.article-table td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.article-choice { background: var(--surface-soft); cursor: pointer; }
.article-choice:hover { background: #e1f0e8; color: #173b37; }
.article-choice.selected, .article-choice.selected:hover { background: #174e46; color: #fff; }
.article-choice.selected td:first-child { box-shadow: inset 5px 0 #ffd166; }
.article-choice:focus-visible { outline: 3px solid var(--divider); outline-offset: -3px; }
.article-choice.selected:focus-visible { outline-color: #ffd166; }
.article-choice[aria-disabled="true"] { opacity: 0.65; cursor: wait; }
.article-edit-fields { display: grid; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; min-width: 0; grid-column: 1 / -1; }
.article-stock-section { border-top: 1px solid var(--line); padding-top: 16px; }
.article-stock-slot h3 { font-size: 0.95rem; margin: 18px 0 0; }
.article-stock-section h2 { font-size: 1rem; }
.article-stock-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.article-stock-row label { flex: 1 1 100px; min-width: 0; }
.article-stock-row input { width: 100%; }
.article-edit-fields label { display: grid; gap: 8px; }
@media (max-width: 1040px) { .article-workbench { grid-template-columns: 1fr; } }

@media print {
  .print-omit-full,
  .price-cell,
  .correction-input,
  .mobile-price-label,
  .name-cell span,
  #heroMeta {
    display: none !important;
  }

  .product-table-cell .print-correction {
    display: block;
    min-height: 8mm;
    min-width: 16mm;
    border-bottom: 1px solid #777;
    color: #111;
  }
  .print-picklist-meta {
    display: block;
    margin-bottom: 5mm;
    break-inside: avoid;
    break-after: avoid;
  }

  .print-picklist-meta p {
    margin: 2mm 0;
  }

  :root {
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --divider: #111111;
    --text: #111111;
    --muted: #333333;
    --shadow: none;
  }

  body {
    background: #ffffff;
    color: #111111;
  }

  .backdrop,
  .right-rail,
  .machine-toolbar,
  .machine-topbar-actions,
  .dashboard-status,
  .lookup-view {
    display: none !important;
  }

  .app-shell,
  .dashboard-view,
  .machine-stage {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .panel,
  .machine-panel,
  .machine-topbar {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    padding: 0;
  }

  .machine-topbar {
    margin-bottom: 8mm;
  }

  .panel-header {
    margin-bottom: 5mm;
  }

  .pill,
  .badge,
  #heroMeta {
    border-color: #111111;
    color: #111111;
    background: #ffffff;
  }

  .product-table {
    border: 2pt solid #111111;
    border-radius: 0;
    background: #111111;
  }

  .product-table-header,
  .product-table-row {
    display: grid;
    grid-template-columns: 24mm minmax(0, 1fr) 18mm 23mm 28mm 25mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .product-table-header {
    color: #111111;
    background: #ffffff;
    break-after: avoid;
  }

  .product-table-header > div {
    padding: 2mm;
    font-size: 9pt;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .product-table-header > div,
  .product-table-cell {
    border-right: 2pt solid #111111;
  }

  .product-table-row {
    border-top: 2pt solid #111111;
  }

  .product-table-cell {
    min-height: 24mm;
    padding: 4mm;
    background: #ffffff;
  }

  .image-cell img,
  .lookup-product-image img,
  .product-image-placeholder {
    height: 22mm;
    border-radius: 0;
  }
}

#articleStatus.article-status-error {
  color: #a11212;
  background: #fff0f0;
  border: 2px solid #c62828;
  border-left-width: 6px;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
}

.article-workbench.bulk-editing { grid-template-columns: minmax(0, 1fr); }
.article-bulk-row input, .article-bulk-row select { width: 100%; min-width: 100px; padding: 9px; }
.article-bulk-row td:nth-child(2) input { min-width: 180px; }
.article-bulk-row td:nth-child(3) input { min-width: 150px; }
.article-bulk-slots { display: grid; grid-auto-rows: 46px; gap: 8px; align-items: center; }
.article-bulk-slots input { height: 46px; }
.article-bulk-row.bulk-dirty { background: #fff4d6; box-shadow: inset 4px 0 #b16a00; }
.article-bulk-results { padding-left: 22px; }
.article-bulk-results:empty { display: none; }
.article-bulk-results li { padding: 6px 0; overflow-wrap: anywhere; }
.article-bulk-results .bulk-error { color: #a11212; font-weight: 700; }
.article-bulk-results .bulk-success { color: #174e46; }

.admin-view { display: grid; gap: 20px; }
.admin-panels { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.admin-checkbox { display: flex !important; align-items: center; gap: 12px; }
.admin-checkbox input { width: auto; }
.admin-login { max-width: 520px; margin: 8vh auto; }
@media (max-width: 900px) { .admin-panels { grid-template-columns: 1fr; } }

.dashboard-status:empty { display: none; }

.history-view { display: grid; gap: 20px; }
.history-scroll { overflow-x: auto; }
.history-detail .correction-input { display: none; }
.history-detail .print-correction { display: block; }
#historyPrint { margin-bottom: 20px; }
#historySummary { margin-top: 24px; overflow-wrap: anywhere; }
#historySummary .bulk-error { color: #a11212; font-weight: bold; }
@media print {
  .history-controls, #historyPrint, #historySummary button { display: none !important; }
  .history-view { display: block; }
  #historyMeta { font-size: 9pt; }
  #historySummary li { break-inside: avoid; }
}

.pin-dialog { max-width: 520px; width: calc(100% - 32px); }
.pin-dialog::backdrop { background: rgba(0, 0, 0, .55); }
@media print { .pin-dialog { display: none !important; } }

/* Dashboard primary actions */
.primary-button.refill-action { background: #18723c; border-color: #18723c; color: #fff; }
.primary-button.refill-action:hover { background: #11582d; border-color: #11582d; }
