/* ============================================================
   RBC Créations — Panneau Administration
   ============================================================ */

/* --- Login --- */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
  padding: 1rem;
}
.admin-login-card {
  background: white;
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.admin-login-card .logo-icon {
  font-size: 3rem;
  color: #3b82f6;
  margin-bottom: 1rem;
}
.admin-login-card h1 {
  font-size: 1.5rem;
  color: #1e3a5f;
  margin-bottom: 0.5rem;
}
.admin-login-card p {
  color: #94a3b8;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.admin-login-card .form-group {
  text-align: left;
  margin-bottom: 1.5rem;
}
.admin-login-card label {
  display: block;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.admin-login-card input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.admin-login-card input:focus {
  outline: none;
  border-color: #3b82f6;
}
.admin-login-btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1e3a5f);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.admin-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59,130,246,0.4);
}
.login-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

/* --- Dashboard layout --- */
.admin-dashboard { display: none; }
.admin-dashboard.active { display: block; }
.admin-topbar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar .admin-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1e3a5f;
  text-decoration: none;
}
.admin-topbar .admin-logo i { color: #3b82f6; }
.admin-topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.admin-topbar-actions a,
.admin-topbar-actions button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-view-site {
  background: #f0f9ff;
  color: #3b82f6;
}
.btn-view-site:hover { background: #dbeafe; }
.btn-logout {
  background: #fef2f2;
  color: #ef4444;
}
.btn-logout:hover { background: #fee2e2; }

/* --- Stats --- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
}
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.stat-icon.blue   { background: #dbeafe; color: #3b82f6; }
.stat-icon.green  { background: #dcfce7; color: #22c55e; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }
.stat-info h3 { font-size: 1.5rem; color: #1e293b; margin-bottom: 0.15rem; }
.stat-info p  { font-size: 0.8rem; color: #94a3b8; }

/* --- Content zone --- */
.admin-content {
  padding: 0 2rem 2rem;
}
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.admin-section-header h2 {
  font-size: 1.35rem;
  color: #1e293b;
}
.btn-add-creation {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1e3a5f);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}
.btn-add-creation:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59,130,246,0.3);
}

/* --- Table / List --- */
.admin-table-wrapper {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  color: #475569;
  vertical-align: middle;
}
.admin-table tr:hover td { background: #f8fafc; }
.table-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
}
.table-name {
  font-weight: 600;
  color: #1e293b;
}
.table-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3b82f6;
  font-weight: 600;
}
.table-price {
  font-weight: 700;
  color: #1e293b;
}
.table-price .old { text-decoration: line-through; color: #94a3b8; font-weight: 400; font-size: 0.8rem; margin-left: 0.35rem; }
.table-badge {
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}
.table-badge.stock { background: #dcfce7; color: #16a34a; }
.table-badge.rupture { background: #fef2f2; color: #ef4444; }
.table-badge.new   { background: #dbeafe; color: #3b82f6; }
.table-badge.promo { background: #fff7ed; color: #f97316; }

.table-actions {
  display: flex;
  gap: 0.4rem;
}
.table-actions button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-edit   { background: #dbeafe; color: #3b82f6; }
.btn-edit:hover { background: #bfdbfe; }
.btn-delete { background: #fef2f2; color: #ef4444; }
.btn-delete:hover { background: #fee2e2; }
.btn-duplicate { background: #f0fdf4; color: #22c55e; }
.btn-duplicate:hover { background: #dcfce7; }

/* --- Modal formulaire --- */
.admin-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.admin-modal-overlay.active { display: flex; }
.admin-modal {
  background: white;
  border-radius: 20px;
  max-width: 750px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: adminSlideIn 0.3s ease;
  margin: auto 0;
}
@keyframes adminSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
}
.admin-modal-header h2 {
  font-size: 1.2rem;
  color: #1e293b;
}
.admin-modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.admin-modal-close:hover { background: #e2e8f0; }
.admin-modal-body {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}
.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 20px 20px;
}

/* Form groups */
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.admin-form-group {
  margin-bottom: 1.25rem;
}
.admin-form-group.full { grid-column: 1 / -1; }
.admin-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.5rem;
}
.admin-form-group label .hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.8rem;
}
.admin-form-group input[type="text"],
.admin-form-group input[type="number"],
.admin-form-group textarea,
.admin-form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
  outline: none;
  border-color: #3b82f6;
}
.admin-form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* Section titles */
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-section-title:first-child { margin-top: 0; }

/* Toggle switches */
.toggle-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.toggle-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e2e8f0;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: #3b82f6;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
}

/* Image upload */
.image-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
  position: relative;
}
.image-upload-zone:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}
.image-upload-zone i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  display: block;
}
.image-upload-zone p {
  color: #64748b;
  font-size: 0.9rem;
}
.image-upload-zone .hint {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.image-upload-zone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.image-previews {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.image-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239,68,68,0.9);
  color: white;
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Colors/sizes chips manager */
.chips-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: #f1f5f9;
  border-radius: 50px;
  font-size: 0.82rem;
  color: #475569;
}
.chip .chip-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}
.chip .chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  margin-left: 0.25rem;
}
.chip .chip-remove:hover { color: #ef4444; }
.chip-add-btn {
  padding: 0.35rem 0.75rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: 50px;
  background: none;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}
.chip-add-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

/* Add color mini-form */
.add-color-form,
.add-detail-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.add-color-form input[type="text"] {
  padding: 0.4rem 0.75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 120px;
}
.add-color-form input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}
.mini-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.mini-btn-ok {
  background: #3b82f6;
  color: white;
}
.mini-btn-cancel {
  background: #f1f5f9;
  color: #64748b;
}

/* Sizes checkboxes */
.sizes-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.size-checkbox {
  position: relative;
}
.size-checkbox input {
  position: absolute;
  opacity: 0;
}
.size-checkbox label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.size-checkbox input:checked + label {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}

/* Tags input */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  min-height: 44px;
  align-items: center;
  cursor: text;
}
.tags-input-container:focus-within { border-color: #3b82f6; }
.tag-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: #eff6ff;
  border-radius: 50px;
  font-size: 0.8rem;
  color: #3b82f6;
  font-weight: 500;
}
.tag-chip button {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
}
.tag-chip button:hover { color: #ef4444; }
.tags-input {
  border: none;
  outline: none;
  font-size: 0.85rem;
  flex: 1;
  min-width: 100px;
  padding: 0.25rem;
}

/* Details list */
.details-list {
  list-style: none;
}
.details-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: #475569;
}
.details-list li i { color: #22c55e; }
.details-list li button {
  margin-left: auto;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
}
.details-list li button:hover { color: #ef4444; }

/* Buttons */
.btn-save {
  padding: 0.7rem 2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1e3a5f);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,130,246,0.3); }
.btn-cancel {
  padding: 0.7rem 1.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-cancel:hover { background: #f8fafc; }
.btn-reset-data {
  padding: 0.5rem 1rem;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  background: white;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-reset-data:hover { background: #fef2f2; }

/* Confirm modal */
.confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.confirm-box h3 { color: #1e293b; margin-bottom: 0.5rem; }
.confirm-box p { color: #64748b; font-size: 0.9rem; margin-bottom: 1.5rem; }
.confirm-btns { display: flex; gap: 0.75rem; justify-content: center; }
.confirm-btns .btn-delete-confirm {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.confirm-btns .btn-cancel-confirm {
  padding: 0.6rem 1.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast.success { background: #22c55e; }
.admin-toast.error   { background: #ef4444; }
.admin-toast.info    { background: #3b82f6; }

/* Empty state */
.admin-empty {
  padding: 4rem 2rem;
  text-align: center;
  color: #94a3b8;
}
.admin-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Help banner */
.help-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin: 0 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #1e40af;
}
.help-banner i { font-size: 1.25rem; color: #3b82f6; }
.help-banner .close-help {
  margin-left: auto;
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-topbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .admin-stats { padding: 1rem; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .admin-content { padding: 0 1rem 1rem; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }
  .admin-modal-body { padding: 1.25rem; }
  .admin-form-row { grid-template-columns: 1fr; }
  .help-banner { margin: 0 1rem 1rem; }
}