/* ===== SIDEBAR (admin) — refonte 2026-08-22 ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: #1f3f27;
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand {
  display: block;
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.admin-sidebar .brand .emoji { margin-right: 0.4rem; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; padding: 0 0.5rem; }
.admin-sidebar details { border-radius: 6px; }
.admin-sidebar details[open] { background: rgba(255,255,255,0.04); }
.admin-sidebar summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  color: #d4e5d6;
  border-radius: 6px;
  display: flex; align-items: center; gap: 0.5rem;
  user-select: none;
}
.admin-sidebar summary::-webkit-details-marker { display: none; }
.admin-sidebar summary::before {
  content: "▸";
  font-size: 0.75rem;
  transition: transform 0.15s;
  color: #b6862c;
}
.admin-sidebar details[open] summary::before { transform: rotate(90deg); }
.admin-sidebar summary:hover { background: rgba(255,255,255,0.08); }
.admin-sidebar summary.active { background: #2f5d3a; color: white; }
.admin-sidebar .sub {
  display: flex; flex-direction: column;
  padding: 0.25rem 0 0.5rem 2rem;
}
.admin-sidebar .sub a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.93rem;
}
.admin-sidebar .sub a:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-sidebar .sub a.active { background: #b6862c; color: white; font-weight: 600; }
.admin-sidebar .sub a.soon {
  color: rgba(255,255,255,0.45);
  cursor: not-allowed;
  font-style: italic;
}
.admin-sidebar .sub a.soon:hover { background: transparent; }
.admin-sidebar .sub a.soon small { opacity: 0.7; font-size: 0.78rem; }

.admin-main { background: #f0f2f5; min-height: 100vh; display: flex; flex-direction: column; }

.admin-topbar {
  background: #2f5d3a;
  color: white;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.admin-topbar .title { font-size: 1.2rem; font-weight: 600; }
.admin-topbar .user-info {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.9rem;
}
.admin-topbar .user-info a { color: white; text-decoration: none; opacity: 0.85; }
.admin-topbar .user-info a:hover { opacity: 1; text-decoration: underline; }

.breadcrumb {
  background: #fff;
  padding: 0.6rem 1.5rem;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.4rem; opacity: 0.5; }

.admin-content {
  padding: 1.5rem;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== DASHBOARD : 5 blocs-rubriques ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.dashboard-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  border-top: 4px solid #2f5d3a;
}
.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  text-decoration: none;
}
.dashboard-card.production    { border-top-color: #b6862c; }
.dashboard-card.produits      { border-top-color: #2f5d3a; }
.dashboard-card.site          { border-top-color: #2563eb; }
.dashboard-card.ventes        { border-top-color: #c2410c; }
.dashboard-card.comptabilite  { border-top-color: #6d28d9; }

.dashboard-card .emoji { font-size: 2.2rem; margin-bottom: 0.5rem; }
.dashboard-card h3 { margin: 0 0 0.5rem; color: var(--primary-dark); font-size: 1.15rem; }
.dashboard-card .nums {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 0.75rem;
}
.dashboard-card .num {
  background: #f5f8f4;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  flex: 1 1 100px;
  text-align: center;
}
.dashboard-card .num strong { display: block; font-size: 1.5rem; color: var(--primary-dark); }
.dashboard-card .num span { font-size: 0.82rem; color: var(--muted); }
.dashboard-card .alert {
  background: #fef3c7;
  border-left: 3px solid #c2410c;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: #92400e;
  border-radius: 4px;
}

.welcome-banner {
  background: linear-gradient(135deg, #2f5d3a, #1f3f27);
  color: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.welcome-banner h2 { margin: 0 0 0.25rem; }
.welcome-banner p { margin: 0; opacity: 0.9; }

/* Boutons d'action colorés */
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn-orange {
  background: #b6862c;
  color: white;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-orange:hover { background: #a37523; color: white; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
}
.btn-ghost:hover { background: var(--primary); color: white; }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
}

/* ===== STATS GRID (dashboard) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat .num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat > div:last-child {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== TABLE ADMIN ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}
.admin-table thead th {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-table tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.admin-table tbody tr:hover {
  background: var(--accent-light);
}

/* ===== BADGES ===== */
.badge.out {
  background: var(--error);
  color: white;
}

/* ===== BOUTONS (alias) ===== */
.btn {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: var(--primary-dark); }
.btn-small {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
}
.btn-small:hover { background: var(--accent-dark); }

/* ===== FORMS ADMIN ===== */
.form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form textarea {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-top: 0.25rem;
}
.form input:focus,
.form textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-light);
}
.form .checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form .checkbox input { width: auto; margin: 0; }
.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* ===== DL GRID (caractéristiques) ===== */
.bot-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
.bot-grid dt {
  font-weight: 600;
  color: var(--primary-dark);
}
.bot-grid dd {
  margin: 0;
  color: var(--fg);
}

/* ===== STATUS BADGES (prospects) ===== */
.status-nouveau { background: #dbeafe; color: #1e3a8a; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }
.status-contacte { background: #fef3c7; color: #854d0e; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }
.status-interesse { background: #ede9fe; color: #5b21b6; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }
.status-devis { background: #fce7f3; color: #9d174d; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }
.status-gagne { background: #dcfce7; color: #166534; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }
.status-perdu { background: #fee2e2; color: #991b1b; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }

/* ===== FLASH MESSAGES ===== */
.flashes { margin-bottom: 1rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
