/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --bg: #F8FAFC;
  --panel: #ffffff;
  --line: #E5E7EB;
  --primary: #111111;
  --primary-hover: #2f2f2f;
  --danger: #c83f46;
  --text: #171717;
  --muted: #6f6f6d;
  --link: #1f2933;
  --link-hover: #111827;
  --soft-control: #eeeeed;
  --soft-control-hover: #e4e4e2;
  --focus: #b8c7ff;
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--link-hover);
  --bs-link-color-rgb: 31, 41, 51;
  --bs-link-hover-color-rgb: 17, 24, 39;
  --font-2xs: 0.72rem;
  --font-xs: 0.78rem;
  --font-sm: 0.9rem;
  --font-md: 1rem;
  --font-lg: 1.15rem;
  --font-xl: 1.35rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.75rem;
  --font-page-title: clamp(2rem, 3vw, 3rem);
  --font-table: 0.875rem; /* 14px at the browser default size */
  --font-table-meta: 0.7875rem; /* 12.6px at the browser default size */
}

/* ==========================================================================
   Base
   ========================================================================== */

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

.app-body a:not(.btn),
.app-body .btn-link {
  color: var(--link);
}

.app-body a:not(.btn):hover,
.app-body a:not(.btn):focus,
.app-body .btn-link:hover,
.app-body .btn-link:focus {
  color: var(--link-hover);
}

/* ==========================================================================
   Bootstrap Fallbacks
   ========================================================================== */

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

.card-body {
  padding: 1rem;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d5d5d2;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: #a9a9a5;
  box-shadow: 0 0 0 0.2rem rgba(17, 17, 17, 0.08);
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-hover);
  color: #fff;
}

.btn-light {
  background: var(--soft-control);
  color: var(--text);
}

.btn-light:hover,
.btn-light:focus {
  background: var(--soft-control-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.w-100 {
  width: 100%;
}

.alert {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #a7f3d0;
}

#import-status.status-success {
  color: #166534;
}

#import-status.status-error {
  color: #991b1b;
}

/* ==========================================================================
   App Layout
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (min-width: 992px) {
  .app-shell > .row {
    flex-wrap: nowrap;
  }

  .app-shell > .row > .col-lg-3 {
    flex: 0 0 270px;
    max-width: 270px;
    width: 270px;
  }

  .app-shell > .row > main.col {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 2rem !important;
  }
}

.app-mobilebar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.panel {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
}

/* ==========================================================================
   Filters
   ========================================================================== */

.filter-toolbar {
  position: relative;
  z-index: 10;
  margin-bottom: 1rem;
}

.filter-toolbar:has(.filter-drawer-overlay:only-child) {
  margin-bottom: 0;
}

.filter-toolbar-sticky {
  position: sticky;
  top: 0;
  z-index: 24;
  padding: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 78%, rgba(248, 250, 252, 0) 100%);
}

.filter-toolbar .form-control,
.filter-toolbar .form-select,
.filter-toolbar .btn {
  min-height: 42px;
}

.filter-toolbar-row {
  align-items: stretch;
}

.filter-toolbar-row > [class*="col-"] {
  display: flex;
}

.filter-toolbar-row .form-control,
.filter-toolbar-row .form-select,
.filter-toolbar-row .btn {
  width: 100%;
}

.filter-toolbar [data-filter-drawer-open] {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
}

.filter-toolbar [data-filter-drawer-open]:hover,
.filter-toolbar [data-filter-drawer-open]:focus {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.34);
}

.filter-drawer-overlay[hidden] {
  display: none;
}

.filter-drawer-panel {
  width: min(390px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
}

.filter-drawer-header,
.filter-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.filter-drawer-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.filter-drawer-title {
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 700;
}

.filter-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.card-header {
  border-bottom: 1px solid var(--line);
}

.table > :not(caption) > * > * {
  border-color: var(--line);
}

.panel > .table-responsive > .table {
  border-collapse: separate;
  border-spacing: 0;
}

.app-table,
.library-table {
  font-size: var(--font-table);
}

.app-table-meta {
  font-size: var(--font-table-meta);
  line-height: 1.25;
}

.panel > .table-responsive > .table > thead:first-child > tr:first-child > *:first-child,
.panel > .table-responsive > .table > tbody:first-child > tr:first-child > *:first-child {
  border-top-left-radius: 12px;
}

.panel > .table-responsive > .table > thead:first-child > tr:first-child > *:last-child,
.panel > .table-responsive > .table > tbody:first-child > tr:first-child > *:last-child {
  border-top-right-radius: 12px;
}

.panel > .table-responsive > .table > tbody:last-child > tr:last-child > *:first-child {
  border-bottom-left-radius: 12px;
}

.panel > .table-responsive > .table > tbody:last-child > tr:last-child > *:last-child {
  border-bottom-right-radius: 12px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Media Primitives
   ========================================================================== */

.piece-thumb {
  width: 39px;
  height: 39px;
  object-fit: contain;
  /* border: 1px solid #d8d8d5;*/
  border-radius: 10px;
  background: #fff;
  display: block;
}

.piece-thumb[src*="brickarchitect.com"],
.part-detail-image[src*="brickarchitect.com"],
.library-form-preview-image[src*="brickarchitect.com"] {
  padding: 7px;
  box-sizing: border-box;
}

.piece-thumb--empty {
  color: #6b7280;
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.set-thumb {
  padding: 5px;
  box-sizing: border-box;
}

.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  display: inline-block;
}

.swatch-preview {
  width: 100%;
  height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
}

/* ==========================================================================
   Sets
   ========================================================================== */

.sets-table-wrap {
  max-height: none;
  overflow: visible;
}

.sets-table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f8;
}

.set-theme-link {
  text-decoration: none;
  transition: color 120ms ease;
}

.set-theme-link:hover,
.set-theme-link:focus-visible {
  color: var(--text) !important;
  text-decoration: none;
}

.my-sets-table thead th {
  white-space: nowrap;
  font-weight: 700;
}

.my-sets-table tbody td {
  vertical-align: middle;
}

.my-sets-table-wrap {
  overflow: visible;
}

.my-sets-bulk-bar {
  background: #f8fafc;
}

.set-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.2rem;
  padding: 0.9rem 0.35rem 1rem;
}

.set-detail-grid > div {
  min-width: 0;
}

.my-sets-card-media {
  position: relative;
}

.my-sets-copy-count {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
}

.my-sets-card-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}

.my-sets-manage-actions {
  display: block;
}

.my-sets-manage-actions .btn {
  width: 100%;
}

.my-sets-purchase-detail {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.my-sets-purchase-detail:first-child {
  border-top: 0;
  padding-top: 0;
}

.set-status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: var(--font-xs);
  font-weight: 700;
  margin-right: 0.3rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.set-status-owned {
  background: #d1fae5;
  color: #065f46;
}

.set-status-wishlist {
  background: #fef3c7;
  color: #92400e;
}

/* ==========================================================================
   Row Actions
   ========================================================================== */

.row-actions {
  position: relative;
}

.row-actions > summary {
  list-style: none;
}

.row-actions > summary::-webkit-details-marker {
  display: none;
}

.row-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  min-width: 170px;
  padding: 0.4rem;
  display: grid;
  gap: 0.35rem;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.library-table-responsive {
  overflow: visible;
}

.inventory-table-responsive {
  overflow: visible;
}

.library-table .row-actions-menu {
  z-index: 60;
}

.inventory-table .row-actions-menu {
  z-index: 60;
}

.mobile-part-card {
  border-radius: 14px !important;
}

.inventory-item-anchor {
  scroll-margin-top: 88px;
}

/* ==========================================================================
   Browse Pages
   ========================================================================== */

.browse-topbar {
  background: #fff;
}

.browse-parts-search {
  position: sticky;
  top: 0;
  z-index: 22;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.browse-topbar-title {
  line-height: 1.05;
}

.browse-topbar-actions {
  flex: 0 0 auto;
}

.browse-shell {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1rem;
  align-items: start;
}

.browse-filters {
  position: sticky;
  top: 1rem;
}

.browse-filter-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 0.25rem;
  display: grid;
  gap: 0.25rem;
}

.browse-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.browse-card .card-body {
  display: flex;
  flex-direction: column;
}

.browse-media {
  height: 240px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.browse-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.browse-media-empty {
  color: #6b7280;
  font-size: var(--font-sm);
}

.parts-card-list {
  display: grid;
  gap: 0.85rem;
}

.parts-card {
  padding: 0.65rem;
}

.parts-card-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}

.parts-card-inner {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
}

.parts-card-media .piece-thumb {
  width: 72px;
  height: 72px;
}

.parts-card-title {
  font-size: var(--font-lg);
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
}

.parts-card-qty {
  margin: 0.2rem 0 0;
  font-size: var(--font-md);
  font-weight: 400;
  line-height: 1.3;
}

/* ==========================================================================
   Detail Sheets
   ========================================================================== */

.part-detail-open {
  overflow: hidden;
}

.part-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(248, 250, 252, 0.78);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.part-detail-screen {
  width: min(100%, 760px);
  height: 100%;
  background: #fff;
  border-left: 1px solid #edf1f7;
  border-right: 1px solid #edf1f7;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  animation: detail-sheet-enter 180ms ease-out;
}

@keyframes detail-sheet-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

.part-detail-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.part-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
}

.part-detail-back-icon {
  font-size: var(--font-lg);
}

.part-detail-back-label {
  font-size: var(--font-md);
}

.part-detail-back:hover,
.part-detail-back:focus-visible {
  color: var(--primary);
  outline: none;
}

.part-detail-heading {
  font-size: var(--font-2xl);
  font-weight: 700;
  letter-spacing: 0;
}

.part-detail-content {
  flex: 1;
  overflow: auto;
  padding: 0 1.35rem 1.75rem;
}

.part-detail-hero {
  padding: 1.6rem 0 1.35rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.part-detail-image-wrap {
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.part-detail-image {
  width: min(100%, 240px);
  max-height: 240px;
  object-fit: contain;
}

.part-detail-image-empty {
  color: #6b7280;
}

.part-detail-name {
  margin: 1.05rem 0 0;
  font-size: var(--font-2xl);
  font-weight: 700;
  line-height: 1.2;
}

.part-detail-quantity-block {
  padding: 1.25rem 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.part-detail-label,
.part-detail-section-title {
  color: #6b7280;
  font-size: var(--font-sm);
}

.part-detail-quantity {
  margin-top: 0.35rem;
  font-size: var(--font-3xl);
  font-weight: 700;
}

.part-detail-section {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}

.part-detail-section:last-child {
  border-bottom: 0;
}

.part-detail-group {
  margin-bottom: 1rem;
  font-size: var(--font-md);
  color: #374151;
}

.part-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 0.58rem 0;
}

.part-detail-key {
  color: #6b7280;
  flex: 0 0 auto;
}

.part-detail-value {
  font-weight: 600;
  text-align: right;
  max-width: 56%;
}

.part-detail-color-value {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.part-detail-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.library-detail-screen .part-detail-content {
  padding: 0 1.8rem 1.15rem;
}

.library-detail-screen .part-detail-hero {
  padding: 1.25rem 0 0.95rem;
}

.library-detail-screen .part-detail-image-wrap {
  min-height: 136px;
}

.library-detail-screen .part-detail-image {
  width: min(100%, 154px);
  max-height: 154px;
}

.library-detail-screen .part-detail-name {
  margin-top: 0.65rem;
  font-size: var(--font-xl);
}

.library-detail-screen .part-detail-quantity-block {
  padding: 0.9rem 0;
}

.library-detail-screen .part-detail-label,
.library-detail-screen .part-detail-section-title {
  font-size: var(--font-sm);
}

.library-detail-screen .part-detail-quantity {
  margin-top: 0.25rem;
  font-size: var(--font-3xl);
}

.library-detail-screen .part-detail-section {
  padding: 1rem 0;
}

.library-detail-screen .part-detail-group {
  margin-bottom: 0.75rem;
  font-size: var(--font-md);
  font-weight: 600;
}

.library-detail-screen .part-detail-row {
  padding: 0.42rem 0;
}

.library-detail-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.8rem 1.05rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.05);
}

.library-detail-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.want-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: var(--font-sm);
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  white-space: nowrap;
}

.want-more-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
}

.library-row {
  cursor: pointer;
}

.library-row:hover > * {
  background: #f8fafc;
}

.library-row:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.18);
  outline-offset: -3px;
}

.library-row-menu {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #374151;
  font-size: 0;
  line-height: 1;
}

.library-row-menu::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -7px 0 0 currentColor, 7px 0 0 currentColor;
}

.library-row-menu:hover,
.library-row-menu:focus,
.library-row-menu:focus-visible,
.library-row-menu:active,
.library-row-menu.btn:active {
  border-color: transparent;
  background: transparent;
  color: #111827;
  outline: none;
  box-shadow: none;
}

/* ==========================================================================
   Storage Boxes
   ========================================================================== */

.storage-box-screen {
  width: min(100%, 720px);
}

.storage-box-hero-label {
  color: #6b7280;
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.storage-box-location {
  margin-top: 0.55rem;
  color: #4b5563;
  font-size: var(--font-md);
}

.storage-box-notes {
  margin-top: 0.35rem;
  color: #374151;
}

.storage-box-set-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.storage-box-set-card {
  padding: 0.7rem;
}

.storage-box-set-card-inner {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.storage-box-set-media .piece-thumb {
  width: 72px;
  height: 72px;
}

.storage-box-set-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.storage-box-set-title {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}

.storage-box-set-itemno {
  color: #6b7280;
  font-size: var(--font-sm);
  white-space: nowrap;
}

.storage-box-set-meta {
  margin-top: 0.3rem;
  color: #374151;
  font-weight: 600;
}

.storage-box-set-notes {
  margin-top: 0.35rem;
  color: #6b7280;
  font-size: var(--font-sm);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767.98px) {
  .browse-topbar .container-fluid {
    padding: 0.8rem 0.9rem !important;
    gap: 0.75rem;
  }

  .browse-topbar-title {
    font-size: var(--font-xl) !important;
  }

  .browse-topbar-actions {
    gap: 0.45rem !important;
  }

  .browse-topbar-actions .btn {
    border-radius: 0.55rem;
    padding: 0.45rem 0.58rem;
    font-size: var(--font-sm);
    white-space: nowrap;
  }

  .browse-parts-page {
    padding-top: 1rem !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .browse-parts-heading {
    margin-bottom: 0.75rem !important;
  }

  .browse-parts-heading h1 {
    font-size: var(--font-3xl);
    line-height: 1.05;
  }

  .browse-parts-heading .text-muted {
    font-size: var(--font-sm);
  }

  .browse-parts-search,
  .browse-parts-controls {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    border-radius: 10px !important;
  }

  .browse-parts-search {
    top: 0;
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding: 0.58rem 0.85rem 0.75rem !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
  }

  .filter-toolbar.browse-parts-search,
  .filter-toolbar.browse-parts-controls {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .browse-parts-controls .row {
    row-gap: 0.65rem !important;
  }

  .browse-parts-controls .btn {
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
  }

  .mobile-parts-list {
    padding: 0.5rem;
  }

  .mobile-part-card .piece-thumb {
    width: 56px;
    height: 56px;
  }

  .mobile-part-card .card-body {
    padding: 0.9rem !important;
  }

  .mobile-name {
    font-size: var(--font-md) !important;
    line-height: 1.1;
  }

  .mobile-color {
    font-size: var(--font-sm);
  }

  .mobile-qty {
    font-size: var(--font-md);
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }

  .browse-shell {
    grid-template-columns: 1fr;
  }

  .browse-filters {
    position: static;
  }

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

  .browse-media {
    height: 200px;
  }

  .parts-card {
    padding: 0.38rem;
    border-radius: 10px !important;
  }

  .parts-card-inner {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.6rem;
  }

  .parts-card-media .piece-thumb {
    width: 52px;
    height: 52px;
    border-radius: 9px;
  }

  .parts-card-title {
    font-size: var(--font-md);
    line-height: 1.1;
  }

  .parts-card-qty {
    margin-top: 0.14rem;
    font-size: var(--font-sm);
  }

  #parts-fast-search {
    font-size: var(--font-md);
    padding-top: 0.46rem;
    padding-bottom: 0.46rem;
  }

  .parts-filter-label {
    margin-bottom: 0.2rem;
  }

  .parts-card-list {
    gap: 0.65rem;
  }

  .part-detail-overlay {
    background: #fff;
    backdrop-filter: none;
  }

  .part-detail-screen {
    width: 100%;
    max-width: none;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .part-detail-heading {
    font-size: var(--font-lg);
  }

  .part-detail-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .part-detail-name {
    font-size: var(--font-xl);
  }

  .part-detail-row {
    gap: 0.9rem;
  }

  .part-detail-value {
    max-width: 60%;
  }

  .library-detail-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1rem 1rem;
  }

  .want-more-toggle {
    min-height: 2.25rem;
  }

  .library-detail-footer-actions {
    justify-content: stretch;
  }

  .library-detail-footer-actions .btn,
  .library-detail-footer-actions form,
  .library-detail-footer-actions form .btn {
    width: 100%;
  }

  .library-form-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 0.75rem;
    margin: -1.5rem 0 1rem;
    padding: 0.85rem 1rem;
  }

  .library-form-topbar-left,
  .library-form-topbar-actions {
    justify-self: stretch;
  }

  .library-form-topbar-left .btn,
  .library-form-topbar-actions .btn,
  .library-form-topbar-actions form,
  .library-form-topbar-actions form .btn {
    width: 100%;
  }

  .storage-box-screen {
    width: 100%;
  }

  .storage-box-set-card-inner {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 0.65rem;
  }

  .storage-box-set-media .piece-thumb {
    width: 58px;
    height: 58px;
  }

  .storage-box-set-title-row {
    flex-direction: column;
    gap: 0.2rem;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    min-height: auto;
  }

  .offcanvas.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 0;
    width: min(270px, 86vw);
    overflow-y: auto;
    border-right: 0;
  }

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

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

@media (max-width: 575.98px) {
  .set-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.app-sidebar {
  background: #ffffff;
  color: var(--text);
  border-right: 1px solid var(--line);
  min-width: 270px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-brand {
  padding: 0;
}

.sidebar-brand-inner,
.sidebar-account-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-account-link {
  min-height: 54px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  background: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-account-link:hover,
.sidebar-account-link:focus,
.sidebar-account-link.active {
  color: var(--text);
  background: #f1f1f0;
  border-color: #d7d7d4;
}

.sidebar-brand-image {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 999px;
  background: #f7f7f6;
  border: 1px solid var(--line);
  padding: 0.15rem;
  flex: 0 0 auto;
}

.sidebar-brand-title {
  color: var(--text);
}

.sidebar-section-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
  padding: 0 0.75rem;
}

.sidebar-section {
  padding-bottom: 0.05rem;
}

.sidebar-section-primary {
  background: transparent;
  border: 0;
  border-radius: 16px;
  padding: 0;
  box-shadow: none;
}

.sidebar-section-primary .sidebar-section-label {
  color: var(--muted);
}

.sidebar-section-external {
  padding-top: 0.15rem;
}

.sidebar-link {
  display: block;
  padding: 0.58rem 0.72rem 0.58rem 0.9rem;
  margin: 0 0 0.08rem;
  border-radius: 8px;
  color: #202020;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-link:hover {
  background: #f1f1f0;
  color: var(--text);
}

.sidebar-link.active {
  background: #eeeeed;
  border-left: 0;
  padding-left: 0.9rem;
  color: #111111;
  font-weight: 600;
}

.sidebar-link-primary {
  color: var(--text);
  font-weight: 560;
}

.sidebar-link-secondary {
  color: #202020;
}

.sidebar-link-secondary.active {
  color: #111111;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-bottom: 0.25rem;
  margin-top: auto;
}

.sidebar-footer-text {
  color: var(--muted);
}

.sidebar-footer-strong {
  color: var(--text);
}

/* ==========================================================================
   PAB / Intake Tables
   ========================================================================== */

.intake-content-thumb {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
}

.intake-contents-table > :not(caption) > * > * {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

/* ==========================================================================
   Library Forms
   ========================================================================== */

.library-form-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: -1.5rem 0 1.5rem;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.library-form-topbar-left {
  justify-self: start;
}

.library-form-topbar-left .btn {
  min-width: 5.5rem;
}

.library-form-topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.library-form-page-title {
  margin: 0 0 1.5rem;
  font-size: var(--font-page-title);
  font-weight: 700;
  line-height: 1.05;
}

.library-form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.library-form-preview {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 72px;
  overflow: hidden;
}

.library-form-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.library-form-preview-empty {
  color: #94a3b8;
  font-size: var(--font-xs);
  text-align: center;
  padding: 0.4rem;
  line-height: 1.2;
}

.library-import-textarea {
  min-height: 170px;
}

.import-mode-choice {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.import-mode-choice[hidden] {
  display: none !important;
}

.bulk-import-review {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.bulk-import-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.bulk-import-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bulk-import-table th {
  white-space: nowrap;
}

.bulk-import-table th:nth-child(1),
.bulk-import-table td:nth-child(1) {
  width: 34%;
}

.bulk-import-table th:nth-child(2),
.bulk-import-table td:nth-child(2) {
  width: 8rem;
}

.bulk-import-table th:nth-child(3),
.bulk-import-table td:nth-child(3) {
  width: 6rem;
}

.bulk-import-table th:nth-child(4),
.bulk-import-table td:nth-child(4) {
  width: 7rem;
}

.bulk-import-table th:nth-child(5),
.bulk-import-table td:nth-child(5) {
  width: 22%;
}

.bulk-import-table th:nth-child(6),
.bulk-import-table td:nth-child(6) {
  width: 14rem;
}

.bulk-import-table td {
  vertical-align: middle;
}

.bulk-import-piece-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
}

.bulk-import-manual-fields {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 0.8fr);
  gap: 0.35rem;
  margin-top: 0.35rem;
  max-width: 28rem;
}

.bulk-import-manual-fields input:nth-child(3) {
  grid-column: 1 / -1;
}

.bulk-import-thumb {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  overflow: hidden;
  color: #94a3b8;
  font-size: var(--font-xs);
}

.bulk-import-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bulk-import-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: var(--font-xs);
  font-weight: 700;
  line-height: 1.2;
}

.bulk-import-badge-new {
  background: #e9f8ef;
  color: #166534;
}

.bulk-import-badge-existing {
  background: #fff6df;
  color: #92400e;
}

.bulk-import-qty {
  width: 5.5rem;
}

.bulk-import-on-hand {
  font-weight: 700;
  color: #334155;
}

.bulk-import-table .form-control,
.bulk-import-table .form-select {
  min-height: 2.65rem;
}

.bulk-import-location-combobox {
  min-width: 14rem;
}

.library-stepper {
  display: flex;
  align-items: stretch;
}

.library-stepper-input {
  text-align: center;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.library-stepper-input::-webkit-outer-spin-button,
.library-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.library-stepper-btn {
  flex: 0 0 2.65rem;
  border: 1px solid #dbe4f0;
  background: transparent;
  color: #64748b;
  font-size: var(--font-md);
  font-weight: 600;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.library-stepper-btn:first-child {
  border-radius: 0.75rem 0 0 0.75rem;
}

.library-stepper-btn:last-child {
  border-radius: 0 0.75rem 0.75rem 0;
}

.library-stepper-btn:hover,
.library-stepper-btn:focus-visible {
  color: #334155;
  background: #f8fafc;
  border-color: #cfd8e3;
  box-shadow: none;
}

.library-field-action {
  position: relative;
}

.library-field-action .form-control {
  padding-right: 4.8rem;
}

.library-clear-btn {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  bottom: 0.125rem;
  border: 0;
  border-left: 1px solid #dbe4f0;
  background: transparent;
  color: #64748b;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0 0.85rem;
  line-height: 1;
  border-radius: 0 0.65rem 0.65rem 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.library-clear-btn:hover,
.library-clear-btn:focus-visible {
  color: #334155;
  background: transparent;
  box-shadow: none;
}

/* ==========================================================================
   Library Location Combobox
   ========================================================================== */

.library-location-combobox {
  position: relative;
}

.library-location-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}

.library-location-combobox.opens-up .library-location-menu {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

.library-location-menu.is-floating {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 1200;
}

.library-location-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  color: #1f2937;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: var(--font-sm);
}

.library-location-suggested-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border: 1px solid #f7d28a;
  border-radius: 999px;
  background: #fff7e6;
  color: #b45309;
  flex: 0 0 auto;
  font-size: var(--font-xs);
  line-height: 1;
}

.library-location-suggested-star--secondary {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.library-location-option:hover,
.library-location-option:focus-visible,
.library-location-option.is-active {
  background: #f3f7fb;
  color: #0f172a;
  outline: none;
}

/* ==========================================================================
   Inventory
   ========================================================================== */

.inventory-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
}

.inventory-page-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.inventory-view-toggle {
  display: inline-flex;
  gap: 0;
  padding: 0.25rem;
  margin: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.inventory-view-toggle-btn {
  min-height: 2.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  font-weight: 700;
}

.inventory-view-toggle-btn.is-active {
  background: #111111;
  color: #ffffff;
}

[data-inventory-view-panel][hidden] {
  display: none !important;
}

.inventory-design-more {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: #eef4ff;
  color: #334155;
  font-size: var(--font-xs);
  font-weight: 700;
  white-space: nowrap;
}

.inventory-design-swatches {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
}

.inventory-design-swatch {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid #b8b8b8;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}

.inventory-design-swatch-empty {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 45%, #e5e7eb 45%, #e5e7eb 55%, #ffffff 55%);
}

.inventory-design-color-count {
  margin-left: 0.2rem;
  color: #111827;
  font-weight: 700;
}

.inventory-detail-row {
  cursor: pointer;
}

.inventory-detail-row:hover > * {
  background: #f8fafc;
}

.inventory-detail-row:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.18);
  outline-offset: -3px;
}

.bulk-select-mode .bulk-select-row {
  cursor: cell;
}

.bulk-select-row.is-selected > * {
  background: #eef5ff !important;
}

.mobile-part-card.bulk-select-row.is-selected {
  border-color: #9ec5fe;
  background: #eef5ff;
  box-shadow: inset 4px 0 0 #111111;
}

.inventory-detail-screen .part-detail-content {
  padding-bottom: 0;
}

.inventory-detail-hero {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 1.2rem;
  text-align: left;
}

.inventory-detail-hero .part-detail-image-wrap {
  min-height: 132px;
}

.inventory-detail-hero .part-detail-image {
  width: min(100%, 150px);
  max-height: 150px;
}

.inventory-detail-hero .part-detail-name {
  margin-top: 0;
}

.inventory-detail-reference {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.9rem;
  color: #111827;
  font-size: var(--font-sm);
}

.inventory-detail-variants-section {
  padding-bottom: 0;
}

.inventory-detail-variants {
  max-height: min(46vh, 390px);
  margin: 0.8rem -1.8rem 0;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.inventory-detail-variant-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 4rem minmax(88px, 0.7fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.55rem 1.8rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.inventory-detail-variant-row:hover,
.inventory-detail-variant-row:focus-visible {
  background: #f8fafc;
  color: inherit;
  outline: none;
}

.inventory-detail-variant-image .piece-thumb {
  width: 38px;
  height: 38px;
}

.inventory-detail-variant-color {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-weight: 500;
}

.inventory-detail-variant-color span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-detail-variant-qty {
  justify-self: center;
  min-width: 2.35rem;
  padding: 0.14rem 0.65rem;
  border: 1px solid #dbe7f8;
  border-radius: 999px;
  background: #f7fbff;
  text-align: center;
  font-weight: 700;
}

.inventory-detail-variant-location {
  overflow: hidden;
  color: #111827;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-detail-empty {
  padding: 1rem 1.8rem;
  color: #6b7280;
}

@media (max-width: 575.98px) {
  .inventory-detail-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .inventory-detail-reference {
    justify-items: center;
  }

  .inventory-detail-variant-row {
    grid-template-columns: 44px minmax(0, 1fr) 3.2rem;
  }

  .inventory-detail-variant-location {
    grid-column: 2 / 4;
    justify-self: stretch;
    text-align: left;
  }
}

.inventory-page-header.is-bulk-active .inventory-add-library-btn {
  display: none;
}

.inventory-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.inventory-bulk-copy {
  color: var(--text);
  font-size: var(--font-sm);
}

.bulk-select-col {
  width: 1%;
  white-space: nowrap;
}

.bulk-select-input {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  accent-color: var(--primary);
  border: 1.5px solid #6f6f6d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.bulk-select-input:hover,
.bulk-select-input:focus-visible {
  border-color: #334155;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.10);
}

.inventory-empty-state {
  text-align: center;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.app-modal-open {
  overflow: hidden;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

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

.app-modal-card {
  width: min(100%, 420px);
  border: 1px solid #dbe5f2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
  padding: 1.5rem;
  text-align: center;
}

.app-modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: var(--font-xl);
  font-weight: 700;
}

.app-modal-icon-warning {
  background: #fee2e2;
  color: #b91c1c;
}

.app-modal-title {
  margin: 0;
  color: #111827;
  font-size: var(--font-xl);
  font-weight: 800;
}

.app-modal-copy {
  margin: 0.65rem 0 1.25rem;
  color: #5b6778;
}

.app-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inventory-qty-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.35rem 0.65rem !important;
  border: 1px solid #dbe5f2;
  border-radius: 10px;
  background: #f8fbff;
  color: #1f2937 !important;
  font-weight: 700;
  line-height: 1;
}

.inventory-qty-trigger:hover,
.inventory-qty-trigger:focus-visible {
  background: #eef4ff;
  border-color: #bfd3f6;
  color: #1d4ed8 !important;
}

.inventory-qty-modal-card {
  text-align: left;
}

.inventory-qty-modal-card .app-modal-title {
  text-align: left;
}

.inventory-qty-modal-card .app-modal-copy {
  margin-bottom: 1rem;
  text-align: left;
}

.inventory-qty-location-card {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.65rem 0.8rem;
  margin-bottom: 1rem;
}

.inventory-qty-location-label {
  color: #64748b;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.2rem;
}

.inventory-qty-location-value {
  color: #111827;
  font-size: var(--font-md);
  font-weight: 700;
}

.inventory-qty-location-value.is-empty {
  color: #64748b;
  font-weight: 600;
}

.inventory-qty-modal-card .app-modal-actions {
  justify-content: flex-end;
}

.import-modal {
  width: min(720px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.import-modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.import-modal > form {
  width: 100%;
  margin: 0;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

/* ==========================================================================
   Box Intake Form
   ========================================================================== */

#intake-items-table {
  table-layout: fixed;
  min-width: 920px;
}

#intake-items-table .intake-col-piece {
  width: 34%;
}

#intake-items-table .intake-col-qty {
  width: 90px;
}

#intake-items-table .intake-col-price {
  width: 120px;
}

#intake-items-table .intake-col-location {
  width: 27%;
}

#intake-items-table .intake-col-details {
  width: 130px;
}

#intake-items-table .intake-col-remove {
  width: 105px;
}

#intake-items-table .js-toggle-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

#intake-items-table .js-intake-row-main.is-expanded > td {
  background: #eef5ff;
  border-top-color: #bfdbfe;
  border-bottom-color: #bfdbfe;
}

#intake-items-table .js-intake-row-main.is-expanded > td:first-child {
  box-shadow: inset 3px 0 0 #60a5fa;
}

#intake-items-table .js-intake-row-extra.is-expanded > td {
  background: #f8fbff;
  border-top-color: #dbeafe;
  border-bottom-color: #dbeafe;
}

#intake-items-table .js-intake-row-extra .js-open-row-import {
  font-weight: 600;
}

.build-check-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.build-check-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: block;
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.build-check-stat:hover,
.build-check-stat:focus {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  color: inherit;
  transform: translateY(-1px);
}

.build-check-stat.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.build-check-stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.build-check-stat-value {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.build-check-stat-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.build-check-sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 0.25rem;
  text-decoration: none;
  width: 100%;
}

.build-check-sort-link:hover,
.build-check-sort-link:focus {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.build-check-row-missing td {
  background: #fffafa;
}

.build-check-row-partial td {
  background: #fffbeb;
}

.build-check-row-covered td {
  background: #fff;
}

.build-check-row-covered {
  box-shadow: inset 3px 0 0 #bbf7d0;
}

.build-check-part-cell {
  align-items: flex-start;
  display: flex;
  gap: 0.7rem;
  min-width: 18rem;
}

.build-check-thumb {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 10px;
  display: flex;
  flex: 0 0 39px;
  height: 39px;
  justify-content: center;
  overflow: hidden;
  width: 39px;
}

.build-check-thumb img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.build-check-thumb-empty {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

.build-check-part-copy {
  min-width: 0;
}

.build-check-detail-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: left;
}

@media (max-width: 767.98px) {
  .inventory-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-filter-bar {
    top: 4.1rem;
  }

  .inventory-bulk-bar {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }

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

  .build-check-detail-grid {
    grid-template-columns: 1fr;
  }

}
