.app-shell {
  height: 100vh;
  display: grid;
  /* grid-template-rows: 42px 1fr; */
}

.topbar {
  /* display: flex; */
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  background: #ffffff;
  border-bottom: 1px solid #d8e0e8;
}

.topbar strong {
  margin-right: 12px;
}

.topbar span {
  color: #5d6d7e;
}

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

.workspace {
  min-height: 0;
}

.tree-pane {
  height: 100%;
  min-width: 0;
  overflow: auto;
  background: #f8fafb;
}

#folderTree {
  padding: 8px;
}

.content-pane {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  background: #fff;
}

.content-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid #d8e0e8;
}

.content-toolbar h2 {
  margin: 0 0 2px;
  font-size: 16px;
}

.content-toolbar p {
  margin: 0;
  color: #647586;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(120px, 200px) minmax(200px, 200px) minmax(50px, 80px) minmax(50px, 80px);
  align-items: end;
  gap: 8px;
  padding: 8px 12px;
  /* background: #f8fafb; */
  border-bottom: 1px solid #d8e0e8;
}

.filter-toolbar label {
  /* display: grid;
  gap: 3px; */
}

.filter-toolbar span {
  color: #647586;
  font-size: 12px;
}

.filter-toolbar select {
  width: 100%;
  border: 1px solid #c9d3dd;
  border-radius: 4px;
  min-height: 28px;
  padding: 5px 8px;
  background: #ffffff;
  font: inherit;
}

.model-grid {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  gap: 10px;
}

.model-card {
  display: grid;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #d7e0e8;
  border-radius: 6px;
  padding: 5px;
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 0;
  display: grid;
  place-items: center;
  /* background:
    linear-gradient(45deg, #edf2f5 25%, transparent 25%),
    linear-gradient(-45deg, #edf2f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf2f5 75%),
    linear-gradient(-45deg, transparent 75%, #edf2f5 75%),
    #f8fafb; */
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
  border: 1px solid #d3dde5;
  border-radius: 4px;
  overflow: hidden;
  /* padding: 4px; */
}

.thumb-actions {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 86px));
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  background: rgba(22, 33, 44, 0.68);
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.thumb:hover .thumb-actions,
.thumb:focus-within .thumb-actions {
  opacity: 1;
  pointer-events: auto;
}

.thumb-actions button {
  width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.94);
}

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

.thumb-placeholder {
  color: #456171;
  font-weight: 700;
}

.model-info {
  display: block;
  min-width: 0;
  padding: 0 1px;
  text-align: center;
}

.model-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dl {
  margin: 0;
  display: grid;
  gap: 0;
  border: 1px solid #e3e9ee;
  border-radius: 4px;
  overflow: hidden;
}

dl div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 6px;
  font-size: 12px;
  padding: 4px 6px;
}

dl div:nth-child(odd) {
  background: #f8fafb;
}

dl div:nth-child(even) {
  background: #ffffff;
}

dt {
  color: #6b7b8b;
}

dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #d8e0e8;
  color: #405469;
  white-space: nowrap;
}

.pagination-total,
.pagination-range {
  display: none;
  color: #647586;
  font-size: 12px;
}

.pagination-size {
  width: auto;
  min-height: 28px;
  padding: 4px 26px 4px 8px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  min-width: 28px;
  min-height: 28px;
  padding: 3px 8px;
  border-color: transparent;
  background: #f6f9fb;
}

.pagination-btn:hover:not(:disabled),
.pagination-page.is-active {
  border-color: #1f6f8b;
  background: #eaf4f7;
  color: #1f6f8b;
}

.pagination-page.is-active {
  font-weight: 700;
}

.pagination-ellipsis {
  min-width: 20px;
  color: #8b99a7;
  text-align: center;
}

.pagination-jumper {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #647586;
  font-size: 12px;
}

.pagination-jumper input {
  width: 46px;
  min-height: 28px;
  padding: 4px 6px;
  text-align: center;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: #667789;
}

@media (max-width: 900px) {
  .content-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content-actions {
    justify-content: flex-end;
  }

  .filter-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .keyword-filter {
    /* grid-column: 1 / -1; */
  }

  .pagination {
    flex-wrap: wrap;
  }
}
