:root {
  --gold: #D4AF37;
  --dark: #1a1a1a;
  --light: #f4f4f4;
  --error: #e74c3c;
  --success: #2ecc71;
  --border: #ddd;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Jost', sans-serif; background: var(--light); color: var(--dark); min-height: 100vh; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; padding: 1rem; }
.login-card { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.login-card h1 { margin-bottom: 0.5rem; color: var(--gold); }
.login-card p { margin-bottom: 1.5rem; color: #666; }

.form-group { text-align: left; margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.8rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; font-family: inherit; }

.btn-primary { background: var(--dark); color: #fff; border: none; padding: 0.8rem 1.5rem; border-radius: 4px; cursor: pointer; width: 100%; font-size: 1rem; font-weight: 500; transition: background 0.3s; }
.btn-primary:hover { background: #333; }

.error-msg { color: var(--error); margin-top: 1rem; font-size: 0.9rem; }

/* Dashboard Layout */
.admin-container { display: flex; min-height: 100vh; position: relative; }

/* Sidebar */
.sidebar { 
  width: var(--sidebar-width); 
  background: var(--dark); 
  color: #fff; 
  padding: 2rem 1rem; 
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: transform 0.3s ease;
  z-index: 1001;
}

.sidebar h2 { color: var(--gold); margin-bottom: 0.3rem; text-align: center; font-size: 1.2rem; }
.sidebar-logo { margin-bottom: 2rem; text-align: center; }
.sidebar-user { font-size: 0.78rem; color: #999; margin-top: 4px; }
.sidebar nav ul { list-style: none; }
.sidebar nav li { margin-bottom: 0.5rem; }
.sidebar nav a { color: #ccc; text-decoration: none; display: block; padding: 0.8rem 1rem; border-radius: 4px; transition: 0.3s; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,0.1); color: #fff; }

/* Main Content */
.main-content { 
  flex: 1; 
  padding: 2rem; 
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  transition: 0.3s;
}

/* Sidebar display flex pour le lien boutique */
.sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar nav {
  flex: 1;
}
.view-shop-link {
  display: block;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  background: rgba(212,175,55,0.15);
  color: var(--gold) !important;
  text-align: center;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.2s;
  border: 1px solid rgba(212,175,55,0.3);
}
.view-shop-link:hover { background: rgba(212,175,55,0.3); }

.header-actions { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 2rem; 
  flex-wrap: wrap;
  gap: 1rem;
}

/* Mobile Toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1002;
  background: var(--dark);
  color: #fff;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Stats Cards */
.stats-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
  gap: 1rem; 
  margin-bottom: 2rem; 
}
.stat-card { background: #fff; padding: 1.2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-align: center; }
.stat-card h3 { font-size: 0.8rem; color: #666; margin-bottom: 0.5rem; text-transform: uppercase; }
.stat-card .value { font-size: 1.8rem; font-weight: 600; color: var(--gold); }

/* Tables */
.table-container { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #f9f9f9; font-weight: 600; font-size: 0.9rem; }
.data-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }

.actions-cell { display: flex; gap: 0.5rem; }
.btn-edit, .btn-delete { border: none; padding: 0.4rem 0.7rem; border-radius: 4px; cursor: pointer; font-size: 0.85rem; color: #fff; }
.btn-edit { background: var(--gold); }
.btn-delete { background: var(--error); }

/* Modals */
.modal-overlay { 
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  background: rgba(0,0,0,0.7); 
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 2000; 
  padding: 1rem;
}
.modal { 
  background: #fff; 
  padding: 2rem; 
  border-radius: 8px; 
  width: 100%; 
  max-width: 600px; 
  max-height: 95vh; 
  overflow-y: auto; 
}
.modal h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }
.btn-cancel { background: #eee; border: none; padding: 0.6rem 1.2rem; border-radius: 4px; cursor: pointer; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root { --sidebar-width: 200px; }
  
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  
  .main-content { 
    margin-left: 0; 
    width: 100%; 
    padding: 4rem 1rem 1rem 1rem; 
  }
  
  .sidebar-toggle { display: block; }
  
  .header-actions h1 { font-size: 1.5rem; }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  .modal { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .header-actions { flex-direction: column; align-items: flex-start; }
  .btn-primary { width: 100%; }
}

/* Image Preview */
.image-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; margin-top: 10px; }
.preview-item { position: relative; }
.preview-item img { width: 100%; height: 60px; object-fit: cover; border-radius: 4px; }
.btn-remove-img { position: absolute; top: -5px; right: -5px; background: var(--error); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 12px; }
