.resource-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.resource-toolbar h4 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.resource-filter {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.resource-filter .form-group,
.resource-filter .form-row,
.resource-filter .row {
  margin-bottom: 0;
}

.resource-filter label,
.resource-form-panel label {
  margin-bottom: 4px;
}

.resource-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.resource-category-strip .btn {
  border-radius: 6px;
  padding: 0.18rem 0.45rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.resource-card {
  border-radius: 6px;
  height: 100%;
}

.resource-card .card-body {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 0.85rem;
}

.resource-title {
  color: #212529;
  font-size: 0.96rem;
  line-height: 1.35;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.resource-description {
  color: #5f6770;
  display: -webkit-box;
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 2.55em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.resource-meta {
  color: #6c757d;
  font-size: 0.82rem;
}

.resource-meta span {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 2px;
  max-width: 100%;
}

.resource-meta i {
  margin-right: 4px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.resource-empty {
  background: #fff;
  border: 1px dashed #cbd3da;
  border-radius: 6px;
  padding: 32px 12px;
  text-align: center;
}

.resource-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.resource-image-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.resource-image-card a {
  color: inherit;
  text-decoration: none;
}

.resource-image-thumb {
  aspect-ratio: 4 / 3;
  background: #e9ecef;
  display: block;
  overflow: hidden;
  width: 100%;
}

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

.resource-image-body {
  padding: 9px 10px;
}

.resource-image-title {
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  min-height: 2.7em;
  overflow-wrap: anywhere;
}

.resource-detail-header {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.resource-detail-title {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.resource-preview {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  min-height: 300px;
  overflow: hidden;
}

.resource-preview iframe {
  border: 0;
  display: block;
  height: 62vh;
  min-height: 360px;
  width: 100%;
}

.resource-preview-image {
  display: block;
  margin: 0 auto;
  max-height: 72vh;
  max-width: 100%;
}

.resource-description-box {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.resource-form-panel {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
}

.resource-form-panel .form-group {
  margin-bottom: 0.75rem;
}

.resource-form-panel .form-control,
.resource-form-panel .custom-select,
.resource-filter .form-control,
.resource-filter .custom-select {
  height: calc(1.5em + 0.55rem + 2px);
  padding: 0.25rem 0.55rem;
}

.resource-form-panel textarea.form-control {
  height: auto;
  min-height: 88px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.resource-file-name {
  overflow-wrap: anywhere;
}

.category-toggle-form {
  display: inline-block;
  margin: 0;
}

.category-status-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6c757d;
  display: inline-flex;
  font-size: 0.82rem;
  gap: 5px;
  line-height: 1;
  padding: 0;
}

.category-status-toggle:focus {
  outline: 2px solid rgba(0, 123, 255, 0.35);
  outline-offset: 2px;
}

.category-status-track {
  background: #adb5bd;
  border-radius: 999px;
  display: inline-flex;
  height: 16px;
  padding: 2px;
  transition: background-color 0.15s ease;
  width: 30px;
}

.category-status-dot {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: block;
  height: 12px;
  transition: transform 0.15s ease;
  width: 12px;
}

.category-status-toggle.is-active {
  color: #218838;
}

.category-status-toggle.is-active .category-status-track {
  background: #28a745;
}

.category-status-toggle.is-active .category-status-dot {
  transform: translateX(14px);
}

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

  .resource-toolbar .btn {
    width: 100%;
  }
}
