/* ============================================================
   CEMAC Marketplace - Design officiel
   Couleurs CEMAC : Vert #006633, Jaune #FFCC00, Bleu #003399
   ============================================================ */

:root {
  --cemac-green: #006633;
  --cemac-green-dark: #004d26;
  --cemac-yellow: #FFCC00;
  --cemac-yellow-dark: #e6b800;
  --cemac-blue: #003399;
  --cemac-blue-dark: #002266;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--cemac-green) 0%, var(--cemac-green-dark) 100%);
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.site-header .logo .dot {
  color: var(--cemac-yellow);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.site-header nav a {
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.site-header nav a:hover,
.site-header nav a.active {
  background: var(--cemac-yellow);
  color: var(--cemac-green);
  font-weight: 600;
}

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h2 {
  color: var(--cemac-green);
  margin-top: 0;
  border-bottom: 3px solid var(--cemac-yellow);
  padding-bottom: 10px;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--cemac-green);
  color: white;
}

.btn-primary:hover {
  background: var(--cemac-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 102, 51, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--cemac-green);
  border: 2px solid var(--cemac-green);
}

.btn-secondary:hover {
  background: var(--cemac-green);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th {
  background: var(--cemac-green);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

table tr:hover {
  background: #f9fafb;
}

/* ---------- Formulaires ---------- */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cemac-green);
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 15px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.en_attente { background: #fef3c7; color: #92400e; }
.badge.en_transit { background: #dbeafe; color: #1e40af; }
.badge.livree { background: #d1fae5; color: #065f46; }
.badge.annulee { background: #f3f4f6; color: #374151; }

/* ---------- Prix ---------- */
.prix {
  color: var(--cemac-green);
  font-weight: 800;
  font-size: 1.2rem;
}

.prix-devise {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Grilles ---------- */
.produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.produit-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.produit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--cemac-yellow);
}

.produit-card h3 {
  color: var(--cemac-green);
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.produit-card .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

/* ---------- Messages ---------- */
.message-success {
  background: #d1fae5;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 4px solid var(--success);
}

.message-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 4px solid var(--danger);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cemac-green);
  color: white;
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h4 {
  color: var(--cemac-yellow);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin: 6px 0;
  font-size: 0.9rem;
}

.footer-col a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--cemac-yellow);
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-logo .dot {
  color: var(--cemac-yellow);
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.9;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 30px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  .site-header nav {
    justify-content: center;
  }
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
  .produits-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Logo SVG ---------- */
.logo-svg {
  height: 50px;
  width: auto;
}

/* ---------- Badges de rôle ---------- */
.role-badge {
  background: var(--cemac-yellow);
  color: var(--cemac-green);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Cartes statistiques ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border-top: 4px solid var(--cemac-yellow);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cemac-green);
  margin: 10px 0;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Séparateurs ---------- */
hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 30px 0;
}

/* ---------- Liens ---------- */
a {
  color: var(--cemac-blue);
}

a:hover {
  color: var(--cemac-green);
}
