/* === Admin styles === */
@import url('style.css');

.admin-body { background: var(--bg); }

/* === Login === */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
}

.login-titre {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

.form-input, .form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.search-wrap { position: relative; }
.form-search-input { padding-right: 36px; }
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow);
}

.search-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .1s;
}

.search-item:hover { background: var(--bg); }
.search-item.selected { background: var(--primary); color: #fff; }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  transition: background .15s;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--primary-dk); }
.btn-primary:disabled { background: var(--disabled); }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .9rem;
  margin-bottom: 16px;
}

.alert-error { background: #fdecea; color: #c0392b; }
.alert-success { background: #eafbea; color: #27ae60; }

/* === Dashboard === */
.admin-header {
  background: var(--primary);
  color: #fff;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.admin-header-inner {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 10px;
}

.admin-header-title { flex: 1; font-weight: 700; }
.admin-header-sub { font-size: .82rem; opacity: .8; }

.btn-logout {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: .85rem;
  font-weight: 600;
}

.admin-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* === Service toggle admin === */
.service-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.service-toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-light);
  text-align: center;
  transition: background .15s, color .15s;
}

.service-toggle-btn.active {
  background: var(--primary);
  color: #fff;
}

/* === Zone publication === */
.pub-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.pub-card-header {
  padding: 16px 16px 0;
  font-weight: 700;
  font-size: 1rem;
}

.pub-card-body { padding: 16px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(192,57,43,.04);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-label { font-size: .9rem; color: var(--text-light); }
.upload-label strong { color: var(--primary); }

.upload-preview {
  width: 100%;
  border-radius: 10px;
  margin-top: 12px;
  display: none;
}

/* Aperçu menu actuel */
.menu-actuel {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.menu-actuel img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.menu-actuel-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 600;
}

.btn-danger {
  background: none;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 600;
  width: 100%;
  transition: background .15s, color .15s;
}

.btn-danger:hover { background: var(--primary); color: #fff; }

/* === Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

.stat-nb { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .78rem; color: var(--text-light); margin-top: 4px; }

/* === Profil === */
.section-titre {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}

.btn-secondary {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .95rem;
  font-weight: 600;
  width: 100%;
  transition: border-color .15s;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* === Bouton petit (super admin, menu fixe) === */
.btn-sm {
  padding: 5px 12px !important;
  font-size: .8rem !important;
  border-radius: 7px !important;
  width: auto !important;
}

/* === Grille menu fixe dans le dashboard === */
.menu-fixe-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.menu-fixe-admin-item {
  text-align: center;
}
.menu-fixe-admin-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid var(--border);
}
.menu-fixe-admin-label {
  font-size: .75rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 600;
}
