:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e1e7;
  --brand: #145c68;
  --brand-dark: #0f424b;
  --accent: #b85c2d;
  --ok: #16845f;
  --warn: #a36a00;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

body.login-locked {
  display: block;
}

body.login-locked .sidebar,
body.login-locked .shell {
  display: none;
}

.login-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background: #10272d;
}

body.login-locked .login-screen {
  display: grid;
}

.login-card {
  position: relative;
  width: min(340px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.login-card .brand-mark {
  margin: 0 auto 2px;
}

.login-card .login-brand-logo {
  width: min(190px, calc(100% - 78px));
  height: 56px;
  border-radius: 0;
  background: transparent;
}

.login-card .login-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 25px;
}

.login-version {
  display: block;
  margin-top: -9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}

.login-language-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.login-language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 52px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgb(16 39 45 / 10%);
}

.login-language-trigger:hover,
.login-language-trigger[aria-expanded="true"] {
  border-color: #9eb5ba;
  background: #f6fafb;
}

.login-language-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}

.login-language-trigger[aria-expanded="true"] .login-language-chevron {
  transform: translateY(2px) rotate(225deg);
}

.login-language-flags {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  min-width: 154px;
  gap: 2px;
  padding: 5px;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgb(16 39 45 / 18%);
}

.login-language-flags[hidden] {
  display: none;
}

.login-language-flags button {
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  height: 34px;
  border-radius: 7px;
  padding: 0 9px;
}

.login-language-flags button strong {
  display: inline;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(16 39 45 / 48%);
  backdrop-filter: blur(3px);
}

.app-loading-overlay[hidden] {
  display: none;
}

.app-loading-card {
  display: grid;
  width: min(920px, 94vw);
  gap: 10px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 18px;
  padding: 30px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.app-loading-card > strong {
  font-size: 20px;
}

.app-loading-card small {
  color: var(--muted);
}

.app-loading-spinner {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 6px;
  place-items: center;
}

.app-loading-spinner::before {
  position: absolute;
  inset: 0;
  border: 6px solid #dbe8ea;
  border-top-color: var(--brand);
  border-radius: 999px;
  content: "";
  animation: spin .75s linear infinite;
}

.app-loading-logo {
  position: relative;
  width: 32px;
  height: 38px;
  object-fit: contain;
}

.app-loading-countdown {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 3px 9px rgb(0 0 0 / 20%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.app-loading-machines {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.app-loading-machine {
  position: relative;
  display: grid;
  grid-template-rows: 82px auto auto;
  gap: 3px;
  min-width: 0;
  place-items: center;
  border: 1px solid #dbe5e8;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbfc;
}

.app-loading-machine img {
  width: 100%;
  height: 82px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.app-loading-machine strong {
  font-size: 17px;
}

.app-loading-machine small {
  font-size: 12px;
  text-align: center;
}

.app-loading-machine-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--ok);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgb(0 0 0 / 15%);
}

@media (max-width: 720px) {
  .app-loading-card {
    padding: 22px 16px;
  }

  .app-loading-machines {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    max-height: 50vh;
    overflow: auto;
  }

  .app-loading-machine:last-child {
    grid-column: 1 / -1;
  }
}

.login-error {
  margin: 0;
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

.login-error.is-info {
  color: var(--brand);
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 46px;
}

.password-input-wrap input.is-invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgb(180 35 24 / 14%);
}

.password-visibility {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-visibility:hover,
.password-visibility[aria-pressed="true"] {
  background: #edf3f5;
  color: var(--brand);
}

.password-visibility svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.login-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.login-keypad button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfc;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.login-keypad button:active {
  transform: translateY(1px);
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.login-actions .primary,
.login-actions .secondary {
  min-height: 36px;
}

.login-token-field[hidden] {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  height: 100vh;
  min-height: 0;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: #10272d;
  color: #fff;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.brand-toggle {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: default;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.brand-mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #b8c7cc;
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.nav-collapsible {
  min-width: 0;
}

.nav-collapsible summary {
  display: none;
}

.sidebar:not(.grouped-menu) .nav-collapsible {
  display: contents;
}

.sidebar.grouped-menu .nav-collapsible {
  display: grid;
  gap: 4px;
}

.sidebar.grouped-menu .nav-collapsible summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 7px;
  color: #dce8eb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.sidebar.grouped-menu .nav-collapsible summary::-webkit-details-marker {
  display: none;
}

.sidebar.grouped-menu .nav-collapsible summary::after {
  content: "›";
  margin-left: auto;
  font-size: 18px;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.sidebar.grouped-menu .nav-collapsible[open] summary::after {
  transform: rotate(90deg);
}

.sidebar.grouped-menu .nav-collapsible summary:hover {
  background: #173a43;
  color: #fff;
}

.sidebar.grouped-menu .nav-collapsible .nav-group {
  display: grid;
  gap: 4px;
  margin: 0 0 3px;
  padding-left: 12px;
  border-left: 1px solid rgb(255 255 255 / 16%);
}

.sidebar.grouped-menu .nav-collapsible .nav-subitem {
  padding-left: 12px;
}

.sidebar.grouped-menu .classic-group-title {
  display: none;
}

.menu-group-icon {
  width: 18px;
  color: #7fd0dc;
  text-align: center;
}

.sidebar-tools {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  flex: 0 0 auto;
}

.sidebar-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 9px;
  background: #10272d;
  box-shadow: 0 12px 30px rgb(0 0 0 / 32%);
}

.sidebar-options[hidden] {
  display: none;
}

.sidebar-footer-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9eb5bb;
  font-size: 11px;
}

.sidebar-options-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #cfe0e4;
  font-size: 17px;
  cursor: pointer;
}

.sidebar-options-toggle:hover,
.sidebar-options-toggle[aria-expanded="true"] {
  border-color: rgb(255 255 255 / 18%);
  background: #1b414a;
  color: #fff;
}

.sidebar-tool {
  width: 100%;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 12px;
  cursor: pointer;
}

.sidebar-tools .secondary {
  border-color: rgb(255 255 255 / 18%);
  background: transparent;
  color: #dce8eb;
}

.sidebar-tools .secondary:hover {
  background: #1b414a;
  color: #fff;
}

#installAppButton.is-ready {
  box-shadow: 0 0 0 3px rgb(255 255 255 / 12%);
}

.install-help {
  display: grid;
  gap: 14px;
}

.install-help p,
.install-help ol {
  margin: 0;
}

.install-help ol {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}

.install-status {
  border: 1px solid #a8d8c8;
  border-radius: 8px;
  padding: 12px;
  background: #edf9f4;
  color: #116149;
  font-weight: 700;
}

.install-status.blocked {
  border-color: #efc1bd;
  background: #fff1f0;
  color: var(--bad);
}

.permission-section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.permission-section-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  background: transparent;
  cursor: pointer;
}

.permission-section-tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}

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

.permission-group-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.permission-dual-list {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 10px;
}

.permission-list {
  min-height: 280px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfc;
}

.permission-list button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.permission-list button.selected { border-color: var(--brand); background: #eaf5f6; }
.permission-move-actions { display: grid; align-content: center; gap: 8px; }

#sidebarAppVersion {
  color: #8fb0b8;
  font-size: 12px;
  text-align: center;
}

.nav-group {
  display: grid;
  gap: 4px;
  margin: 4px 0;
}

.nav-group-title {
  padding: 8px 12px 3px;
  color: #8fb0b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  border: 0;
  border-radius: 7px;
  padding: 11px 12px;
  background: transparent;
  color: #dce8eb;
  text-align: left;
  cursor: pointer;
}

.nav-subitem {
  padding-left: 24px;
}

.nav-item:hover,
.nav-item.active {
  background: #1b414a;
  color: #fff;
}

.shell {
  padding: 24px;
  min-width: 0;
  overflow: auto;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
}

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

.header-controls {
  position: relative;
  justify-content: flex-end;
}

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

.language-picker {
  justify-content: flex-end;
}

.language-flag {
  display: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

.language-picker select,
.user-picker select {
  min-width: 130px;
}

.language-picker select {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.user-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.language-flags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgb(0 0 0 / 10%);
}

.language-flags button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 42px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  background: transparent;
  color: #42526b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.flag-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
  border: 1px solid rgb(0 0 0 / 10%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 30%);
}

.flag-it {
  background: linear-gradient(90deg, #159947 0 33.33%, #fff 33.33% 66.66%, #d1242f 66.66%);
}

.flag-mt {
  background: linear-gradient(90deg, #fff 0 50%, #cf142b 50%);
}

.flag-es {
  background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%);
}

.flag-pt {
  background: linear-gradient(90deg, #046a38 0 42%, #da291c 42%);
}

.flag-en {
  background:
    linear-gradient(32deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 54%, #fff 54% 60%, transparent 60%),
    linear-gradient(148deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 54%, #fff 54% 60%, transparent 60%),
    linear-gradient(90deg, transparent 0 38%, #fff 38% 44%, #c8102e 44% 56%, #fff 56% 62%, transparent 62%),
    linear-gradient(180deg, transparent 0 35%, #fff 35% 42%, #c8102e 42% 58%, #fff 58% 65%, transparent 65%),
    #012169;
}

.language-flags button strong {
  font-size: 12px;
}

.language-flags button.active {
  background: #2f5bea;
  color: #fff;
  box-shadow: 0 6px 14px rgb(47 91 234 / 25%);
}

.user-chip {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  box-shadow: 0 8px 18px rgb(0 0 0 / 10%);
}

.user-chip::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #98a2b3;
}

.user-chip.is-online::after {
  background: var(--ok);
}

.user-chip.is-offline::after {
  background: var(--bad);
}

.message-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0 4px;
  background: #b42318;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgb(0 0 0 / 18%);
}

.user-chip .user-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.user-chip .user-icon::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.user-chip .user-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 1px;
  width: 13px;
  height: 8px;
  border-radius: 999px 999px 5px 5px;
  background: currentColor;
}

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

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 40px rgb(0 0 0 / 22%);
}

.user-menu-header {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfc;
}

.user-menu-header small {
  color: var(--muted);
  font-size: 12px;
}

.user-menu button {
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.user-menu button:last-child {
  border-bottom: 0;
}

.user-menu button:hover {
  background: #f3f7f8;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  gap: 14px;
  padding: 0 18px 18px;
}

.settings-grid.two {
  grid-template-columns: repeat(2, minmax(220px, 360px));
}

.delivery-company-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 0 18px 18px;
}

.delivery-company-settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfc;
}

.delivery-company-settings-card > header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: #eef5f6;
}

.delivery-company-settings-card > header span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.delivery-company-settings-card > header select {
  width: min(380px, 55%);
  margin-left: auto;
  background: #fff;
  font-weight: 700;
}

.delivery-company-settings-card .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  padding: 13px;
}

.delivery-company-settings-card .field.wide {
  grid-column: 1 / -1;
}

.settings-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.settings-tab {
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
}

.settings-tab.active {
  border-bottom-color: var(--primary);
  color: var(--ink);
}

.settings-tab-panel {
  padding-top: 16px;
}

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

.settings-list {
  display: grid;
  gap: 8px;
  max-width: 760px;
  padding: 0 18px 18px;
}

.settings-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
}

.settings-list-row span,
.settings-list-row small {
  display: block;
}

.settings-list-row small {
  color: var(--muted);
  margin-top: 2px;
}

.panel-header.inline {
  border-bottom: 0;
  padding: 0 18px 12px;
}

.panel-header.inline .subsection-title {
  margin: 0;
  padding: 0;
}

.settings-table {
  margin: 0 18px 18px;
}

.settings-protection-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0d6874;
}

.settings-protection-tab.active {
  border-bottom-color: #0d7480;
  color: #084f59;
}

.protection-shell {
  display: grid;
  gap: 16px;
  margin: 0 18px 22px;
  overflow: hidden;
  border: 1px solid #c9dce0;
  border-radius: 15px;
  padding-bottom: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(15, 112, 124, .11), transparent 340px),
    #f8fbfc;
  box-shadow: 0 10px 28px rgba(36, 52, 61, .08);
}

.protection-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 20px 22px 2px;
}

.protection-heading-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #b9d9de;
  border-radius: 13px;
  background: #e7f5f7;
  color: #087080;
  font-size: 23px;
  font-weight: 900;
}

.protection-heading h3,
.protection-card h4 {
  margin: 2px 0 4px;
}

.protection-heading h3 {
  font-size: 22px;
}

.protection-heading p,
.protection-card-heading p,
.protection-restore-notice p {
  margin: 0;
  color: var(--muted);
}

.protection-kicker,
.protection-card-kicker {
  color: #0a6875;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.protection-error {
  margin: 0 22px;
  border: 1px solid #efb7b1;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff0ee;
  color: #a02f27;
}

.protection-error.is-success {
  border-color: #b8dfd2;
  background: #eef9f5;
  color: #08745d;
}

.protection-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 22px;
}

.protection-status-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 78px;
  border: 1px solid #d3e2e5;
  border-radius: 11px;
  padding: 11px 13px;
  background: #fff;
}

.protection-status-card > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e4f3ef;
  color: #087e65;
  font-weight: 900;
}

.protection-status-card.is-warning > span {
  background: #fff0cf;
  color: #9b6500;
}

.protection-status-card.is-danger > span {
  background: #fee7e4;
  color: #ad332a;
}

.protection-status-card strong,
.protection-status-card small {
  display: block;
}

.protection-status-card small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.protection-card {
  margin: 0 22px;
  overflow: hidden;
  border: 1px solid #d3e2e5;
  border-radius: 12px;
  background: #fff;
}

.protection-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
}

.protection-card h4 {
  font-size: 18px;
}

.protection-card-heading p {
  max-width: 780px;
  font-size: 12px;
}

.protection-restore-notice {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 18px 14px;
  border: 1px solid #dbe4e6;
  border-radius: 9px;
  padding: 9px 11px;
  background: #f7f9fa;
  font-size: 12px;
}

.protection-restore-notice > span {
  display: grid;
  flex: 0 0 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #dcebed;
  color: #0c6470;
  font-weight: 900;
}

.protection-table {
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.protection-table td {
  vertical-align: middle;
}

.protection-table code {
  font-size: 11px;
}

.protection-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e5f4ef;
  color: #08745d;
  font-size: 11px;
  font-weight: 900;
}

.protection-pill.is-warning {
  background: #fff0cf;
  color: #8c5b00;
}

.protection-pill.is-danger {
  background: #fee7e4;
  color: #a02f27;
}

.protection-empty {
  padding: 20px !important;
  color: var(--muted);
  text-align: center;
}

.protection-integrity-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 16px;
}

.protection-integrity-stat {
  border: 1px solid #d9e5e7;
  border-radius: 9px;
  padding: 10px 12px;
  background: #f9fbfc;
}

.protection-integrity-stat strong,
.protection-integrity-stat span {
  display: block;
}

.protection-integrity-stat strong {
  font-size: 20px;
}

.protection-integrity-stat span {
  color: var(--muted);
  font-size: 11px;
}

.protection-orphan-list {
  display: grid;
  gap: 7px;
  padding: 0 18px 18px;
}

.protection-orphan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e0e8ea;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fcfdfd;
}

.protection-orphan-row code {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.protection-working {
  opacity: .72;
  pointer-events: none;
}

.settings-delete-tab {
  color: #a33a31;
  gap: 6px;
}

.settings-delete-tab.active {
  border-bottom-color: #c5483e;
  color: #8f2f28;
}

.data-deletion-shell {
  display: grid;
  gap: 18px;
  margin: 0 18px 22px;
  overflow: hidden;
  border: 1px solid #e3c6c2;
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(197, 72, 62, .08), transparent 310px),
    #fff;
  box-shadow: 0 10px 28px rgba(36, 52, 61, .08);
}

.data-deletion-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 20px 22px 2px;
}

.data-deletion-heading-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #edc2bd;
  border-radius: 13px;
  background: #fff0ee;
  color: #a9322a;
  font-size: 25px;
  font-weight: 900;
}

.data-deletion-heading h3 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.data-deletion-heading p,
.data-deletion-notice p,
.data-deletion-storage-note p {
  margin: 0;
}

.data-deletion-heading p {
  color: var(--muted);
}

.data-deletion-kicker {
  color: #a33a31;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.data-deletion-notice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 22px;
  border: 1px solid #efc1bb;
  border-radius: 11px;
  padding: 13px 15px;
  background: #fff5f3;
  color: #7c2922;
}

.data-deletion-notice-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #c5483e;
  color: #fff;
  font-weight: 900;
}

.data-deletion-notice strong,
.data-deletion-notice p {
  display: block;
}

.data-deletion-notice p {
  margin-top: 2px;
  color: #985047;
  font-size: 13px;
}

.data-deletion-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 0 22px;
}

.data-deletion-toolbar strong,
.data-deletion-toolbar small {
  display: block;
}

.data-deletion-toolbar strong {
  font-size: 17px;
}

.data-deletion-toolbar small {
  margin-top: 3px;
  color: var(--muted);
}

.data-deletion-loading,
.data-deletion-error {
  margin: -6px 22px 0;
  border-radius: 9px;
  padding: 10px 12px;
}

.data-deletion-loading {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #eef6f7;
  color: var(--brand);
  font-weight: 700;
}

.data-deletion-error {
  border: 1px solid #efb7b1;
  background: #fff0ee;
  color: #a02f27;
}

.data-deletion-mini-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #cfe2e5;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.data-deletion-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 0 22px;
}

.data-deletion-card {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.data-deletion-card:hover {
  border-color: #b8ccd0;
  box-shadow: 0 6px 18px rgba(23, 72, 82, .08);
  transform: translateY(-1px);
}

.data-deletion-card.is-selected {
  border-color: #d8756d;
  background: linear-gradient(135deg, #fff 0%, #fff6f4 100%);
  box-shadow: inset 4px 0 0 #c5483e;
}

.data-deletion-card.is-auto {
  border-color: #d69d43;
  background: #fffbf1;
  box-shadow: inset 4px 0 0 #d69d43;
}

.data-deletion-card input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #b93d34;
}

.data-deletion-card-copy strong,
.data-deletion-card-copy span,
.data-deletion-card-copy small {
  display: block;
}

.data-deletion-card-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.data-deletion-card-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.data-deletion-card-copy small {
  margin-top: 9px;
}

.data-deletion-table-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.data-deletion-table-list > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid #d8e2e5;
  border-radius: 5px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, .72);
  color: #63767d;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
}

.data-deletion-table-list b {
  color: #263f47;
}

.data-deletion-count {
  min-width: 56px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #edf4f5;
  color: #0b5662;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.data-deletion-card.is-selected .data-deletion-count {
  background: #f9dfdc;
  color: #8b2c25;
}

.data-deletion-dependency,
.data-deletion-auto-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.data-deletion-dependency {
  background: #eef3f4;
  color: #536970;
}

.data-deletion-auto-badge {
  background: #fff0c9;
  color: #8b5a00;
}

.data-deletion-protected {
  display: grid;
  gap: 11px;
  margin: 0 22px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.data-deletion-section-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.data-deletion-section-title strong,
.data-deletion-section-title small {
  display: block;
}

.data-deletion-section-title small {
  margin-top: 2px;
  color: var(--muted);
}

.data-deletion-lock {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eef3f4;
}

.data-deletion-protected-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.data-deletion-protected-card {
  display: grid;
  gap: 4px;
  border: 1px dashed #bdcbd0;
  border-radius: 10px;
  padding: 11px 12px;
  background: #f7f9fa;
  color: #506269;
}

.data-deletion-protected-card > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.data-deletion-protected-card b {
  color: var(--ink);
}

.data-deletion-protected-card em {
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.data-deletion-protected-card small {
  color: var(--muted);
}

.data-deletion-storage-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin: 0 22px;
  border-radius: 9px;
  padding: 10px 12px;
  background: #eef6fb;
  color: #315c78;
  font-size: 12px;
}

.data-deletion-storage-note > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #83adc7;
  border-radius: 50%;
  font-weight: 900;
}

.data-deletion-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-top: 1px solid #e3c6c2;
  padding: 16px 22px;
  background: #fcf7f6;
}

.data-deletion-summary > div {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 10px;
  align-items: baseline;
}

.data-deletion-summary > div > span {
  color: #7a5551;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-deletion-summary > div > strong {
  color: #982f28;
  font-size: 27px;
}

.data-deletion-summary > div > small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.data-deletion-continue {
  display: inline-flex;
  gap: 20px;
  align-items: center;
  min-height: 44px;
}

.data-deletion-confirm-dialog {
  display: grid;
  gap: 15px;
}

.data-deletion-confirm-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid #edc4bf;
  border-radius: 11px;
  padding: 13px 14px;
  background: #fff7f6;
}

.data-deletion-confirm-summary span,
.data-deletion-confirm-summary small {
  display: block;
}

.data-deletion-confirm-summary small {
  margin-top: 3px;
  color: var(--muted);
}

.data-deletion-confirm-summary strong {
  color: #a43129;
  font-size: 27px;
}

.data-deletion-confirm-warning {
  border-left: 4px solid #c5483e;
  padding: 9px 12px;
  background: #fff1ef;
  color: #7f2b24;
  font-size: 13px;
}

.data-deletion-confirm-phrase {
  display: grid;
  gap: 5px;
}

.data-deletion-confirm-phrase code {
  width: fit-content;
  border-radius: 5px;
  padding: 3px 7px;
  background: #273b42;
  color: #fff;
  font-weight: 800;
}

.data-deletion-confirmation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #efc0ba;
  border-radius: 9px;
  padding: 12px;
  background: #fff8f7;
  color: #742922;
  font-weight: 700;
}

.data-deletion-confirmation input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: #b93d34;
}

@media (max-width: 980px) {
  .protection-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protection-integrity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .data-deletion-category-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .settings-tabs {
    overflow-x: auto;
  }

  .protection-heading {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .protection-heading > button {
    grid-column: 1 / -1;
  }

  .protection-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .protection-status-grid,
  .protection-integrity-summary {
    grid-template-columns: 1fr;
  }

  .data-deletion-heading {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .data-deletion-heading > button {
    grid-column: 1 / -1;
  }

  .data-deletion-toolbar,
  .data-deletion-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .data-deletion-protected-grid {
    grid-template-columns: 1fr;
  }

  .data-deletion-continue {
    justify-content: space-between;
  }
}

.panel-header {
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.primary,
.secondary {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-dark);
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.inventory-load-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

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

.stock-in-simple-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.stock-in-code-step,
.stock-in-data-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.stock-in-code-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 22px;
}

.stock-in-step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.stock-in-step-content h3,
.stock-in-data-heading h3 {
  margin: 0 0 4px;
}

.stock-in-step-content > p,
.stock-in-data-heading p {
  margin: 0 0 18px;
  color: var(--muted);
}

.stock-in-step-content {
  display: grid;
  gap: 14px;
}

.stock-in-code-field input {
  min-height: 48px;
  font-size: 18px;
  font-weight: 700;
}

.stock-in-data-heading {
  display: flex;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.stock-in-data-heading p {
  margin-bottom: 0;
}

.stock-in-data-step .selected-article-card {
  margin: 18px 18px 0;
}

.stock-in-fields {
  padding-top: 14px;
}

.stock-transfer-flow .stock-in-code-step,
.stock-transfer-flow .stock-in-data-step {
  min-width: 0;
  box-shadow: 0 12px 28px rgb(16 39 45 / 7%);
}

.stock-transfer-flow .stock-in-step-content,
.stock-transfer-flow .stock-in-code-field,
.stock-transfer-flow .scan-input {
  min-width: 0;
}

.stock-transfer-flow .stock-in-fields {
  grid-template-columns: 1fr;
}

.compact-field {
  margin: 0;
}

.secondary.danger {
  border-color: #f1b8b3;
  color: var(--bad);
}

.secondary.danger:hover {
  background: #fff5f4;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics[hidden] {
  display: none;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-tab-panel .machine-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding: 14px 0 22px;
  border-bottom: 0;
}

.settings-tab-panel .machine-model {
  min-width: 0;
  grid-template-columns: 104px minmax(0, 1fr);
}

.settings-tab-panel .machine-model small {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.workflow article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfc;
}

.workflow span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.workflow small {
  color: var(--muted);
}

.row-actions,
.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.row-actions {
  margin-top: 0;
}

.row-actions .secondary,
.list-actions .secondary {
  min-height: 32px;
  padding: 0 10px;
}

.print-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 10px 0 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.92rem;
}

.print-status.is-printing {
  color: var(--ink);
}

.print-status.is-printed,
.print-status.is-confirmed {
  border-color: #a7d8b8;
  background: #eefaf2;
  color: #166534;
}

.print-status.is-failed,
.print-status.is-not-confirmed {
  border-color: #f3b4b4;
  background: #fff4f4;
  color: #991b1b;
}

.selected-article-card {
  padding: 12px 14px;
  border: 1px solid #b8d8e0;
  border-left: 4px solid var(--brand);
  border-radius: 7px;
  background: #eef9fb;
}

.selected-article-card span,
.selected-article-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-article-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.15rem;
}

.selected-article-card p {
  margin: 4px 0;
  font-weight: 700;
}

.inventory-load-product-preview {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.inventory-load-product-photo,
.inventory-load-product-photo-button {
  width: 76px;
  height: 64px;
}

.inventory-load-product-photo {
  display: block;
  border: 1px solid #dbe7ea;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.inventory-load-product-photo.is-placeholder {
  opacity: 0.72;
}

.inventory-load-product-photo-button {
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.inventory-load-product-photo-button:hover,
.inventory-load-product-photo-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .inventory-load-product-preview {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .inventory-load-product-photo,
  .inventory-load-product-photo-button {
    width: 58px;
    height: 52px;
  }
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid #cbd5e1;
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.scan-input {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  align-items: center;
}

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

.icon-button.qr-scan-button {
  width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.qr-scan-button span {
  display: inline-block;
  width: 19px;
  height: 19px;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 7px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 2px 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 7px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 2px 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 7px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 2px 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 7px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 2px 7px no-repeat,
    radial-gradient(circle at center, var(--brand) 0 3px, transparent 4px);
}

.qr-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 27, 32, 0.72);
}

.qr-scan-panel {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.qr-scan-panel video {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #000;
  object-fit: cover;
}

.product-filters {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 10px;
  padding: 18px;
  padding-bottom: 10px;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto auto;
  gap: 8px;
  align-items: center;
  width: min(860px, 100%);
}

.stock-finder {
  display: grid;
  gap: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at 100% 0, rgb(20 92 104 / 7%), transparent 32%),
    #f8fafb;
}

.stock-finder-header {
  min-height: 96px;
  background: linear-gradient(115deg, #fff 0%, #f4fafb 100%);
}

.stock-finder-header > div {
  display: grid;
  gap: 3px;
}

.stock-finder-header h2,
.stock-finder-header p {
  margin: 0;
}

.stock-finder-header h2 {
  font-size: 24px;
}

.stock-finder-header p {
  color: var(--muted);
  font-size: 14px;
}

.stock-finder-kicker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.stock-finder-model-picker {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 3fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid #d7e5e8;
  border-radius: 12px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 8px 24px rgb(16 39 45 / 6%);
}

.stock-finder-model-heading {
  display: grid;
  gap: 3px;
}

.stock-finder-model-heading span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.stock-finder-model-heading small {
  color: var(--muted);
}

.stock-finder-models {
  display: grid;
  grid-template-columns: repeat(5, minmax(80px, 1fr));
  gap: 8px;
}

.stock-finder-models button {
  min-height: 44px;
  border-color: #cddcdf;
  border-radius: 9px;
  color: #30464b;
  font-weight: 700;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stock-finder-models button:hover {
  border-color: var(--brand);
  background: #f2f8f9;
  transform: translateY(-1px);
}

.stock-finder-models button.active,
.stock-finder-models button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgb(20 92 104 / 22%);
}

.stock-finder-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(16 39 45 / 6%);
}

.stock-finder-form .field > span {
  color: #34464b;
  font-size: 13px;
  font-weight: 700;
}

.stock-finder-form input {
  min-height: 46px;
  border: 1px solid #cfdadf;
  border-radius: 9px;
  padding: 0 13px;
  background: #fbfcfd;
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.stock-finder-form input:hover {
  border-color: #9eb5ba;
}

.stock-finder-form input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(20 92 104 / 12%);
}

.stock-finder-form .scan-input {
  grid-template-columns: minmax(0, 1fr) 46px;
}

.stock-finder-form .qr-scan-button {
  width: 46px;
  min-height: 46px;
  border-radius: 9px;
  background: #f6f9fa;
}

.stock-finder-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 126px;
  min-height: 46px;
  border-radius: 9px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgb(20 92 104 / 20%);
}

.stock-finder-search-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.stock-finder-results {
  min-width: 0;
}

.stock-finder-results:empty {
  display: none;
}

.stock-finder-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfe;
  color: var(--muted);
}

.stock-finder-empty strong {
  color: var(--ink);
}

.stock-finder-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.serial-history-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.serial-history-summary,
.serial-history-current {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.serial-history-summary div,
.serial-history-current div {
  display: grid;
  gap: 3px;
}

.serial-history-summary span,
.serial-history-current small,
.serial-history-current span,
.serial-history-event small {
  color: var(--muted);
}

.serial-history-current {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f8fafc;
}

.serial-history-timeline {
  display: grid;
  padding: 18px;
}

.serial-history-event {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  min-height: 78px;
}

.serial-history-dot {
  position: relative;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}

.serial-history-event:not(:last-child) .serial-history-dot::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 3px;
  width: 2px;
  height: 58px;
  background: var(--line);
}

.serial-history-event header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.serial-history-event p {
  margin: 5px 0;
}

.print-scan-verification {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #f3f8ff;
}

.print-scan-verification[hidden] {
  display: none;
}

.print-scan-verification small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.print-scan-verification.is-error {
  border-color: var(--bad);
  background: #fff2f1;
  box-shadow: 0 0 0 2px rgba(190, 45, 45, .12);
}

.print-scan-verification.is-error .field > span,
.print-scan-verification.is-error small {
  color: var(--bad);
  font-weight: 700;
}

.print-scan-verification.is-error input {
  border-color: var(--bad);
  outline: 2px solid rgba(190, 45, 45, .16);
}

.serial-lookup-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.serial-lookup-result[hidden] {
  display: none;
}

.serial-lookup-result > div {
  display: grid;
  gap: 2px;
}

.serial-lookup-result small,
.serial-lookup-result span {
  color: var(--muted);
}

.serial-lookup-result.is-valid {
  border-color: #53a66b;
  background: #f1fbf4;
}

.serial-lookup-result.is-error {
  border-color: var(--bad);
  background: #fff2f1;
  color: var(--bad);
}

.serial-lookup-result.is-loading {
  color: var(--muted);
}

.inventory-transfer-status {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
}

.inventory-transfer-status > div {
  min-width: 0;
}

.inventory-transfer-status strong,
.inventory-transfer-status small {
  overflow-wrap: anywhere;
}

.inventory-transfer-status strong {
  color: var(--ink);
}

.inventory-transfer-status.is-error strong {
  color: var(--bad);
}

.inventory-transfer-status-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #e8f1f3;
  color: var(--brand);
  font-size: 17px;
  font-weight: 900;
}

.inventory-transfer-status.is-valid .inventory-transfer-status-icon {
  background: #dff5e7;
  color: var(--ok);
}

.inventory-transfer-status.is-error .inventory-transfer-status-icon {
  background: #fde7e5;
  color: var(--bad);
}

.inventory-transfer-status-icon .spinner {
  width: 17px;
  height: 17px;
}

.inventory-transfer-product-preview {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.inventory-transfer-product-preview .inventory-load-product-photo,
.inventory-transfer-product-preview .inventory-load-product-photo-button {
  width: 88px;
  height: 76px;
}

.inventory-transfer-product-copy {
  min-width: 0;
}

.inventory-transfer-product-copy > strong,
.inventory-transfer-product-copy > p {
  overflow-wrap: anywhere;
}

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

.inventory-transfer-meta > div {
  min-width: 0;
  border: 1px solid #d5e5e8;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgb(255 255 255 / 72%);
}

.inventory-transfer-meta small {
  margin-bottom: 3px;
}

.inventory-transfer-meta b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.inventory-transfer-confirmation {
  display: grid;
  gap: 14px;
}

.inventory-transfer-review-hint {
  margin: 0;
  color: var(--muted);
}

.inventory-transfer-review-product {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #d5e5e8;
  border-radius: 10px;
  padding: 12px;
  background: #f5fafb;
}

.inventory-transfer-review-product .inventory-load-product-photo,
.inventory-transfer-review-product .inventory-load-product-photo-button {
  width: 88px;
  height: 76px;
}

.inventory-transfer-review-product > div {
  min-width: 0;
}

.inventory-transfer-review-product span,
.inventory-transfer-review-product small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-transfer-review-product strong,
.inventory-transfer-review-product p {
  display: block;
  overflow-wrap: anywhere;
}

.inventory-transfer-review-product p {
  margin: 3px 0 7px;
  font-weight: 700;
}

.inventory-transfer-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.inventory-transfer-route > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: #f8fafb;
}

.inventory-transfer-route > div.is-destination {
  border-color: #8ebac1;
  background: #edf8fa;
}

.inventory-transfer-route small {
  color: var(--muted);
  font-size: 11px;
}

.inventory-transfer-route strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.inventory-transfer-route-arrow {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.inventory-transfer-review-notes {
  border-left: 3px solid #9eb8bd;
  padding: 5px 10px;
  background: #f8fafb;
}

.inventory-transfer-review-notes small {
  color: var(--muted);
}

.inventory-transfer-review-notes p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.inventory-transfer-notification-hint {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 9px;
  padding: 9px 11px;
  background: #eef5f6;
  color: var(--brand-dark);
  font-size: 12px;
}

.inventory-transfer-notification-hint > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #d7e9ec;
}

.inventory-transfer-notification-hint p {
  margin: 0;
}

.inventory-transfer-success {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
}

.inventory-transfer-success > span {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #def4e9;
  color: var(--ok);
  font-size: 30px;
  font-weight: 900;
}

.inventory-transfer-success > strong {
  font-size: 20px;
}

.inventory-transfer-success > p {
  margin: 0 0 4px;
  color: var(--muted);
}

.inventory-transfer-success .inventory-transfer-success-warning {
  width: 100%;
  margin: 2px 0 0;
  border: 1px solid #e7c671;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff7df;
  color: #795500;
  text-align: left;
  font-size: 12px;
}

.inventory-transfer-success .inventory-transfer-route {
  width: 100%;
  text-align: left;
}

.stock-finder-metric {
  display: grid;
  gap: 4px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 15px;
  background: #fff;
  box-shadow: 0 6px 18px rgb(16 39 45 / 5%);
}

.stock-finder-metric span,
.stock-finder-section header span,
.responsive-table small {
  color: var(--muted);
  font-size: 12px;
}

.stock-finder-metric strong {
  font-size: 24px;
}

.stock-finder-sections {
  display: grid;
  gap: 14px;
}

.stock-finder-section {
  display: grid;
  gap: 10px;
}

.stock-finder-section header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.stock-finder-section h3 {
  margin: 0;
  font-size: 17px;
}

.stock-finder-machine-list {
  display: grid;
  gap: 10px;
}

.stock-finder-machine-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 16px rgb(16 39 45 / 5%);
}

.stock-finder-machine-card > summary {
  display: grid;
  grid-template-columns: 18px minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.stock-finder-machine-card > summary::-webkit-details-marker {
  display: none;
}

.stock-finder-machine-card > summary:hover {
  background: #f6fafb;
}

.stock-finder-machine-card > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.stock-finder-machine-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.stock-finder-machine-card[open] .stock-finder-machine-chevron {
  transform: rotate(225deg);
}

.stock-finder-machine-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stock-finder-machine-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-finder-machine-title small {
  color: var(--muted);
}

.stock-finder-machine-count,
.stock-finder-machine-states button,
.machine-part-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf5f6;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-finder-machine-count,
.stock-finder-machine-states button {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.stock-finder-machine-count:hover,
.stock-finder-machine-states button:hover,
.stock-finder-machine-count.active,
.stock-finder-machine-states button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgb(22 103 115 / 12%);
}

.stock-finder-machine-count.active,
.stock-finder-machine-states button.active {
  background: var(--brand);
  color: #fff;
}

.stock-finder-machine-states {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stock-finder-machine-states .is-warning,
.machine-part-status.is-warning {
  background: #fff3d6;
  color: #8a5a00;
}

.machine-part-status {
  gap: 6px;
  background: #e8f7f0;
  color: #08734f;
}

.machine-part-status::before {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #0b8f67;
  color: #fff;
  content: "✓";
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.machine-part-status.is-warning::before {
  background: #d89200;
  content: "↻";
  font-size: 13px;
}

.stock-finder-machine-states .is-warning.active {
  border-color: #a66c00;
  background: #a66c00;
  color: #fff;
}

.stock-finder-machine-content {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid #e5ecef;
  background: #fbfcfd;
}

.stock-finder-machine-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.stock-finder-machine-content .table-wrap {
  border-radius: 8px;
  background: #fff;
}

.stock-finder-machine-content tr[hidden] {
  display: none !important;
}

.stock-finder-part-photo-heading,
.stock-finder-part-photo-cell {
  width: 76px;
  text-align: center;
}

.stock-finder-part-photo {
  display: block;
  width: 52px;
  height: 42px;
  margin: 0 auto;
  border: 1px solid #e4ecef;
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}

.stock-finder-part-photo-button {
  display: block;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.stock-finder-part-photo-button:hover,
.stock-finder-part-photo-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.stock-finder-part-photo-placeholder {
  opacity: 0.78;
}

@media (max-width: 860px) {
  .stock-finder-machine-card > summary {
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }

  .stock-finder-machine-states {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .stock-finder-machine-card > summary {
    grid-template-columns: 16px minmax(0, 1fr);
    padding: 12px;
  }

  .stock-finder-machine-count,
  .stock-finder-machine-states {
    grid-column: 2;
    justify-self: start;
  }

  .stock-finder-machine-title strong {
    white-space: normal;
  }
}

.technical-library {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.technical-model-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.technical-model-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto auto;
  gap: 2px 10px;
  align-items: center;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.technical-model-card:hover,
.technical-model-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.technical-model-card img {
  grid-row: 1 / 4;
  width: 56px;
  height: 62px;
  object-fit: contain;
}

.technical-model-card span,
.technical-model-card small {
  color: var(--muted);
  font-size: 12px;
}

.technical-model-card strong {
  font-size: 17px;
}

.dashboard-model-grid {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-model-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.dashboard-model-card:hover {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.dashboard-model-card img {
  width: 56px;
  height: 62px;
  object-fit: contain;
}

.dashboard-model-card-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-right: 24px;
}

.dashboard-model-card-body span,
.dashboard-model-card-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.dashboard-model-card-body strong {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-model-card-body small {
  overflow-wrap: anywhere;
}

.dashboard-machine-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #11835c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(17, 131, 92, 0.25);
}

.dashboard-recent-cards {
  display: none;
}

.dashboard-rma-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-rma-card-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.dashboard-rma-card-head strong {
  overflow-wrap: anywhere;
}

.dashboard-rma-card h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.dashboard-rma-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.dashboard-rma-card-meta > div {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.dashboard-rma-card-meta small,
.dashboard-rma-card-meta em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.dashboard-rma-card-meta span,
.dashboard-rma-card-meta em {
  overflow-wrap: anywhere;
}

.dashboard-rma-open {
  align-self: end;
  justify-self: end;
}

.dashboard-rma-empty {
  grid-column: 1 / -1;
}

.technical-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(440px, auto);
  gap: 12px;
  align-items: end;
}

.technical-toolbar input {
  min-height: 44px;
  font-size: 16px;
}

.technical-resource-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 6px;
}

.technical-resource-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.technical-library-results {
  min-width: 0;
}

.technical-resource-list {
  display: grid;
  gap: 10px;
}

.technical-resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.technical-resource-card > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.technical-resource-card small {
  color: var(--brand);
  font-weight: 700;
}

.technical-resource-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.resource-choice-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.resource-choice-divider::before,
.resource-choice-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.technical-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfe;
  color: var(--muted);
}

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

.document-list {
  display: grid;
  gap: 7px;
  grid-column: 1 / -1;
}

.document-list a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.document-list a:hover {
  border-color: var(--brand);
}

.document-list span,
.document-list small {
  color: var(--muted);
  font-size: 12px;
}

.exploded-view-title small,
.exploded-hotspot-card small {
  color: var(--muted);
  font-size: 12px;
}

.exploded-view-results {
  display: grid;
  gap: 12px;
}

.exploded-view-card {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.exploded-view-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.exploded-view-card > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  cursor: pointer;
  list-style: none;
}

.exploded-view-card > summary::-webkit-details-marker {
  display: none;
}

.exploded-view-card > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.exploded-view-chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-right: 5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.exploded-view-card[open] .exploded-view-chevron {
  transform: rotate(225deg);
}

.exploded-view-content {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

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

.exploded-view-title {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
}

.exploded-view-title img {
  width: 72px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.exploded-view-title strong {
  display: block;
  font-size: 15px;
}

.exploded-hotspot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.exploded-hotspot-card {
  display: grid;
  grid-template-columns: 34px 54px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.exploded-hotspot-card img {
  width: 54px;
  height: 44px;
  object-fit: contain;
}

.exploded-hotspot-card img.default-image {
  padding: 4px;
}

.hotspot-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.exploded-hotspot-card strong,
.exploded-hotspot-card small {
  display: block;
}

.exploded-hotspot-card .compact-action {
  grid-column: 1 / -1;
}

.responsive-table td > .compact-action {
  display: block;
  margin-top: 6px;
  white-space: nowrap;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfe;
}

.report-metric {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.report-metric span,
.report-card header span,
.compact-list-row small,
.serial-report-row small {
  color: var(--muted);
  font-size: 12px;
}

.report-metric strong {
  font-size: 22px;
}

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

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

.report-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.report-card header {
  display: grid;
  gap: 3px;
}

.report-card-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-card-stats span {
  border-radius: 7px;
  padding: 6px 8px;
  background: #edf6f8;
  color: var(--ink);
  font-size: 12px;
}

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

.compact-list-row,
.serial-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfdfe;
}

.compact-list-row span,
.serial-report-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.serial-list {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

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

.serial-row code {
  overflow-wrap: anywhere;
}

.serial-report-row {
  margin: 0 18px 10px;
}

.machine-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  padding: 0 18px 10px;
}

.module-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
}

.machine-filter-card,
.module-filter-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.machine-filter-card {
  min-height: 116px;
}

.module-filter-card {
  min-height: 64px;
}

.machine-filter-card:hover,
.machine-filter-card.active,
.module-filter-card:hover,
.module-filter-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgb(20 92 104 / 12%);
}

.machine-filter-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 16px;
}

.machine-filter-card span {
  font-size: 13px;
  font-weight: 700;
}

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

.module-filter-card small {
  color: var(--muted);
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
}

.product-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.product-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.product-price-overlay {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 70px);
  border: 1px solid #cfe1e5;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 12px rgb(15 58 68 / 12%);
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.product-cart-button {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #cfe1e5;
  border-radius: 50%;
  padding: 0;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 4px 12px rgb(15 58 68 / 14%);
  color: var(--brand-dark);
  cursor: pointer;
}

.product-cart-button:hover,
.product-cart-button.has-items {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.product-cart-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.product-cart-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0 4px;
  background: #e9a800;
  color: #10272d;
  font-size: 11px;
}

.procurement-cart-icon::before {
  content: "\1F6D2";
  font-size: 17px;
  line-height: 1;
}

.procurement-cart-header-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.procurement-cart-count {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.procurement-cart-header-button:disabled .procurement-cart-count {
  background: #a7b7bc;
}

.product-zoom-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 10px;
  background: transparent;
  cursor: zoom-in;
}

.product-visual img {
  display: block;
  max-width: 78%;
  max-height: 128px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-visual img.default-image {
  max-width: 54%;
  max-height: 96px;
  padding: 0;
  background: #fff;
}

#quickDialog.image-zoom-dialog {
  width: min(92vw, 980px);
}

#quickDialog.image-zoom-dialog form {
  width: 100%;
}

#quickDialog.procurement-cart-dialog {
  width: min(780px, calc(100vw - 28px));
}

#quickDialog.procurement-cart-dialog form {
  width: 100%;
}

.procurement-cart-dialog-content {
  display: grid;
  gap: 14px;
}

.procurement-cart-hint {
  color: var(--muted);
}

.procurement-cart-list {
  display: grid;
  gap: 8px;
  max-height: min(330px, 42vh);
  overflow-y: auto;
  padding-right: 3px;
}

.procurement-cart-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 86px auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  background: #fff;
}

.procurement-cart-row > img {
  display: block;
  width: 70px;
  height: 58px;
  border: 1px solid #e0e9eb;
  border-radius: 7px;
  padding: 5px;
  background: #fff;
  object-fit: contain;
}

.procurement-cart-row > img.default-image {
  padding: 13px;
}

.procurement-cart-product {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.procurement-cart-product span {
  display: -webkit-box;
  overflow: hidden;
  line-height: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.procurement-cart-product small {
  color: var(--brand-dark);
  font-weight: 800;
}

.procurement-cart-quantity {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.procurement-cart-quantity input {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.procurement-cart-remove {
  min-height: 34px;
  padding-inline: 10px;
}

.procurement-cart-fields {
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(260px, 1.15fr);
  gap: 12px;
}

.procurement-cart-fields textarea {
  resize: vertical;
}

.procurement-cart-summary {
  display: grid;
  gap: 8px;
  border: 1px solid #cfe1e5;
  border-radius: 9px;
  padding: 12px;
  background: #f2f8f9;
}

.procurement-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.procurement-cart-total span {
  color: var(--muted);
}

.procurement-cart-total strong {
  color: var(--brand-dark);
  font-size: 20px;
}

.procurement-cart-price-warning {
  color: #8b6200;
  font-size: 13px;
}

.procurement-cart-status {
  border-radius: 8px;
  padding: 10px 12px;
}

.procurement-cart-status.is-pending {
  background: #eef7f8;
  color: var(--brand-dark);
}

.procurement-cart-status.is-error {
  border: 1px solid #efb0aa;
  background: #fff1ef;
  color: #a42519;
}

.procurement-cart-success {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px 16px;
  text-align: center;
}

.procurement-cart-success > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #dff4e9;
  color: #07875e;
  font-size: 30px;
  font-weight: 800;
}

.procurement-cart-success > strong {
  font-size: 18px;
}

.procurement-cart-success > p {
  color: var(--muted);
}

.procurement-cart-success > b {
  color: var(--brand-dark);
  font-size: 24px;
}

.inventory-load-confirmation {
  display: grid;
  gap: 12px;
}

.inventory-load-confirmation-product {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #cfe1e5;
  border-left: 4px solid var(--brand);
  border-radius: 9px;
  padding: 10px;
  background: #f2f8f9;
}

.inventory-load-confirmation-product img {
  display: block;
  width: 92px;
  height: 72px;
  border-radius: 7px;
  padding: 5px;
  background: #fff;
  object-fit: contain;
}

.inventory-load-confirmation-product img.default-image {
  padding: 16px;
}

.inventory-load-confirmation-product > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.inventory-load-confirmation-product small,
.inventory-load-confirmation-grid small,
.inventory-load-confirmation-notes small {
  color: var(--muted);
}

.inventory-load-confirmation-product span {
  overflow-wrap: anywhere;
}

.inventory-load-confirmation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inventory-load-confirmation-grid > div,
.inventory-load-confirmation-notes {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.inventory-load-confirmation-notes p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.message-browser-toolbar {
  position: sticky;
  z-index: 2;
  top: -16px;
  display: grid;
  gap: 9px;
  margin: -4px 0 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  background: #fff;
}

.message-browser-toolbar > label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  font-size: 13px;
  font-weight: 700;
}

.message-browser-toolbar input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.message-number-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 5px;
}

.message-number-tab {
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 34px;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 0;
  font-weight: 800;
}

.message-number-tab.is-unread {
  background: #ffe4a8;
  color: #744d00;
}

.message-number-tab.is-read {
  background: #dff4ea;
  color: #08734f;
}

.message-number-tab.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(17 107 119 / 14%);
}

.message-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  background: #fff;
}

.message-card[hidden] {
  display: none !important;
}

.message-card.is-unread {
  border-left: 4px solid #d69300;
}

.message-card.is-read {
  border-left: 4px solid #15936b;
  background: #fbfdfc;
}

.replenishment-message-card {
  border-left: 4px solid var(--brand);
}

.replenishment-message-card.is-unread {
  border-left-color: #d69300;
}

.replenishment-message-card.is-read {
  border-left-color: #15936b;
}

.message-read-state {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e4f6ed;
  color: #08734f;
  font-size: 12px;
  font-weight: 800;
}

.replenishment-message-card > header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.replenishment-message-card > header > .procurement-cart-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e8f4f6;
}

.replenishment-message-card > header > div {
  display: grid;
  gap: 2px;
}

.replenishment-message-otp-badge {
  margin-left: auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e4f6ed;
  color: #08734f;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.replenishment-message-card > header small,
.replenishment-message-card dt {
  color: var(--muted);
}

.replenishment-message-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.replenishment-message-card dl > div {
  display: grid;
  gap: 2px;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f4f8f9;
}

.replenishment-message-card dl > .replenishment-message-total {
  border: 1px solid #bdd8de;
  background: #eaf5f7;
}

.replenishment-message-total dd {
  color: var(--brand);
  font-size: 18px;
}

.replenishment-message-card dt {
  font-size: 12px;
}

.replenishment-message-card dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.replenishment-message-items {
  display: grid;
  gap: 7px;
}

.replenishment-message-items h4 {
  margin: 0;
  font-size: 13px;
}

.replenishment-message-items ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.replenishment-message-items li {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.replenishment-message-items li span {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.replenishment-message-items li b {
  color: var(--brand);
  white-space: nowrap;
}

.replenishment-message-price {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: end;
  gap: 2px 8px;
  min-width: 120px;
}

.replenishment-message-price small {
  grid-column: 1 / -1;
  color: var(--muted);
  white-space: nowrap;
}

.replenishment-message-price strong {
  color: var(--ink);
  white-space: nowrap;
}

.replenishment-message-price-warning {
  margin: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff6dc;
  color: #855f00;
  font-size: 12px;
}

.replenishment-message-notes {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.image-zoom {
  display: grid;
  gap: 14px;
}

.image-zoom img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.image-zoom img.default-image {
  padding: 48px;
  background: #fff;
}

.image-zoom div {
  display: grid;
  gap: 4px;
}

.image-zoom strong {
  font-size: 18px;
}

.product-body {
  display: grid;
  grid-template-rows: auto 40px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px;
  min-width: 0;
}

.product-code {
  font-weight: 700;
  font-size: 18px;
}

.product-description {
  display: -webkit-box;
  min-width: 0;
  font-size: 16px;
  line-height: 20px;
  min-height: 40px;
  max-height: 40px;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-public-price {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d6e5e8;
  border-radius: 9px;
  padding: 7px 10px;
  background: #f2f8f9;
}

.product-public-price span {
  color: var(--muted);
  font-size: 12px;
}

.product-public-price strong {
  min-width: 0;
  color: var(--brand-dark);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.product-meta {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.product-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f9fbfc;
}

.meta-chip-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f9fbfc;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.meta-chip-button:hover,
.stock-pill-button:hover {
  border-color: var(--brand);
  background: #eef7f8;
}

.product-meta .location-stock-list {
  flex-basis: 100%;
  border-radius: 8px;
  background: #eef7f8;
  color: var(--brand-dark);
}

.stock-pill {
  display: grid;
  gap: 4px;
}

.stock-pill-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.summary-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

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

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

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

.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.compact-table th {
  color: #52627a;
  font-size: 13px;
}

.product-footer {
  display: flex;
  align-self: end;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.product-footer .list-actions {
  margin-left: auto;
  max-width: 100%;
}

.product-footer .list-actions button {
  white-space: nowrap;
}

.check-row > label {
  cursor: pointer;
}

.machine-model {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfc;
}

.machine-model .machine-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #11835c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(17, 131, 92, 0.25);
}

.machine-model img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 14px;
}

.machine-model-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.machine-model span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.machine-model strong {
  display: block;
  font-size: 22px;
}

.machine-model .secondary {
  justify-self: start;
  min-height: 32px;
  margin-top: 4px;
  padding: 0 10px;
}

.return-check-list {
  display: grid;
  gap: 9px;
  max-height: min(46vh, 440px);
  overflow: auto;
  padding-right: 4px;
}

.document-upload-picker {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border: 2px dashed #b8d1d6;
  border-radius: 12px;
  padding: 15px;
  background: #f8fbfc;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.document-upload-picker:hover,
.document-upload-picker.has-file {
  border-color: var(--brand);
  background: #eff9fa;
}

.document-upload-picker > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.document-upload-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  background: #fde9e7;
  color: #a3261c;
  font-size: 12px;
  font-weight: 900;
}

.document-upload-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.document-upload-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-upload-copy em {
  color: #788b91;
  font-size: 10px;
  font-style: normal;
}

.document-upload-button {
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.return-check-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  cursor: pointer;
}

.return-check-row:has(input:checked) {
  border-color: #84c6ad;
  background: #f1faf6;
}

.return-check-row img {
  width: 64px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.return-check-product {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.return-check-row b {
  color: var(--brand);
  font-size: 12px;
}

.return-check-row strong,
.return-check-row small {
  overflow-wrap: anywhere;
}

.return-check-row small {
  color: var(--muted);
}

.return-received-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.return-received-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--ok);
}

.return-check-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.return-item-review {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.return-item-review input {
  grid-column: 1 / -1;
}

.return-review-summary {
  display: grid;
  gap: 8px;
}

.return-review-summary article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  background: #f8fbfc;
}

.return-review-summary img {
  width: 58px;
  height: 48px;
  object-fit: contain;
}

.return-review-summary span {
  display: grid;
  gap: 2px;
}

.return-history-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(230px, auto);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.return-history-card > img {
  width: 82px;
  height: 68px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.return-history-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.return-history-main strong,
.return-history-main p {
  overflow-wrap: anywhere;
}

.return-history-main p {
  margin: 4px 0 0;
  color: var(--muted);
}

.return-history-outcome {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 7px;
}

.return-history-outcome span {
  display: grid;
  gap: 2px;
  border-radius: 7px;
  padding: 7px 9px;
  background: #f1f7f8;
}

.return-history-outcome small,
.return-history-outcome time {
  color: var(--muted);
  font-size: 11px;
}

.return-history-outcome time {
  grid-column: 1 / -1;
  text-align: right;
}

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

.return-review-fields .field:last-child {
  grid-column: 1 / -1;
}

.machine-image-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #edf3f5;
}

.machine-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

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

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

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

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

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

.app-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
  background: #f9fbfc;
}

tbody tr:hover {
  background: #f7fafb;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  background: #eef3f5;
  color: var(--brand-dark);
}

.badge.open {
  background: #fff4df;
  color: var(--warn);
}

.badge.pending {
  background: #eaf0f4;
  color: #52606d;
}

.badge.shipped {
  background: #e7f7f0;
  color: var(--ok);
}

.badge.returned {
  background: #fcebea;
  color: var(--bad);
}

.list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.work-queue {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

.work-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.work-kicker {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3f5;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.work-meta span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.work-meta b {
  color: var(--text);
}

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

.empty-state {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

.technician-part-group {
  display: grid;
  gap: 12px;
}

.technician-part-group + .technician-part-group {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.technician-part-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.technician-part-group header strong {
  font-size: 18px;
}

.technician-part-group header span {
  color: var(--muted);
  font-size: 13px;
}

.part-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.part-mini-card {
  display: grid;
  gap: 9px;
  min-height: 188px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.part-mini-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgb(17 107 119 / 10%);
}

.part-mini-card:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.part-mini-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.part-mini-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 6px;
  background: #f4f7f8;
  padding: 8px;
}

.part-mini-card img.default-image {
  opacity: 0.45;
}

.tmp-code {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef7f8;
  color: var(--brand-dark);
  font-weight: 800;
}

.part-mini-details {
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
}

.part-mini-action {
  align-self: end;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.part-mini-card:disabled .part-mini-action {
  background: #e8eef1;
  color: var(--muted);
}

.our-machine-part-card {
  cursor: default;
}

.our-machine-part-card:hover {
  border-color: var(--line);
  box-shadow: none;
}

.our-machine-part-card .secondary {
  align-self: end;
  width: 100%;
}

.machine-stock-search {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.machine-stock-results {
  display: grid;
  gap: 8px;
}

.machine-stock-result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.machine-stock-result:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgb(17 107 119 / 10%);
}

.machine-stock-result img {
  width: 58px;
  height: 46px;
  object-fit: contain;
  border-radius: 7px;
  background: #f8fbfc;
  padding: 5px;
}

.machine-stock-result span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.machine-stock-result small,
.machine-stock-result em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.our-machine-dashboard-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 22px rgb(16 39 45 / 6%);
}

.our-machine-dashboard-card.has-missing-parts {
  background: #fff0f0;
  border-color: #d64545;
  box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.12);
}

.missing-parts-stat {
  display: grid;
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid #d64545;
  border-radius: 8px;
  background: #fff7f7;
  color: #a61b1b;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.missing-parts-stat:hover,
.missing-parts-stat.is-active {
  background: #ffdede;
  box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.14);
}

.missing-parts-stat:disabled {
  cursor: default;
  opacity: 0.65;
  box-shadow: none;
}

.reintegration-validation {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
}

.reintegration-validation.is-checking { border-color: #d49a23; background: #fff8df; }
.reintegration-validation.is-error { border-color: #d64545; background: #fff0f0; color: #a61b1b; }
.reintegration-validation.is-valid { border-color: #18865b; background: #eefaf2; color: #126444; }
.reintegration-validation span { font-size: 12px; overflow-wrap: anywhere; }

.machine-part-history { display: grid; gap: 8px; }
.machine-part-history article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}
.machine-part-history small { color: var(--muted); }
.machine-part-history p { margin: 2px 0 0; }

.machine-technical-notes {
  display: block;
  margin-top: 5px;
  color: #5f7076;
  font-style: italic;
}

.import-new { background: #eefaf2; }
.import-changed { background: #fff8df; }
.import-unchanged { color: #667085; }
.import-conflict { background: #fff0f0; color: #a61b1b; }

.machine-import-card {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #d7e2e6;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f7fbfc 100%);
  box-shadow: 0 12px 30px rgba(16, 39, 45, 0.08);
}

.machine-import-heading,
.machine-import-actions,
.machine-import-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.machine-import-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.machine-import-heading h3 {
  margin: 3px 0 5px;
  font-size: 1.25rem;
}

.machine-import-heading p,
.machine-import-note {
  margin: 0;
  color: #607078;
}

.machine-import-mapping {
  margin-top: 0;
  padding: 18px;
  border: 1px solid #cfe0e4;
  border-radius: 14px;
  background: #fff;
}

.machine-import-workspace {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid #cfe0e4;
  border-radius: 14px;
  background: #fff;
}

.machine-import-tabs {
  display: flex;
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid #dce7ea;
  background: #f2f7f8;
}

.machine-import-tabs button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #526970;
  font-weight: 700;
}

.machine-import-tabs button.active {
  background: #fff;
  color: #126474;
  box-shadow: 0 2px 8px rgba(16, 39, 45, 0.1);
}

.machine-import-tab-panel { padding: 18px; }
.machine-import-raw-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; color: #607078; }
.machine-import-raw-summary span { padding: 7px 10px; border-radius: 8px; background: #edf4f6; }
.machine-import-raw-summary b { color: #153941; }
.machine-import-raw-table { min-width: max-content; }
.machine-import-raw-table th { position: sticky; top: 0; white-space: nowrap; background: #e8f2f4; }
.machine-import-raw-table td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-import-compare-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.machine-import-mapping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: #607078;
  font-size: 0.82rem;
}

.machine-import-mapping-header strong { display: block; margin-top: 3px; color: #19343b; font-size: 1rem; }
.machine-import-mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.machine-import-mapping-grid label { display: grid; gap: 6px; color: #41565d; font-size: 0.78rem; font-weight: 700; }
.machine-import-mapping-grid select { width: 100%; min-height: 42px; background: #f9fbfc; }

.machine-import-format {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f4f6;
  color: #176573;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.machine-import-actions {
  align-items: end;
  flex-wrap: wrap;
}

.machine-import-file {
  display: grid;
  flex: 1 1 420px;
  gap: 7px;
  color: #344b52;
  font-size: 0.82rem;
  font-weight: 700;
}

.machine-import-file input[type="file"] {
  min-height: 46px;
  padding: 7px;
  border: 1px dashed #9eb8bf;
  border-radius: 10px;
  background: #fff;
}

.machine-import-note {
  margin-top: 12px;
  font-size: 0.82rem;
}

.machine-import-summary {
  margin: 20px 0 14px;
  flex-wrap: wrap;
}

.machine-import-summary button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #edf2f4;
  color: #41565d;
  cursor: pointer;
}

.machine-import-summary b { font-size: 1.05rem; color: #10272d; }
.machine-import-summary .is-new { background: #e7f7ed; }
.machine-import-summary .is-changed { background: #fff3cc; }
.machine-import-summary .is-conflict { background: #ffe5e5; }
.machine-import-summary button:hover { border-color: #88aeb7; }
.machine-import-summary button.active { border-color: #176573; box-shadow: 0 0 0 2px rgba(23, 101, 115, 0.13); }

.machine-import-selection-actions { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; }
.machine-import-selection-actions span { margin-left: auto; color: #607078; font-size: 0.82rem; }
.machine-import-differences { display: grid; gap: 5px; min-width: 320px; white-space: normal; }
.machine-import-differences > div { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(120px, 1fr) auto minmax(120px, 1fr); align-items: center; gap: 7px; }
.machine-import-differences b { color: #334b52; font-size: 0.75rem; }
.machine-import-differences .before { padding: 3px 6px; border-radius: 5px; background: #f3e7e7; color: #7d3b3b; }
.machine-import-differences .after { padding: 3px 6px; border-radius: 5px; background: #e4f4e9; color: #23633b; }
.machine-import-differences .arrow { color: #7f9197; }
.machine-import-table th { white-space: nowrap; }
.import-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.import-status-new { background: #dff5e7; color: #17683a; }
.import-status-changed { background: #ffedb0; color: #725400; }
.import-status-unchanged { background: #e9eef0; color: #52656b; }
.import-status-conflict { background: #ffdada; color: #9b2020; }

@media (max-width: 720px) {
  .machine-import-card { padding: 18px; }
  .machine-import-heading { align-items: flex-start; flex-direction: column; }
  .machine-import-mapping-header { align-items: flex-start; flex-direction: column; }
  .machine-import-actions > button { width: 100%; }
  .machine-import-tabs { overflow-x: auto; }
  .machine-import-tabs button { white-space: nowrap; }
  .machine-import-compare-actions { flex-direction: column; }
  .machine-import-compare-actions button { width: 100%; }
  .machine-import-selection-actions { align-items: stretch; flex-direction: column; }
  .machine-import-selection-actions span { margin-left: 0; }
}

.our-machine-dashboard-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.machine-dashboard-identity {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.machine-dashboard-identity img {
  width: 84px;
  height: 68px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfc;
  padding: 6px;
}

.machine-dashboard-identity > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.our-machine-dashboard-card > header strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.machine-dashboard-identity small {
  color: var(--muted);
  font-size: 12px;
}

.our-machine-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.machine-remove-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.machine-remove-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary.danger {
  border-color: #a61b1b;
  background: #a61b1b;
  color: #fff;
}

.primary.danger:hover {
  background: #851515;
}

.machine-removal-summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbfc;
}

.machine-removal-summary > img {
  width: 92px;
  height: 72px;
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

.machine-removal-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.machine-removal-summary strong {
  font-size: 16px;
}

.machine-removal-summary small,
.machine-removal-summary > div > span {
  color: var(--muted);
}

.machine-removal-counts {
  grid-template-columns: repeat(2, minmax(78px, 1fr));
}

.machine-removal-counts span {
  display: grid;
  border-radius: 8px;
  padding: 8px;
  background: #eaf5f6;
  color: var(--brand-dark);
  font-size: 11px;
}

.machine-removal-counts span.is-warning {
  background: #fff0df;
  color: #8a5200;
}

.machine-removal-counts b {
  font-size: 18px;
}

.machine-removal-warning {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid #f0b7b2;
  border-left: 4px solid #b42318;
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff5f4;
  color: #7a271a;
}

.machine-removal-otp {
  display: grid;
  gap: 6px;
}

.procurement-cart-otp {
  border: 1px solid #e7bd5d;
  border-left: 4px solid #c68a00;
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff8e5;
  color: #684900;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.procurement-cart-otp.is-complete {
  border-color: #79c4a9;
  border-left-color: #07855e;
  background: #eaf8f1;
  color: #075f45;
}

.machine-removal-otp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.machine-removal-otp-row input {
  letter-spacing: .22em;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.machine-removal-otp-status {
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
}

.machine-removal-otp-status[hidden] {
  display: none;
}

.machine-removal-otp-status.is-pending {
  background: #eef3f5;
}

.machine-removal-otp-status.is-success {
  background: #e9f8f0;
  color: #08734f;
}

.machine-removal-otp-status.is-error {
  background: #fff0ef;
  color: #a61b1b;
}

.machine-removal-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  border-radius: 9px;
  padding: 11px 12px;
  background: #f4f7f8;
  cursor: pointer;
}

.machine-removal-confirmation input {
  min-height: 0;
  margin-top: 2px;
}

@media (max-width: 680px) {
  .machine-removal-summary {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .machine-removal-summary > img {
    width: 72px;
    height: 58px;
  }

  .machine-removal-counts {
    grid-column: 1 / -1;
  }

  .machine-removal-otp-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .inventory-transfer-review-product {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .inventory-transfer-review-product .inventory-load-product-photo,
  .inventory-transfer-review-product .inventory-load-product-photo-button {
    width: 72px;
    height: 66px;
  }

  .inventory-transfer-route {
    grid-template-columns: 1fr;
  }

  .inventory-transfer-route-arrow {
    min-height: 20px;
    transform: rotate(90deg);
  }
}

.our-machine-stats span {
  display: grid;
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
}

.our-machine-stats .primary-stat {
  border-color: rgb(20 92 104 / 28%);
  background: #eef7f8;
  color: var(--brand-dark);
}

.our-machine-stats b {
  color: var(--ink);
  font-size: 20px;
}

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

.machine-part-search {
  display: grid;
  gap: 4px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 12px;
}

.machine-part-search input {
  min-height: 34px;
  padding: 7px 10px;
}

.our-machine-part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}

dialog > form {
  display: flex;
  max-height: calc(100vh - 28px);
  flex-direction: column;
}

dialog::backdrop {
  background: rgb(16 39 45 / 55%);
}

dialog header,
dialog footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

dialog header button {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

#dialogBody {
  display: grid;
  min-height: 0;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.custom-keyboard-field {
  position: relative;
  display: grid;
}

.custom-keyboard-field textarea {
  padding-right: 48px;
}

.custom-keyboard-trigger {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  font-size: 20px;
  box-shadow: 0 2px 8px rgb(16 39 45 / 10%);
}

.custom-keyboard-panel {
  width: min(920px, 100%);
  padding: 12px;
  border: 1px solid #b9cbd0;
  border-radius: 14px;
  background: #f7fafb;
  box-shadow: 0 -12px 36px rgb(16 39 45 / 28%);
}

.custom-keyboard-inline {
  width: 100%;
  margin-top: 8px;
  box-shadow: 0 8px 22px rgb(16 39 45 / 14%);
}

.custom-keyboard-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
  border: 0;
}

.custom-keyboard-rows {
  display: grid;
  gap: 6px;
}

.custom-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.custom-keyboard-row button {
  flex: 1 1 0;
  max-width: 72px;
  min-height: 42px;
  border: 1px solid #c7d7db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgb(16 39 45 / 8%);
}

.custom-keyboard-row button:hover,
.custom-keyboard-row button:focus-visible,
.custom-keyboard-row button.active {
  border-color: var(--brand);
  background: #e9f5f6;
}

.custom-keyboard-actions button {
  max-width: 150px;
}

.custom-keyboard-actions .is-space {
  max-width: 320px;
}

.form-static-value {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f7fafb;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.replacement-signature {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafb;
}

.replacement-signature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.replacement-signature-header div,
.saved-signature {
  display: grid;
  gap: 4px;
}

.replacement-signature-header small,
.saved-signature small {
  color: var(--muted);
}

.replacement-signature-pad {
  width: 100%;
  height: 190px;
  border: 1px dashed #8ba4aa;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.saved-signature img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #f9fbfc;
}

.check-row input {
  min-height: auto;
}

.delivery-note-dialog {
  width: min(960px, calc(100vw - 20px));
  height: min(720px, calc(100vh - 20px));
  max-height: calc(100vh - 20px);
  border-radius: 14px;
}

.delivery-note-dialog > form {
  height: 100%;
  max-height: none;
}

.delivery-note-dialog #dialogBody {
  display: block;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0;
  background: #f3f7f8;
}

.delivery-note-wizard {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.delivery-wizard-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.delivery-wizard-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.delivery-wizard-tabs button b {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #e9f0f2;
  color: #52666d;
}

.delivery-wizard-tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--ink);
}

.delivery-wizard-tabs button.active b {
  background: var(--brand);
  color: #fff;
}

.delivery-wizard-panel {
  min-height: 0;
  padding: 18px;
}

.delivery-wizard-panel[hidden] {
  display: none !important;
}

.delivery-rma-picker {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
}

.delivery-picker-heading,
.delivery-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.delivery-picker-heading > div,
.delivery-panel-heading > span:last-child {
  display: grid;
  gap: 3px;
}

.delivery-picker-heading strong,
.delivery-panel-heading strong {
  font-size: 20px;
}

.delivery-picker-heading small,
.delivery-panel-heading small {
  color: var(--muted);
}

.delivery-selected-count {
  display: grid;
  min-width: 78px;
  padding: 8px 13px;
  text-align: center;
}

.delivery-selected-count b {
  font-size: 22px;
  line-height: 1;
}

.delivery-selected-count small {
  font-size: 11px;
}

.delivery-shipping-panel,
.delivery-review-panel {
  overflow-y: auto;
}

.delivery-panel-heading {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.delivery-panel-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: #dff3f0;
  color: var(--brand);
  font-size: 25px;
  font-weight: 800;
}

.delivery-panel-icon svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.delivery-panel-icon.review {
  background: #ddf6e9;
  color: #00885f;
}

.delivery-shipping-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.delivery-shipping-fields > .field:nth-child(1),
.delivery-shipping-fields > .field:nth-child(2),
.delivery-shipping-fields > .field:nth-last-child(2),
.delivery-shipping-fields > .field:last-child {
  grid-column: 1 / -1;
}

.delivery-shipping-pair {
  display: contents;
}

.delivery-shipping-fields textarea {
  min-height: 74px;
}

.delivery-file-input {
  padding: 6px;
  background: #f7fafb;
}

.delivery-file-input::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.delivery-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 2px;
}

.delivery-wizard-actions.split {
  justify-content: space-between;
  margin-top: 14px;
}

.delivery-review-content {
  display: grid;
  gap: 14px;
}

.delivery-review-shipping {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.delivery-review-shipping > span {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.delivery-review-shipping small {
  color: var(--muted);
}

.delivery-review-rmas {
  display: grid;
  gap: 7px;
}

.delivery-review-rmas > span {
  display: grid;
  grid-template-columns: 52px 140px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.delivery-review-rmas img {
  width: 52px;
  height: 42px;
  object-fit: contain;
}

.delivery-rma-selector {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fafb;
}

.delivery-rma-selector > header,
.delivery-rma-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.delivery-rma-selector > header > div {
  display: grid;
  gap: 3px;
}

.delivery-selected-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #dff3f0;
  color: #006b58;
  font-size: 13px;
  font-weight: 700;
}

.delivery-rma-toolbar input {
  flex: 1 1 260px;
  min-width: 0;
}

.delivery-rma-toolbar button {
  flex: 0 0 auto;
}

.delivery-rma-list {
  display: grid;
  gap: 8px;
  max-height: none;
  overflow-y: auto;
  padding-right: 3px;
}

.delivery-rma-row {
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.delivery-rma-row:has(input:checked) {
  border-color: var(--brand);
  background: #ecf8f9;
  box-shadow: inset 3px 0 0 var(--brand);
}

.delivery-rma-row.is-incomplete {
  border-color: #e7c974;
  background: #fff9e9;
  cursor: not-allowed;
}

.delivery-rma-row > input {
  width: 19px;
  min-height: 19px;
}

.delivery-rma-row > img {
  width: 58px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.delivery-rma-main {
  display: grid;
  grid-template-columns: minmax(145px, .7fr) minmax(210px, 1.3fr);
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
}

.delivery-rma-reference,
.delivery-rma-product {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.delivery-rma-reference small,
.delivery-rma-main > small {
  color: var(--muted);
}

.delivery-rma-product span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-rma-main > small,
.delivery-rma-main > em {
  grid-column: 1 / -1;
}

.delivery-rma-main > em {
  color: #8a6200;
  font-size: 12px;
  font-style: normal;
}

.delivery-form-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delivery-form-status.is-error {
  border-color: #efaaa4;
  background: #fff0ee;
  color: #a9281d;
}

.delivery-form-status.is-warning {
  border-color: #e7c974;
  background: #fff7dc;
  color: #795500;
}

.supplier-rma-file-status {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #9fd8cc;
  border-radius: 8px;
  background: #e7f7f3;
  color: #006b58;
  font-weight: 700;
}

.delivery-note-rma-lines {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.delivery-note-rma-lines > span {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) minmax(90px, .45fr) minmax(220px, 1.5fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafb;
}

.delivery-note-rma-lines em {
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}

.delivery-note-rma-lines small {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rma-card-list {
  display: grid;
  gap: 11px;
  padding: 14px;
  background: #f3f7f8;
}

.rma-filter-bar {
  display: flex;
  flex: 1 1 auto;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rma-filter-bar > select {
  min-width: 180px;
}

.rma-status-info-button {
  display: grid;
  width: 37px;
  min-height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--brand);
  border-radius: 50%;
  background: #e7f4f5;
  color: var(--brand);
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.rma-status-info-list {
  display: grid;
  gap: 8px;
}

.rma-status-info-list article {
  display: grid;
  grid-template-columns: minmax(135px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fbfc;
}

.rma-status-info-list article div {
  display: grid;
  gap: 3px;
}

.rma-status-info-list small {
  color: var(--muted);
}

.rma-filter-bar > label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rma-filter-bar input[type="date"] {
  min-width: 134px;
  padding: 7px 9px;
}

.rma-period-actions {
  display: flex;
  gap: 5px;
}

.rma-period-actions button {
  min-height: 37px;
  padding: 7px 9px;
  font-size: 12px;
}

.rma-case-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(16 39 45 / 5%);
}

.rma-case-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f8fbfc, #fff);
}

.rma-card-reference,
.rma-card-product {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.rma-card-reference > span:last-child,
.rma-card-product > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rma-card-reference small,
.rma-card-reference em,
.rma-card-product small,
.rma-card-serials small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rma-card-reference strong {
  font-size: 19px;
}

.rma-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.rma-card-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.rma-card-status small {
  color: var(--muted);
  font-weight: 700;
}

.rma-card-body {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(190px, .9fr) minmax(150px, .75fr);
  gap: 14px;
  padding: 14px;
}

.rma-card-product img {
  width: 76px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
}

.rma-card-product b {
  color: var(--brand);
}

.rma-card-product strong,
.rma-card-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rma-card-serials,
.rma-card-trace {
  display: grid;
  align-content: start;
  gap: 6px;
}

.rma-card-serials > span {
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f1f6f7;
}

.rma-card-serials b {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.rma-card-trace > span {
  color: var(--muted);
  font-size: 12px;
}

.rma-document-count {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eaf4f5;
  color: var(--brand) !important;
  font-weight: 700;
}

.rma-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.rma-card-actions .primary {
  margin-left: auto;
}

@media (max-width: 680px) {
  .delivery-company-settings {
    grid-template-columns: 1fr;
    padding: 0 10px 12px;
  }

  .delivery-company-settings-card .settings-grid {
    grid-template-columns: 1fr;
  }

  .delivery-company-settings-card .field.wide {
    grid-column: 1;
  }

  .delivery-note-dialog {
    width: calc(100vw - 10px);
    height: calc(100vh - 10px);
  }

  .delivery-wizard-tabs {
    padding: 0 5px;
  }

  .delivery-wizard-tabs button {
    gap: 4px;
    font-size: 12px;
  }

  .delivery-wizard-panel {
    padding: 12px;
  }

  .delivery-shipping-fields,
  .delivery-review-shipping {
    grid-template-columns: 1fr;
  }

  .delivery-shipping-fields > .field,
  .delivery-review-shipping > span {
    grid-column: 1;
  }

  .delivery-review-rmas > span {
    grid-template-columns: 45px 1fr;
  }

  .delivery-review-rmas small {
    grid-column: 2;
  }

  .delivery-rma-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .delivery-rma-toolbar input {
    flex-basis: 100%;
  }

  .delivery-rma-main {
    grid-template-columns: 1fr;
  }

  .delivery-rma-main > small,
  .delivery-rma-main > em {
    grid-column: 1;
  }

  .delivery-note-rma-lines > span {
    grid-template-columns: 1fr 1fr;
  }

  .delivery-note-rma-lines small {
    grid-column: 1 / -1;
  }

  .rma-card-list {
    padding: 8px;
  }

  .rma-filter-bar {
    justify-content: stretch;
  }

  .rma-filter-bar > select,
  .rma-filter-bar > label {
    flex: 1 1 100%;
  }

  .rma-filter-bar input[type="date"] {
    width: 100%;
  }

  .rma-period-actions {
    width: 100%;
    overflow-x: auto;
  }

  .rma-case-card > header,
  .rma-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rma-card-status {
    justify-items: start;
  }

  .rma-card-body {
    grid-template-columns: 1fr;
  }

  .rma-card-actions .primary {
    margin-left: 0;
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .rma-card-body {
    grid-template-columns: minmax(260px, 1.4fr) minmax(190px, 1fr);
  }

  .rma-card-trace {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.bom-field {
  gap: 10px;
}

.bom-product-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.bom-module-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-filter-card.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.selected-machine-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.selected-machine-card img {
  width: 64px;
  height: 50px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
  padding: 5px;
}

.selected-machine-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.selected-machine-card small {
  color: var(--muted);
}

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

.bom-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.bom-row {
  display: grid;
  grid-template-columns: 20px 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.bom-row input {
  min-height: auto;
}

.bom-row img {
  width: 52px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.bom-row img.default-image {
  opacity: 0.45;
}

.bom-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

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

.image-upload-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfc;
}

.image-upload-row span {
  font-weight: 700;
}

.custom-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.custom-file-picker .compact-action {
  grid-column: auto;
  flex: 0 0 auto;
}

.custom-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 400 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-upload-row small {
  grid-column: 2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.image-upload-row .compact-action {
  grid-column: 2;
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .stock-finder-model-picker {
    grid-template-columns: 1fr;
  }

  .stock-finder-models,
  .stock-finder-form .field {
    min-width: 0;
  }

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

  .stock-finder-search-button {
    width: 100%;
  }

  .settings-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .settings-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

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

  .protection-integrity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-recent-table-wrap {
    display: none;
  }

  .dashboard-recent-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .dashboard-model-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 14px;
  }

  .dashboard-model-card {
    grid-template-columns: 1fr;
    grid-template-rows: 54px auto;
    justify-items: center;
    gap: 5px;
    min-height: 120px;
    padding: 8px 6px;
    text-align: center;
  }

  .dashboard-model-card img {
    width: min(88px, 100%);
    height: 54px;
  }

  .dashboard-model-card-body {
    justify-items: center;
    gap: 1px;
    width: 100%;
    padding-right: 0;
  }

  .dashboard-model-card-body > span {
    display: none;
  }

  .dashboard-model-card-body strong {
    max-width: 100%;
    font-size: 15px;
  }

  .dashboard-model-card-body small {
    font-size: 10px;
    line-height: 1.2;
  }

  .dashboard-machine-count {
    top: 6px;
    right: 6px;
  }
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 12px 10px;
  }

  .sidebar.menu-open {
    max-height: 100vh;
    overflow-y: auto;
  }

  .brand {
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    padding-right: 300px;
  }

  .brand-toggle {
    cursor: pointer;
  }

  .brand-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    overflow: visible;
    padding-top: 8px;
    padding-bottom: 0;
  }

  .sidebar.menu-open .nav {
    display: grid;
  }

  .sidebar-tools {
    display: none;
    margin-top: 8px;
    padding-top: 4px;
  }

  .sidebar.menu-open .sidebar-tools {
    display: grid;
  }

  .sidebar-options {
    position: fixed;
    right: 12px;
    bottom: 58px;
    left: 12px;
  }

  .nav-group {
    display: grid;
    gap: 6px;
    margin: 0;
  }

  .nav-group-title {
    padding: 10px 12px 0;
    font-size: 10px;
  }

  .nav-item {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    white-space: normal;
  }

  .nav-subitem {
    padding-left: 12px;
  }

  .shell {
    padding: 16px;
    overflow: visible;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
  }

  .topbar > div:first-child {
    grid-column: 1 / -1;
  }

  .header-controls {
    position: fixed;
    top: 14px;
    right: 12px;
    z-index: 4;
    transform: none;
  }

  .top-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .top-actions button {
    width: 100%;
  }

  .panel-header {
    flex-wrap: wrap;
    align-items: center;
  }

  .panel-header input,
  .panel-header .list-actions {
    width: 100%;
  }

  .panel-header .list-actions .primary,
  .panel-header > .primary {
    width: 100%;
  }

  h1 {
    font-size: 28px;
  }

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

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

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

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

  .machine-model {
    grid-template-columns: 110px 1fr;
  }

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

  .module-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .stock-finder-form,
  .stock-finder-models,
  .stock-finder-summary,
  .technical-model-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stock-finder-model-picker {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .technical-toolbar {
    grid-template-columns: 1fr;
  }

  .stock-finder-search-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) and (max-height: 800px) {
  .sidebar {
    padding: 8px 10px 7px;
  }

  .brand {
    gap: 8px;
    margin-bottom: 5px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-mark img {
    width: 25px;
    height: 25px;
  }

  .nav {
    gap: 2px;
    padding-top: 3px;
    font-size: 14px;
  }

  .sidebar.grouped-menu .nav-collapsible {
    gap: 2px;
  }

  .sidebar.grouped-menu .nav-collapsible summary {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .sidebar.grouped-menu .nav-collapsible .nav-group {
    gap: 1px;
    margin-bottom: 1px;
    padding-left: 8px;
  }

  .nav-group {
    gap: 2px;
  }

  .nav-item {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.2;
  }

  .nav-subitem,
  .sidebar.grouped-menu .nav-collapsible .nav-subitem {
    padding-left: 10px;
  }

  .sidebar-tools {
    gap: 3px;
    margin-top: 3px;
    padding-top: 2px;
  }

  #sidebarAppVersion {
    font-size: 11px;
  }

  .custom-keyboard-panel {
    padding: 8px;
  }

  .custom-keyboard-panel header {
    padding-bottom: 6px;
  }

  .custom-keyboard-rows,
  .custom-keyboard-row {
    gap: 4px;
  }

  .custom-keyboard-row button {
    min-height: 34px;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .sidebar {
    padding: 10px;
  }

  .brand {
    margin-bottom: 8px;
    padding-right: 230px;
  }

  .brand > div {
    display: none;
  }

  .shell {
    padding: 12px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .language-picker,
  .language-flags {
    justify-content: flex-end;
  }

  .language-flags {
    gap: 2px;
    padding: 4px;
  }

  .language-flags button {
    min-width: 34px;
    height: 28px;
    padding: 0 6px;
    gap: 4px;
  }

  .flag-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .user-chip {
    width: 30px;
    height: 30px;
    min-height: 30px;
    max-width: 30px;
    padding: 0;
  }

  .user-chip strong {
    display: none;
  }

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

  .machine-grid,
  .workflow,
  .module-filter-grid,
  .inventory-load-form,
  .product-list,
  .stock-finder-form,
  .stock-finder-models,
  .stock-finder-summary,
  .technical-model-grid,
  .technical-resource-tabs,
  .exploded-hotspot-grid {
    grid-template-columns: 1fr;
  }

  .stock-finder-header {
    min-height: 0;
  }

  .stock-finder-model-picker,
  .stock-finder-form {
    padding: 14px;
  }

  .stock-in-simple-form {
    padding: 12px;
  }

  .stock-in-code-step {
    grid-template-columns: 1fr;
  }

  .inventory-transfer-product-preview,
  .inventory-transfer-meta {
    grid-template-columns: 1fr;
  }

  .exploded-view-actions {
    justify-content: flex-start;
  }

  .machine-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 12px;
  }

  .machine-filter-card {
    min-height: 96px;
  }

  .machine-filter-card img {
    padding: 8px;
  }

  .machine-model {
    grid-template-columns: 84px 1fr;
  }

  .machine-model img {
    padding: 8px;
  }

  .panel-header,
  .inventory-load-form,
  .product-filters,
  .module-filter-grid,
  .product-list,
  .machine-grid,
  .dashboard-model-grid,
  .workflow,
  .list,
  .work-queue {
    padding: 12px;
  }

  .dashboard-recent-cards {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

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

  .work-actions button {
    width: 100%;
  }

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

  .stock-finder {
    padding: 12px;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .responsive-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .procurement-cart-header-button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .procurement-cart-row {
    grid-template-columns: 58px minmax(0, 1fr) 76px;
    gap: 9px;
  }

  .procurement-cart-row > img {
    width: 58px;
    height: 52px;
  }

  .procurement-cart-remove {
    grid-column: 2 / -1;
    justify-self: end;
  }

  .procurement-cart-fields {
    grid-template-columns: 1fr;
  }

  .procurement-cart-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .replenishment-message-card dl {
    grid-template-columns: 1fr;
  }

  .replenishment-message-items li {
    grid-template-columns: 1fr auto;
  }

  .replenishment-message-items li span {
    grid-column: 1 / -1;
  }

  .replenishment-message-price {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto auto;
    justify-items: start;
    width: 100%;
  }

  .replenishment-message-price small {
    grid-column: auto;
  }

  .inventory-load-confirmation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .brand {
    padding-right: 205px;
  }

  .language-flags button {
    min-width: 28px;
    padding-inline: 4px;
  }

  .language-flags button strong {
    display: none;
  }

  .replacement-signature-pad {
    height: 160px;
  }
}

.audit-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.audit-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.audit-heading h3,
.audit-heading p {
  margin: 3px 0 0;
}

.audit-heading p {
  color: var(--muted);
}

.audit-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(135px, 1fr)) repeat(2, minmax(120px, .8fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 180px));
  gap: 10px;
}

.audit-summary span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}

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

.audit-table td {
  vertical-align: top;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.audit-table th {
  padding: 8px 10px;
  font-size: 11px;
}

.audit-table td strong {
  font-size: 12px;
}

.audit-table code {
  white-space: nowrap;
  font-size: 11px;
}

.audit-table td small {
  font-size: 11px;
  line-height: 1.25;
}

.audit-outcome {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.audit-outcome.success {
  color: #08785c;
  background: #e4f6ef;
}

.audit-outcome.error {
  color: #b42318;
  background: #feeceb;
}

.product-code-check {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.product-code-check.is-checking {
  color: #52657a;
}

.product-code-check.is-available {
  color: #08785c;
  font-weight: 700;
}

.product-code-check.is-conflict {
  color: #a12b22;
  font-weight: 700;
}

.product-code-check.is-current {
  color: #52657a;
}

.product-code-check .link-button {
  margin-left: 8px;
  color: var(--primary);
  font: inherit;
  text-decoration: underline;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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