.overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  background: var(--color-bg-modal-glass);
  backdrop-filter: var(--bf-glass-lg);
  -webkit-backdrop-filter: var(--bf-glass-lg);
  border: 1px solid var(--color-border-card);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-glass-light);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border-card);
  flex-shrink: 0;
}

.headerLeft {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backBtn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.backBtn:hover {
  color: var(--color-text-primary);
}

.title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.closeBtn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.closeBtn:hover {
  color: var(--color-text-primary);
}

.body {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
}

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.actionBtn {
  padding: 6px 14px;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  color: var(--color-on-primary);
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.15s;
}

.actionBtn:hover {
  filter: brightness(1.15);
}

.actionBtnOutline {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--color-border-card);
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.actionBtnOutline:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.cardThumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-placeholder);
}

.cardInfo {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cardName {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editBtn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px;
  font-size: 12px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.editBtn:hover {
  color: var(--color-text-primary);
}

.inlineEditWrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.inlineInput {
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
}

/* Detail view - asset cards */
.assetGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.assetCard {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-card);
  border-radius: 12px;
  overflow: hidden;
}

.assetDeleteBtn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--color-modal-overlay);
  color: var(--color-on-overlay);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.assetCard:hover .assetDeleteBtn {
  opacity: 1;
}

.addAssetCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--color-border-modal);
  border-radius: 12px;
  cursor: pointer;
  color: var(--color-text-disabled);
  font-size: 12px;
  transition: all 0.2s;
  background: transparent;
  /* match assetThumb height + assetInfo height */
  min-height: 180px;
}

.addAssetCard:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.assetThumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-placeholder);
}

.assetInfo {
  padding: 10px 12px;
}

.assetName {
  font-size: 13px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.statusBadge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

.statusActive {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.statusProcessing {
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.statusFailed {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* Upload view */
.uploadForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.inputLabel {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.textInput {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-card);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.textInput:focus {
  border-color: var(--color-primary);
}

.dropZone {
  border: 2px dashed var(--color-border-card);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropZone:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.dropZoneActive {
  border-color: var(--color-primary);
  background: var(--color-primary-bg-hover);
}

.dropZoneText {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.dropZoneHint {
  font-size: 12px;
  color: var(--color-text-disabled);
}

.dropZoneWarning {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-danger-hover);
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--color-danger-hover-bg);
  border: 1px solid var(--color-danger-hover-border);
  border-radius: 6px;
}

.dropZonePreview {
  max-width: 200px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 8px;
}

.submitBtn {
  padding: 10px 0;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  color: var(--color-on-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s;
}

.submitBtn:hover {
  filter: brightness(1.15);
}

.submitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pageBtn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--color-border-card);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pageBtn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.pageBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pageInfo {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.empty {
  text-align: center;
  padding: 40px 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}
