.h-screen-minus-header {
  height: calc(100vh - 57px);
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #374151;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus,
.filter-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.filter-input-sm {
  width: 100%;
  padding: 0.3rem 0.4rem;
  font-size: 0.8125rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #374151;
  outline: none;
  transition: border-color 0.15s;
  text-align: center;
}
.filter-input-sm:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.filter-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.25rem;
}

.chip-label { cursor: pointer; }
.chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: #fff;
  transition: all 0.15s;
  user-select: none;
}
.peer:checked ~ .chip {
  background-color: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.chip:hover { border-color: #9ca3af; }

.filter-group {
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-panel {
  width: 16rem;
  min-width: 16rem;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 0.75rem;
}

.th-cell {
  padding: 0.4rem 0.2rem;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  height: 2rem;
  line-height: 2rem;
  vertical-align: middle;
}
.th-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.th-cell:hover { color: #3b82f6; }

.td-cell {
  padding: 0.2rem 0.15rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.3;
  overflow: hidden;
}

.td-addr {
  text-align: left;
  word-break: break-word;
  white-space: normal;
  line-height: 1.25;
  font-size: 0.65rem;
  padding: 0.2rem 0.25rem;
  min-width: 0;
}

.td-photo {
  padding: 4px;
  min-width: 95px;
}
.thumb-img {
  display: block;
  width: 100%;
  min-width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 2px;
  background: #f3f4f6;
}
.thumb-placeholder {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  font-size: 0.6rem;
  background: #f3f4f6;
  border-radius: 2px;
}

.table-row { transition: background-color 0.1s; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: 1; }

[x-cloak] { display: none !important; }

.mobile-filter-toggle { display: none; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 57px;
  background: rgba(0, 0, 0, 0.3);
  z-index: 39;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 1024px) {
  .sidebar-panel {
    position: fixed;
    top: 57px;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: 18rem;
    min-width: unset;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar-panel.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }
  .mobile-filter-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  .thumb-img { height: 64px; }
  .td-cell { font-size: 0.65rem; padding: 0.2rem 0.15rem; }
  .td-addr { font-size: 0.6rem; }
  .th-cell { font-size: 0.55rem; padding: 0.3rem 0.15rem; }
}

.zoom-control { user-select: none; }
.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  outline: none;
  cursor: pointer;
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d1d5db;
}
.zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d1d5db;
}

#scroll-mirror-bar {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  height: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  z-index: 20;
  cursor: default;
}
#scroll-mirror-inner {
  height: 1px;
}
#scroll-mirror-bar::-webkit-scrollbar { height: 8px; }
#scroll-mirror-bar::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
#scroll-mirror-bar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#scroll-mirror-bar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
