:root {
  --admin-primary: #34383C;
  --admin-accent: #E3000F;
  --admin-bg: #F7F8FA;
  --admin-surface: #FFFFFF;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--admin-bg);
  margin: 0;
  color: #333;
}

.admin-header {
  background-color: var(--admin-primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.admin-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--admin-surface);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.admin-table img {
  border-radius: 4px;
  object-fit: cover;
}

.admin-btn {
  background: var(--admin-accent);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.admin-btn-outline {
  background: transparent;
  color: var(--admin-primary);
  border: 1px solid var(--admin-primary);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.alert {
  padding: 1rem;
  background-color: #ffcccc;
  color: #cc0000;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* ============================================================
   Galeria no Painel Administrativo & Drag and Drop
   ============================================================ */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: #fdfdfd;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  min-height: 180px;
}

.admin-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: white;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s, opacity 0.2s, border-color 0.2s;
  user-select: none;
  position: relative;
}

.admin-gallery-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.admin-gallery-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
  border: 2px dashed var(--admin-accent);
  transform: scale(0.95);
  box-shadow: 0 8px 24px rgba(227, 0, 15, 0.2);
}

.admin-gallery-item.drag-over {
  border-color: var(--admin-accent);
  transform: scale(1.03);
}

.gallery-drag-handle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  padding: 2px 4px 4px;
  border-bottom: 1px solid #f1f5f9;
  cursor: grab;
}

.reorder-quick-arrows {
  display: flex;
  gap: 2px;
}

.btn-arrow {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}

.btn-arrow:hover {
  background: var(--admin-accent);
  color: white;
  border-color: var(--admin-accent);
}

.gallery-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 110px;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f1f5f9;
}

.gallery-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.gallery-badge-cover {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--admin-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  animation: badgePop 0.25s ease-out;
}

@keyframes badgePop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-delete-img {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-delete-img:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.reorder-status-badge {
  display: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  transition: all 0.3s;
}

.reorder-status-badge.info {
  background: #e0f2fe;
  color: #0369a1;
}

.reorder-status-badge.success {
  background: #dcfce7;
  color: #15803d;
}

.reorder-status-badge.error {
  background: #fee2e2;
  color: #b91c1c;
}
