.admin-body { background: #f2f4f8; font-family: "Segoe UI", Roboto, Arial, sans-serif; }

.admin-topbar {
  display: flex; align-items: center; gap: 24px; padding: 12px 24px;
  background: #111827; color: white;
}
.admin-topbar .topbar-title { font-weight: 700; }
.admin-nav { display: flex; gap: 16px; flex: 1; }
.admin-nav a { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; }
.admin-nav a:hover { color: white; }

.admin-main { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.admin-main-narrow { max-width: 480px; }

.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-header-actions { display: flex; align-items: center; gap: 10px; }

.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid #dde2ea; }

.admin-table {
  width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,0.08);
}
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef0f4; font-size: 0.9rem; }
.admin-table th { background: #f8f9fb; color: #6b7280; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; }

.admin-form { background: white; padding: 20px; border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-form label { font-size: 0.8rem; color: #6b7280; margin-top: 8px; }
.admin-form input, .admin-form select { padding: 10px; border-radius: 8px; border: 1px solid #dde2ea; }

.admin-panel { background: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(16,24,40,0.08); }
.inline-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-fields input, .inline-fields select { padding: 10px; border-radius: 8px; border: 1px solid #dde2ea; flex: 1; min-width: 140px; }

.muted { color: #9ca3af; font-weight: 400; font-size: 0.85rem; }

.widget-flag-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; border-bottom: 1px solid #eef0f4;
}
.widget-flag-row:last-child { border-bottom: none; }
.widget-flag-label { font-size: 0.95rem; color: #111827; }

.code-result {
  position: fixed; top: 16px; right: 16px; background: #111827; color: white; padding: 16px 20px;
  border-radius: 10px; font-size: 1.1rem; z-index: 300;
}

/* --- Catalogue de cartes memoires (categories + notes) --- */
.catalog-category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.catalog-category-title-row { display: flex; align-items: center; gap: 8px; }
.catalog-category-title-row h2 { margin: 0; }
.catalog-category-edit-name-btn {
  border: none; background: transparent; color: #9ca3af; cursor: pointer; padding: 4px; border-radius: 6px;
}
.catalog-category-edit-name-btn:hover { color: #374151; background: #f2f4f8; }
.catalog-category-actions { display: flex; gap: 8px; align-items: center; }

.catalog-notes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.catalog-note-card {
  background: #f8f9fb; border: 1px solid #eef0f4; border-radius: 12px; padding: 12px; cursor: pointer;
  transition: border-color 0.12s ease, transform 0.1s ease;
}
.catalog-note-card:hover { border-color: #2563eb; transform: translateY(-1px); }
.catalog-note-card-type {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  color: #6b7280; margin-bottom: 6px;
}
.catalog-note-card-type svg { width: 12px; height: 12px; }
.catalog-note-card-front { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-note-card-back { font-size: 0.82rem; color: #6b7280; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-note-card-thumbs { display: flex; gap: 6px; margin-top: 8px; }
.catalog-note-card-thumbs img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid #eef0f4; }
.catalog-notes-empty { color: #9ca3af; font-size: 0.85rem; padding: 12px 0; }

.catalog-note-type-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.catalog-note-type-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  border-radius: 10px; border: 1px solid #dde2ea; background: #f8f9fb; color: #6b7280; cursor: pointer;
  font-size: 0.8rem; font-family: inherit;
}
.catalog-note-type-btn svg { width: 20px; height: 20px; }
.catalog-note-type-btn.active { border-color: #2563eb; color: #2563eb; background: white; font-weight: 600; }

.catalog-note-field-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.catalog-note-field-row textarea {
  padding: 10px; border-radius: 8px; border: 1px solid #dde2ea; font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.catalog-note-image-box { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 90px; flex-shrink: 0; }
.catalog-note-image-preview { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid #dde2ea; }
