/* ============================
   ESPACE COMPTE – VYMEA
============================ */

/* wrapper global */
.dashboard {
  display: flex;
  gap: 24px;
  margin: 40px auto;      /* centre horizontalement */
  max-width: 1200px;      /* largeur centrale */
  padding: 0 20px;        /* respiration sur petits écrans */
}


/* ============================
   MENU LATÉRAL
============================ */

.dashboard-menu {
  min-width: 220px;
  background: rgba(255,255,255,0.75);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(90,60,255,0.08);
}

.dashboard-menu strong {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.dashboard-menu a {
  display: block;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  color: #4b3cff;
  font-weight: 600;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}

.dashboard-menu a:hover,
.dashboard-menu a.active {
  background: linear-gradient(135deg,#6f63ff,#8a7dff);
  color: #fff;
}

/* ============================
   CONTENU PRINCIPAL
============================ */

.dashboard-content {
  flex: 1;
  background: rgba(255,255,255,0.85);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(90,60,255,0.10);
}

/* titres */
.dashboard-content h1 {
  font-size: 32px;
  margin-bottom: 14px;
}

.dashboard-content h2 {
  margin-top: 30px;
  font-size: 22px;
}

/* ============================
   CARTES
============================ */

.order-card,
.message-card,
.profile-box {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
  line-height: 1.6;
}

.order-card strong {
  color: #4b3cff;
}

/* messages */
.message-card.admin {
  border-left: 5px solid #6f63ff;
}

.message-card.user {
  border-left: 5px solid #ccc;
}

/* ============================
   FORMULAIRES
============================ */

.auth,
.form-address,
.message-form,
.profile-box form {
  max-width: 540px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 14px 0 6px;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #ddd;
  margin-bottom: 14px;
  font-size: 15px;
  transition: border .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #6f63ff;
  box-shadow: 0 0 0 3px rgba(111,99,255,0.15);
}

/* ============================
   BOUTONS
============================ */

.btn.primary {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  font-weight: 800;
  background: linear-gradient(135deg,#6f63ff,#8a7dff);
  box-shadow: 0 10px 25px rgba(111,99,255,0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(111,99,255,0.45);
}

.btn.ghost {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 999px;
  background: transparent;
  border: 2px solid #6f63ff;
  color: #6f63ff;
  font-weight: 700;
}

/* ============================
   PROFIL
============================ */

.avatar {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
}

.avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(111,99,255,0.25);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* ============================
   ADMIN – UTILISATEURS
============================ */

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.role-admin {
  background: rgba(111,99,255,.15);
  color: #4b3cff;
}

.role-user {
  background: rgba(0,0,0,.08);
  color: #555;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin-top: 14px;
}

.admin-user-grid span {
  display: block;
  font-size: 13px;
  color: #6b6b6b;
}

.admin-user-grid strong {
  font-size: 15px;
  color: #2b2b2b;
}

/* ============================
   ALERTES
============================ */

.success {
  background: rgba(50,200,150,0.15);
  color: #0f5132;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.error {
  background: rgba(220,60,60,0.15);
  color: #842029;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* ============================
   RESPONSIVE
============================ */

@media (max-width: 900px) {
  .dashboard {
    flex-direction: column;
  }

  .dashboard-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }

  .dashboard-menu a {
    white-space: nowrap;
  }

  .admin-user-grid {
    grid-template-columns: 1fr;
  }
}
/* ============================
   PROFIL – STYLE FINAL
============================ */

.profile-box {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(90,60,255,0.12);
  max-width: 700px;
}

/* header avatar */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(111,99,255,.25);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.profile-header h2 {
  margin: 0;
  font-size: 24px;
}

.profile-sub {
  color: #777;
  font-size: 14px;
  margin-top: 4px;
}

/* grille champs */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 20px;
}

.profile-box label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  color: #333;
}

.profile-box input[type="text"],
.profile-box input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #ddd;
  font-size: 15px;
}

/* bouton */
.profile-box .btn.primary {
  margin-top: 24px;
  width: 100%;
}

/* responsive */
@media (max-width: 700px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}
/* =========================
   AVATAR PROFIL – FIX FINAL
========================= */

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #6f63ff, #8a7dff);
  box-shadow: 0 12px 30px rgba(111,99,255,0.35);
  border: 4px solid #fff;
}

/* Empêche l'affichage du alt texte */
.profile-avatar:not([src]),
.profile-avatar[src=""] {
  display: none;
}

/* Fallback avatar visuel */
.profile-avatar-wrapper {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg,#6f63ff,#8a7dff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 28px;
  box-shadow: 0 12px 30px rgba(111,99,255,0.35);
}

}

/* responsive */
@media (max-width: 700px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}
/* Conteneur historique */
.messages-history {
  margin-top: 20px;

  /* hauteur = ~2 messages */
  max-height: 320px;

  overflow-y: auto;
  padding-right: 6px;
}

/* Scroll discret */
.messages-history::-webkit-scrollbar {
  width: 6px;
}

.messages-history::-webkit-scrollbar-thumb {
  background: rgba(111,99,255,.4);
  border-radius: 10px;
}

/* Message individuel */
.message-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

/* Dernier message un peu moins espacé */
.message-card:last-child {
  margin-bottom: 0;
}
/* =========================
   HISTORIQUE MESSAGES ADMIN
========================= */

.admin-messages-history {
  margin-top: 20px;

  /* ≈ 2 messages visibles */
  max-height: 760px;

  overflow-y: auto;
  padding-right: 6px;
}

/* scrollbar clean */
.admin-messages-history::-webkit-scrollbar {
  width: 6px;
}
.admin-messages-history::-webkit-scrollbar-thumb {
  background: rgba(111,99,255,.45);
  border-radius: 10px;
}

/* cartes */
.message-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.message-card:last-child {
  margin-bottom: 0;
}

/* distinction admin / user */
.message-card.admin {
  border-left: 4px solid #6f63ff;
}

.message-card.user {
  border-left: 4px solid #ccc;
}

/* formulaire réponse */
.admin-reply-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

/*======admin/order=====*/
 .order-toggle { font-weight:800; }
.order-details-row td { padding:0; }
.order-details {
  background:#fff;
  margin:14px;
  padding:20px;
  border-radius:18px;
  border:1px solid #e5e7eb;
  box-shadow:0 12px 30px rgba(0,0,0,.06);
}
.detail-title { font-weight:900; margin-bottom:8px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.actions { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
@media(max-width:900px){ .grid-2{grid-template-columns:1fr;} }