.layout-desktop .card-media {
  width: 44%;
  min-width: 200px;
}

body.tight.layout-phone .card-row {
  grid-template-columns: 140px 1fr;
}

body.tight.layout-phone .card-media {
  width: 140px;
  min-width: 140px;
}

body.tight.layout-phone .card-actions {
  padding: 8px 10px;
}

body.tight.layout-phone .qty-control {
  width: 180px;
  height: 48px;
}

body.tight.layout-phone .qc-btn {
  width: 46px;
  font-size: 22px;
}

body.tight.layout-phone .qc-val {
  font-size: 18px;
}

body.tight.layout-phone .action-ok {
  height: 48px;
  font-size: 16px;
}

/* Hide table tab on phone/tablet */
body.layout-phone .tab[data-tab="Table"],
body.layout-tablet .tab[data-tab="Table"] {
  display: none;
}

body.layout-phone #screenTable,
body.layout-tablet #screenTable {
  display: none !important;
}

body.layout-desktop .desktop-only {
  display: inline-flex !important;
}

body.layout-phone #screenAudits.active,
body.layout-tablet #screenAudits.active {
  display: flex !important;
  flex-direction: column;
}

body.layout-phone #screenAudits:not(.active),
body.layout-tablet #screenAudits:not(.active) {
  display: none !important;
}

body.force-table.layout-phone .tab[data-tab="Table"],
body.force-table.layout-tablet .tab[data-tab="Table"] {
  display: flex;
}

body.force-table.layout-phone #screenTable,
body.force-table.layout-tablet #screenTable {
  display: flex !important;
}

@media (max-width: 1100px) {
  .audit-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-flow-arrow {
    height: 24px;
    transform: rotate(90deg);
  }

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

/* PAGES BOTTOM SHEET */
body.sheet-open {
  overflow: hidden;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.sheet-overlay.open {
  display: flex;
}

.sheet-overlay.open .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  margin: 10px auto 6px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 10px;
}

.sheet-title {
  font-weight: 900;
  font-size: 18px;
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
}

.sheet-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.sheet-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sheet-input {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 800;
  background: var(--bg);
  color: var(--text);
}

.sheet-go {
  height: 48px;
  min-width: 72px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 16px;
}

.sheet-go:disabled {
  opacity: 0.5;
  filter: grayscale(0.2);
  cursor: not-allowed;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sheet-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text);
}

.sheet-auto-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sheet-auto-slider {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--border);
  transition: background .2s ease;
}

.sheet-auto-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform .2s ease;
}

.sheet-auto-toggle input:checked+.sheet-auto-slider {
  background: var(--primary);
}

.sheet-auto-toggle input:checked+.sheet-auto-slider::after {
  transform: translateX(20px);
}

.sheet-auto-label {
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
  color: var(--text);
}

body.dark .sheet-auto-slider {
  background: #334155;
}

body.dark .sheet-auto-toggle input:checked+.sheet-auto-slider {
  background: var(--primary);
}

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 128px;
  overflow: auto;
  padding-bottom: 4px;
}

.sheet-active {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: 190px;
  padding-right: 2px;
}

.sheet-chips .chip {
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
}

body.layout-desktop .sheet-overlay {
  padding: 0 0 14px;
}

body.layout-desktop .bottom-sheet {
  border-radius: 22px;
  height: min(60vh, 520px);
  max-height: 520px;
  margin-bottom: 6px;
}