svg.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: -3px;
}

:root {
  --cream: #f4eedf;
  --paper: #fffaf1;
  --paper-deep: #ece4d2;
  --ink: #183b33;
  --forest: #163e34;
  --forest-soft: #245348;
  --moss: #839d6b;
  --orange: #d96e3c;
  --gold: #e3b25c;
  --muted: #746f62;
  --danger: #a84432;
  --line: rgba(24, 59, 51, 0.14);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 6%, rgba(227, 178, 92, 0.12), transparent 24rem),
    var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.sidebar {
  min-height: 100vh;
  padding: 28px 20px 24px;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 85%, rgba(227, 178, 92, 0.11), transparent 15rem),
    var(--forest);
}

.brand {
  padding: 0 9px 26px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 29px;
  height: 31px;
  display: block;
  object-fit: contain;
}

.brand > span:last-child {
  position: relative;
  top: 6px;
}

.mobile-return-top {
  display: none;
}

.product-name {
  width: 100%;
  margin: 0 0 10px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 0;
  border-left: 0;
  border-top: 1px solid rgba(244, 238, 223, 0.13);
  border-bottom: 1px solid rgba(244, 238, 223, 0.13);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.product-name:hover {
  background: rgba(244, 238, 223, 0.06);
}

.product-name:focus-visible,
button.stat-cell:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.product-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 238, 223, 0.4);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--paper);
}

.product-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-name div {
  display: grid;
  gap: 2px;
}

.product-name small {
  color: rgba(244, 238, 223, 0.56);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.product-name strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.dashboard-link {
  min-height: 38px;
  margin: 0 0 12px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(244, 238, 223, 0.18);
  border-radius: 6px;
  color: rgba(244, 238, 223, 0.68);
  font-size: 13px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.dashboard-link:hover {
  color: var(--paper);
  border-color: rgba(244, 238, 223, 0.35);
  background: rgba(244, 238, 223, 0.1);
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-label {
  margin: 18px 12px 7px;
  color: rgba(244, 238, 223, 0.43);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  color: rgba(244, 238, 223, 0.68);
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.nav-item > span:first-child {
  width: 20px;
  font-size: 17px;
  text-align: center;
}

.nav-item > span:first-child svg.icon {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--paper);
  background: rgba(244, 238, 223, 0.1);
}

.nav-item .needs-attention-count {
  margin-left: auto;
}

.sidebar-note {
  margin: auto 4px 0;
  padding: 16px;
  border: 1px solid rgba(244, 238, 223, 0.13);
  border-radius: 8px;
  background: rgba(244, 238, 223, 0.055);
}

.sidebar-note > span {
  color: var(--gold);
  font-size: 17px;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: rgba(244, 238, 223, 0.56);
  font-size: 13px;
  line-height: 1.55;
}

.sidebar-note strong {
  display: block;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 74px;
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 238, 223, 0.91);
  backdrop-filter: blur(10px);
}

.breadcrumb {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb i {
  opacity: 0.4;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.account-actions {
  position: absolute;
  z-index: 30;
  top: 18px;
  right: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--forest);
  background: rgba(131, 157, 107, 0.2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-button {
  padding: 6px 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-button:hover {
  color: var(--ink);
}

.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-trigger {
  min-height: 38px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.72);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.account-menu-trigger span:last-child {
  color: var(--muted);
  transition: transform 160ms ease;
}

#account-menu-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu[open] .account-menu-trigger span:last-child {
  transform: rotate(180deg);
}

.account-menu-panel {
  min-width: 160px;
  padding: 6px;
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 14px 36px rgba(24, 59, 51, 0.18);
}

.account-menu-username {
  margin: 2px 4px 4px;
  padding: 0 7px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.account-menu-panel a,
.account-menu-panel button {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.account-menu-panel a:hover,
.account-menu-panel button:hover {
  background: rgba(24, 59, 51, 0.07);
}

.account-menu-panel button {
  color: var(--danger);
}

.docs-link {
  font-size: 14px;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--forest);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button {
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 7px 18px rgba(22, 62, 52, 0.12);
}

.primary-button:hover {
  background: var(--forest-soft);
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary-button {
  background: transparent;
}

.secondary-button:hover {
  background: rgba(24, 59, 51, 0.06);
}

.content {
  width: min(1230px, calc(100% - 80px));
  margin: 0 auto;
}

.welcome-row {
  padding: 38px 0 28px;
  border-bottom: 1px solid var(--line);
}

.welcome-row .eyebrow {
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 20px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3 {
  font-family: var(--serif);
}

h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.intro {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.stats-grid {
  margin: 18px 0 42px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 250, 241, 0.44);
}

.stat-cell {
  flex: 1;
  min-width: 0;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  font-family: inherit;
  text-align: left;
}

.stat-cell:first-child {
  border-left: none;
}

.stat-cell strong {
  display: inline-block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
  animation: stat-phase-in 700ms ease forwards;
}

.stat-cell:nth-child(1) strong {
  animation-delay: 0ms;
}

.stat-cell:nth-child(2) strong {
  animation-delay: 90ms;
}

.stat-cell:nth-child(3) strong {
  animation-delay: 180ms;
}

@keyframes stat-phase-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button.stat-cell {
  cursor: pointer;
  transition: background 0.15s ease;
}

button.stat-cell:hover {
  background: rgba(24, 59, 51, 0.05);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-figure {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.stat-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.stat-track {
  height: 4px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(24, 59, 51, 0.08);
  overflow: hidden;
}

.stat-track-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.3s ease;
}

.stat-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.stat-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

#stat-needs-attention strong {
  color: var(--danger);
}

#stat-needs-attention.is-clear strong {
  color: var(--ink);
}

#stat-needs-attention.is-clear .stat-note {
  color: var(--moss);
}

.inventory-panel {
  padding-bottom: 90px;
}

.panel-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 45px;
  font-weight: 500;
  line-height: 0.9;
}

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

.search-box {
  width: min(310px, 28vw);
  height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.58);
}

.search-box > span:first-child {
  color: var(--muted);
  font-size: 20px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.search-box:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(24, 59, 51, 0.08);
}

.category-filters {
  min-height: 37px;
  margin-bottom: 22px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  height: 38px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--paper);
  border-color: var(--forest);
  background: var(--forest);
}

.availability-controls {
  margin: -6px 0 22px;
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.availability-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.availability-filters::-webkit-scrollbar {
  display: none;
}

.availability-filter {
  height: 38px;
  padding: 0 13px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.availability-filter i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.availability-filter[data-availability-filter="available"] i {
  background: #4c8b5d;
}

.availability-filter[data-availability-filter="unavailable"] i {
  background: var(--danger);
}

.availability-filter[data-availability-filter="checked_out"] i {
  background: var(--orange);
}

.availability-filter:hover,
.availability-filter.active {
  color: var(--paper);
  border-color: var(--forest);
  background: var(--forest);
}

.sort-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-control select {
  height: 38px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
}

.sort-control select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(24, 59, 51, 0.07);
}

.inventory-grid {
  min-height: 260px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.item-card {
  min-width: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 250, 241, 0.66);
  box-shadow: 0 5px 20px rgba(24, 59, 51, 0.035);
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) translateY(var(--tilt-lift, 0px));
  transition: transform 220ms ease, box-shadow 180ms ease;
}

.item-card.is-new {
  opacity: 0;
  animation: card-phase-in 260ms ease forwards;
}

.item-card:hover {
  --tilt-lift: -4px;
  box-shadow: 0 14px 30px rgba(24, 59, 51, 0.1);
}

.item-card.is-new:nth-child(1) { animation-delay: 0ms; }
.item-card.is-new:nth-child(2) { animation-delay: 25ms; }
.item-card.is-new:nth-child(3) { animation-delay: 50ms; }
.item-card.is-new:nth-child(4) { animation-delay: 75ms; }
.item-card.is-new:nth-child(5) { animation-delay: 100ms; }
.item-card.is-new:nth-child(6) { animation-delay: 125ms; }
.item-card.is-new:nth-child(n + 7) { animation-delay: 150ms; }

@keyframes card-phase-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.item-image {
  height: 174px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(227, 178, 92, 0.22), rgba(131, 157, 107, 0.17)),
    var(--paper-deep);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-placeholder {
  width: 78px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 7px 7px 18px 7px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 5px 6px 0 rgba(24, 59, 51, 0.09);
  font-family: var(--serif);
  font-size: 25px;
  transform: rotate(6deg);
  clip-path: polygon(0 0, 72% 0, 100% 24%, 100% 100%, 0 100%);
}

.category-badge {
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  position: absolute;
  left: 12px;
  top: 12px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.91);
  box-shadow: 0 2px 8px rgba(24, 59, 51, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.category-badge.tint-gold {
  color: var(--ink);
  background: rgba(227, 178, 92, 0.92);
}

.category-badge.tint-moss {
  color: var(--ink);
  background: rgba(131, 157, 107, 0.85);
}

.category-badge.tint-orange {
  color: var(--paper);
  background: rgba(217, 110, 60, 0.9);
}

.category-badge.tint-forest {
  color: var(--paper);
  background: rgba(36, 83, 72, 0.92);
}

.attention-flag {
  width: 26px;
  height: 26px;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--paper);
  background: var(--danger);
  box-shadow: 0 2px 8px rgba(24, 59, 51, 0.15);
  font-size: 12px;
}

.availability-badge {
  padding: 6px 9px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.94);
  box-shadow: 0 2px 8px rgba(24, 59, 51, 0.1);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.availability-badge i,
.availability-panel h3 i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.availability-badge.available i,
.availability-panel.available h3 i {
  background: #4c8b5d;
}

.availability-badge.checked-out i,
.availability-panel.checked-out h3 i {
  background: var(--orange);
}

.availability-badge.unavailable i,
.availability-panel.unavailable h3 i {
  background: var(--danger);
}

.availability-badge.not-held i,
.availability-panel.not-held h3 i {
  background: var(--gold);
}

.availability-badge.checking i,
.availability-panel.checking h3 i {
  background: var(--gold);
  animation: pulse 1s ease-in-out infinite;
}

.item-card-body {
  padding: 18px;
}

.item-card-body h3 {
  margin: 0;
  overflow: hidden;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-card-body > p {
  min-height: 48px;
  margin: 10px 0 20px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-meta {
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.barcode {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parts-count {
  flex: 0 0 auto;
  color: var(--forest);
  font-size: 13px;
  font-weight: 600;
}

.card-open {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.card-open:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: -4px;
}

.loading-state,
.empty-state,
.error-state {
  min-height: 260px;
  padding: 45px 20px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.loading-mark {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(24, 59, 51, 0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-state p {
  margin: 13px 0 0;
  font-family: var(--serif);
  font-size: 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: rgba(227, 178, 92, 0.25);
  font-size: 27px;
}

.empty-state h3,
.error-state h3 {
  margin: 14px 0 4px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 500;
}

.empty-state p,
.error-state p {
  max-width: 390px;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
}

footer {
  min-height: 90px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.item-dialog {
  width: min(720px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(14, 42, 35, 0.3);
}

.item-dialog::backdrop {
  background: rgba(10, 29, 24, 0.65);
  backdrop-filter: blur(3px);
}

.item-dialog form {
  padding: 31px;
}

.dialog-heading {
  margin-bottom: 27px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 38px;
  font-weight: 500;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

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

.icon-button:hover {
  background: rgba(24, 59, 51, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field > label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalogue-import {
  padding: 15px;
  border: 1px solid rgba(24, 59, 51, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
}

.catalogue-import-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.catalogue-import-row input {
  min-width: 0;
  flex: 1;
}

.catalogue-import-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
}

.field-help.success {
  color: var(--forest);
  font-weight: 700;
}

.field-help.error {
  color: var(--danger);
}

.field b {
  color: var(--orange);
}

.field small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field textarea,
.field select,
.input-prefix {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  color: var(--ink);
  background: rgba(244, 238, 223, 0.38);
  font-size: 15px;
}

.field input {
  height: 47px;
  padding: 0 14px;
}

.field select {
  height: 47px;
  padding: 0 14px;
}

.field textarea {
  padding: 11px 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.input-prefix:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(24, 59, 51, 0.07);
}

.input-prefix {
  height: 43px;
  display: flex;
  align-items: center;
}

.input-prefix span {
  padding-left: 12px;
  color: var(--muted);
}

.input-prefix input {
  min-width: 0;
  padding-left: 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.form-error {
  min-height: 18px;
  margin: 13px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.dialog-actions {
  padding-top: 17px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.text-button {
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.suggestion-intro {
  margin: -12px 0 23px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.suggestions-dialog {
  width: min(920px, calc(100% - 30px));
}

.suggestions-shell {
  padding: 31px;
}

.suggestions-layout {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.suggestions-list {
  max-height: 480px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(244, 238, 223, 0.36);
}

.suggestions-list .loading-state {
  min-height: 390px;
  border: 0;
}

.suggestion-row {
  width: 100%;
  padding: 13px 14px;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggestion-row:hover,
.suggestion-row.active {
  border-color: var(--line);
  background: var(--paper);
}

.suggestion-row:focus-visible {
  outline: 3px solid rgba(217, 110, 60, 0.32);
  outline-offset: 1px;
}

.suggestion-row strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-detail {
  min-width: 0;
  padding: 27px;
  overflow-y: auto;
}

.suggestion-detail-empty,
.suggestions-empty {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.suggestion-detail-empty span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: rgba(227, 178, 92, 0.24);
  font-size: 23px;
}

.suggestion-detail-empty p,
.suggestions-empty span {
  margin: 0;
  font-size: 13px;
}

.suggestions-empty {
  min-height: 390px;
}

.suggestions-empty strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.suggestion-record h3 {
  margin: 3px 0 22px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.05;
}

.suggestion-record dl {
  margin: 0;
  display: grid;
  gap: 17px;
}

.suggestion-record dl > div {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.suggestion-record dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suggestion-record dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.suggestion-record dd a {
  color: var(--forest-soft);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.delete-suggestion {
  margin-top: 24px;
  padding: 9px 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(14, 42, 35, 0.36);
}

.auth-dialog::backdrop {
  background: rgba(10, 29, 24, 0.78);
  backdrop-filter: blur(5px);
}

.auth-dialog form {
  padding: 34px;
  display: grid;
  gap: 17px;
}

.auth-dialog .dialog-heading {
  margin-bottom: 0;
}

.auth-dialog h2 {
  margin: -6px 0 0;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.05;
}

.auth-dialog .dialog-heading h2 {
  margin: 0;
  font-size: 34px;
}

.auth-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--paper);
}

.auth-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-intro {
  margin: -7px 0 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-dialog .form-error {
  margin: -3px 0;
}

.auth-submit {
  width: 100%;
}
.auth-dialog-footer { margin-top: 1px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.auth-dialog-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.auth-dialog-footer p a { color: var(--forest); font-weight: 700; }
.auth-dialog-links { margin-top: 7px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 11px; }
.auth-dialog-links a { color: inherit; transition: color 160ms ease; }
.auth-dialog-links a:hover { color: var(--forest); }

.drawer-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(10, 29, 24, 0.72);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
}

.item-drawer {
  width: min(980px, calc(100% - 56px));
  height: min(760px, calc(100vh - 56px));
  position: fixed;
  z-index: 31;
  left: 50%;
  top: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 241, 0.35);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(8, 28, 22, 0.42);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 25px)) scale(0.98);
  pointer-events: none;
  transition: transform 240ms ease, opacity 200ms ease;
}

.item-drawer.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.drawer-inner {
  min-height: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 335px minmax(0, 1fr);
}

.drawer-hero {
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(227, 178, 92, 0.26), rgba(131, 157, 107, 0.17)),
    var(--paper-deep);
}

.drawer-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-close {
  position: absolute;
  z-index: 2;
  right: 19px;
  top: 19px;
  background: rgba(255, 250, 241, 0.92);
}

.drawer-body {
  padding: 35px 37px;
  overflow-y: auto;
}

.drawer-category {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.drawer-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.drawer-title-row h2 {
  margin: 0;
  font-size: 39px;
  font-weight: 500;
  line-height: 1;
}

.drawer-price {
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 20px;
}

.drawer-description {
  margin: 15px 0 23px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.availability-panel {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 7px;
  background: rgba(255, 250, 241, 0.72);
}

.availability-panel.available {
  border-left-color: #4c8b5d;
}

.availability-panel.unavailable {
  border-left-color: var(--danger);
}

.availability-panel.checked-out {
  border-left-color: var(--orange);
}

.availability-panel.not-held {
  border-left-color: var(--gold);
}

.availability-heading,
.availability-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.availability-panel .drawer-category {
  margin-bottom: 5px;
}

.availability-panel h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 17px;
}

.availability-panel > p {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.availability-panel button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.availability-panel button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.availability-footer {
  color: var(--muted);
  font-size: 12px;
}

.availability-footer a {
  color: var(--orange);
  font-weight: 700;
}

.availability-panel small {
  margin-top: 10px;
  display: block;
  color: var(--danger);
  font-size: 12px;
}

.detail-list {
  margin: 0 0 27px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
}

.detail-list div {
  padding: 15px;
  display: grid;
  gap: 3px;
  background: var(--paper);
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.detail-list a {
  color: var(--orange);
}

.maintenance-section {
  margin: 28px 0 0;
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
}

.activity-section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.activity-export-link {
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.activity-export-link:hover {
  text-decoration: underline;
}

.activity-timeline {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.activity-event {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 18px;
}

.activity-event:not(:last-child)::before {
  content: "";
  width: 1px;
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 5px;
  background: var(--line);
}

.activity-event-mark {
  width: 11px;
  height: 11px;
  margin-top: 4px;
  z-index: 1;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 1px var(--moss);
}

.activity-event-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.activity-event-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.activity-event-heading time,
.activity-event small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.activity-event p {
  margin: 4px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.maintenance-new,
.maintenance-update-form > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--forest);
  border-radius: 5px;
  color: var(--paper);
  background: var(--forest);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.maintenance-intro {
  margin: 9px 0 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.maintenance-cases {
  display: grid;
  gap: 13px;
}

.maintenance-case {
  padding: 17px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 7px;
  background: rgba(255, 250, 241, 0.72);
}

.maintenance-case.waiting_for_part {
  border-left-color: var(--gold);
}

.maintenance-case.in_repair {
  border-left-color: var(--danger);
}

.maintenance-case.resolved,
.maintenance-case.cancelled {
  border-left-color: var(--moss);
}

.maintenance-case-heading,
.maintenance-event-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.maintenance-case-heading h4 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 22px;
}

.maintenance-case-heading > small,
.maintenance-case > small,
.maintenance-event small {
  color: var(--muted);
  font-size: 11px;
}

.maintenance-case > p {
  margin: 11px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.maintenance-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--forest);
  background: rgba(131, 157, 107, 0.16);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maintenance-timeline {
  margin: 17px 0;
  padding: 0;
  display: grid;
  gap: 0;
  list-style: none;
}

.maintenance-event {
  min-height: 54px;
  position: relative;
  padding: 0 0 16px 22px;
}

.maintenance-event:not(:last-child)::before {
  width: 1px;
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 0;
  content: "";
  background: var(--line);
}

.maintenance-event-mark {
  width: 11px;
  height: 11px;
  position: absolute;
  left: 0;
  top: 4px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 1px var(--moss);
}

.maintenance-event-heading strong {
  font-size: 13px;
}

.maintenance-event-heading time {
  color: var(--muted);
  font-size: 10px;
}

.maintenance-event p {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.5;
}

.maintenance-event a,
.maintenance-event small {
  margin-top: 4px;
  display: block;
}

.maintenance-event a {
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
}

.maintenance-update-form {
  margin-top: 15px;
  padding-top: 15px;
  display: grid;
  gap: 11px;
  border-top: 1px solid var(--line);
}

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

.maintenance-part-details {
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.maintenance-part-details summary {
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.maintenance-part-details[open] summary {
  margin-bottom: 11px;
}

.maintenance-order-url {
  grid-column: 1 / -1;
}

.maintenance-empty,
.maintenance-empty-state {
  color: var(--muted);
  font-size: 12px;
}

.maintenance-empty-state {
  min-height: 90px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  text-align: center;
}

.maintenance-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.needs-attention-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--paper);
  background: var(--danger);
  font-size: 11px;
  font-weight: 800;
}

#needs-attention-dialog > div {
  padding: 31px;
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}

.needs-attention-content {
  display: grid;
  gap: 22px;
}

.needs-attention-group h3 {
  margin: 0 0 11px;
  font-family: var(--serif);
  font-size: 19px;
}

.needs-attention-list {
  display: grid;
  gap: 13px;
}

.needs-attention-row {
  width: 100%;
  padding: 17px;
  display: block;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 7px;
  background: rgba(255, 250, 241, 0.72);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.needs-attention-row:hover {
  background: rgba(255, 250, 241, 1);
}

.needs-attention-row.waiting_for_part {
  border-left-color: var(--gold);
}

.needs-attention-row.in_repair {
  border-left-color: var(--danger);
}

.needs-attention-row.missing-component {
  border-left-color: var(--danger);
}

.needs-attention-row.unavailable-flag {
  border-left-color: var(--danger);
  background: rgba(255, 250, 241, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: default;
}

.needs-attention-row-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.needs-attention-row-heading h4 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 18px;
}

.needs-attention-row-heading > small,
.needs-attention-row > small {
  color: var(--muted);
  font-size: 11px;
}

.needs-attention-log-issue {
  padding: 8px 13px;
  flex: 0 0 auto;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--forest);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.needs-attention-log-issue:hover {
  color: var(--paper);
  background: var(--forest);
}

.components-section {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
}

.section-title-row > div {
  display: grid;
}

.section-title-row .drawer-category {
  margin-bottom: 4px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
}

.reset-checklist {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.checklist-status {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checklist-status div {
  display: grid;
  gap: 2px;
}

.checklist-status strong {
  font-size: 14px;
}

.checklist-status span {
  color: var(--muted);
  font-size: 12px;
}

.checklist-status > b {
  color: var(--orange);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.checklist-track {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 59, 51, 0.1);
}

.checklist-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--moss);
  transition: width 180ms ease;
}

.physical-manual-row {
  margin: 17px 0 0;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(244, 238, 223, 0.27);
}

.physical-manual-row.checked {
  border-color: var(--moss);
  background: rgba(131, 157, 107, 0.1);
}

.physical-manual-row.missing {
  border-color: var(--danger);
  background: rgba(196, 84, 66, 0.08);
}

.physical-manual-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.physical-manual-check input {
  accent-color: var(--forest);
}

.physical-manual-status {
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.physical-manual-action {
  padding: 6px 12px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--forest);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.physical-manual-action:hover {
  color: var(--paper);
  background: var(--forest);
}

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

.component-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: rgba(244, 238, 223, 0.27);
  transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.component-card.checked {
  border-color: var(--moss);
  background: rgba(131, 157, 107, 0.1);
}

.component-card.missing {
  border-color: var(--danger);
  background: rgba(196, 84, 66, 0.08);
}

.component-card.missing-ignored {
  border-style: dashed;
}

.component-visual {
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(227, 178, 92, 0.17), rgba(131, 157, 107, 0.15)),
    var(--paper-deep);
  cursor: pointer;
}

.component-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.component-placeholder {
  width: 52px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 5px 5px 13px 5px;
  background: var(--gold);
  box-shadow: 4px 4px 0 rgba(24, 59, 51, 0.1);
  font-family: var(--serif);
  font-size: 17px;
  transform: rotate(5deg);
}

.component-visual input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
}

.component-check {
  width: 31px;
  height: 31px;
  position: absolute;
  right: 9px;
  top: 9px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 250, 241, 0.9);
  border-radius: 50%;
  color: transparent;
  background: rgba(24, 59, 51, 0.44);
  box-shadow: 0 2px 10px rgba(24, 59, 51, 0.18);
  font-size: 13px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.component-card.checked .component-check {
  color: var(--paper);
  background: var(--moss);
  transform: scale(1.05);
}

.component-info {
  min-height: 82px;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
}

.component-info > div {
  min-width: 0;
  display: grid;
}

.component-info strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-info small {
  color: var(--muted);
  font-size: 12px;
}

.component-info p {
  margin: 3px 0 0;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.component-photo-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 5px;
}

.component-photo-actions input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
}

.component-photo-actions label,
.component-photo-actions button {
  padding: 0;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.component-photo-actions button {
  color: var(--muted);
}

.component-photo-actions label:hover,
.component-photo-actions button:hover {
  text-decoration: underline;
}

.remove-component {
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.remove-component svg.icon {
  width: 14px;
  height: 14px;
}

.remove-component:hover {
  color: var(--danger);
}

.report-missing-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  grid-column: 1 / -1;
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.report-missing-button svg.icon {
  width: 12px;
  height: 12px;
}

.report-missing-button:hover {
  text-decoration: underline;
}

.report-missing-button:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}

.missing-report-status {
  grid-column: 1 / -1;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(196, 84, 66, 0.3);
  border-radius: 6px;
  background: rgba(196, 84, 66, 0.07);
}

.missing-badge {
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.missing-report-status p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.missing-report-status small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.missing-report-actions {
  display: flex;
  gap: 10px;
  margin-top: 7px;
}

.missing-report-actions button {
  padding: 5px 10px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--forest);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.missing-report-actions button:hover {
  color: var(--paper);
  background: var(--forest);
}

.missing-report-actions button[data-resolution="ignored"] {
  border-color: var(--muted);
  color: var(--muted);
}

.missing-report-actions button[data-resolution="ignored"]:hover {
  color: var(--paper);
  background: var(--muted);
}

.missing-ignored-note {
  grid-column: 1 / -1;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: rgba(116, 111, 98, 0.06);
}

.missing-ignored-badge {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.missing-ignored-note p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.missing-ignored-note small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.missing-ignored-clear {
  margin-top: 6px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.missing-ignored-clear:hover {
  text-decoration: underline;
}

.component-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.component-form {
  display: grid;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(244, 238, 223, 0.3);
}

.component-form > p {
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: 700;
}

.component-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 7px;
}

.component-form-grid > input {
  min-width: 0;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: rgba(244, 238, 223, 0.43);
  font-size: 13px;
}

.component-form-grid > input:focus {
  border-color: var(--forest);
}

.component-form-grid .component-url-input,
.component-form-grid .component-note-input {
  grid-column: 1 / -1;
}

.component-photo-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: rgba(255, 250, 241, 0.55);
}

.component-photo-picker > input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
}

.component-photo-picker > label {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--forest);
  border-radius: 5px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.component-photo-picker > small {
  color: var(--muted);
  font-size: 11px;
}

.component-photo-preview {
  grid-column: 1 / -1;
  height: 150px;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--paper-deep);
}

.component-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.component-photo-preview button {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  border-radius: 50%;
  color: var(--paper);
  background: rgba(24, 59, 51, 0.78);
  cursor: pointer;
}

.component-photo-preview button svg.icon {
  width: 16px;
  height: 16px;
}

.component-photo-picker details {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.component-photo-picker summary {
  cursor: pointer;
}

.component-photo-picker details input {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: rgba(244, 238, 223, 0.43);
}

.component-photo-picker details input:focus {
  border-color: var(--forest);
}

.optional-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.optional-check input {
  accent-color: var(--forest);
}

.component-form-grid button {
  padding: 0 12px;
  border: 1px solid var(--forest);
  border-radius: 5px;
  color: var(--paper);
  background: var(--forest);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.drawer-actions {
  margin-top: 28px;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
}

.drawer-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.edit-item {
  margin-left: auto;
  color: var(--paper);
  background: var(--forest) !important;
}

.delete-item {
  color: var(--danger);
}

.permanent-delete-item {
  color: var(--danger);
}

.restore-item {
  color: var(--forest);
  background: rgba(131, 157, 107, 0.18) !important;
}

.mark-unavailable-item {
  color: #694c13;
  background: rgba(218, 170, 86, 0.18) !important;
}

.removal-reason-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #6f6659;
  border-radius: 6px;
  background: var(--cream);
}

.removal-reason-panel p { margin: 0; }

.unavailable-reason-panel {
  border-left-color: var(--gold);
}

.unavailable-reason-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  max-width: min(370px, calc(100% - 30px));
  padding: 12px 17px;
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 8px 30px rgba(14, 42, 35, 0.25);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .sidebar {
    padding: 26px 12px 20px;
  }

  .brand {
    padding: 0 16px 25px;
  }

  .brand > span:last-child,
  .product-name div,
  .dashboard-link > span:nth-child(2),
  .nav-item > span:nth-child(2),
  .nav-item .needs-attention-count,
  .nav-label,
  .sidebar-note {
    display: none;
  }

  .product-name {
    padding: 14px 10px;
    justify-content: center;
  }

  .dashboard-link {
    padding: 0;
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
  }

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

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: 62px;
    height: 62px;
    padding: 0 17px;
    position: sticky;
    z-index: 20;
    flex-direction: row;
    align-items: center;
  }

  .brand {
    padding: 0;
  }

  .dashboard-link {
    display: none;
  }

  .brand > span:last-child {
    display: inline;
  }

  .product-name,
  .sidebar nav,
  .sidebar-note {
    display: none;
  }

  .topbar {
    height: 0;
    padding: 0;
    border: 0;
  }

  .breadcrumb {
    display: none;
  }

  .topbar-actions {
    width: 0;
  }

  .account-actions {
    position: fixed;
    z-index: 30;
    top: 12px;
    right: 17px;
  }

  .role-badge {
    display: none;
  }

  #account-menu-name {
    max-width: 105px;
  }

  .content {
    width: calc(100% - 36px);
  }

  .welcome-row {
    padding: 28px 0 22px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 42px);
  }

  .stats-grid {
    margin: 14px 0 38px;
    flex-direction: column;
  }

  .stat-cell {
    padding: 16px 18px;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .stat-cell:first-child {
    border-top: none;
  }

  .panel-heading {
    align-items: start;
    flex-direction: column;
  }

  .panel-controls {
    width: 100%;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  .panel-controls .secondary-button {
    font-size: 0;
  }

  .panel-controls .secondary-button span {
    font-size: 18px;
  }

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

  footer {
    min-height: 108px;
    padding: 18px;
    gap: 14px;
  }

  footer > span:last-of-type {
    display: none;
  }

  .mobile-return-top {
    min-height: 42px;
    margin-left: auto;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--forest);
    border-radius: 999px;
    color: var(--paper);
    background: var(--forest);
    font-size: 13px;
    font-weight: 700;
  }

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

  .catalogue-import-row {
    flex-direction: column;
  }

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

  .sort-control {
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
  }

  .field-wide {
    grid-column: auto;
  }

  .item-dialog form {
    padding: 23px 19px;
  }

  .dialog-heading h2 {
    font-size: 32px;
  }

  .suggestions-shell {
    padding: 23px 19px;
  }

  .suggestions-layout {
    min-height: 0;
    display: block;
  }

  .suggestions-list {
    max-height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .suggestions-list .loading-state,
  .suggestions-empty {
    min-height: 170px;
  }

  .suggestion-detail {
    min-height: 270px;
    padding: 21px 17px;
  }

  .item-drawer {
    width: calc(100% - 18px);
    height: calc(100vh - 18px);
  }

  .drawer-inner {
    display: block;
    overflow-y: auto;
  }

  .drawer-hero {
    height: 220px;
  }

  .drawer-body {
    padding: 25px 20px;
    overflow: visible;
  }

  .component-list {
    grid-template-columns: 1fr;
  }

  .maintenance-update-grid {
    grid-template-columns: 1fr;
  }

  .maintenance-order-url {
    grid-column: auto;
  }
}

@media (max-width: 380px) {
  .brand > span:last-child {
    display: none;
  }
}

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