/* =====================================================
   admin.css — TropikWave Back-office
   Même charte que le front (Bebas Neue + DM Sans,
   palette ocean/mango/sand)
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── Variables (identiques au front) ─── */
:root {
  --mango:      #ff8c00;
  --mango-lt:   #ffe0a0;
  --papaya:     #ff5040;
  --kiwi:       #5db82e;
  --ocean:      #064a62;
  --ocean-mid:  #0d6e7a;
  --ocean-light:#17b8c8;
  --ocean-foam: #c8f7fb;
  --sand:       #fff8ee;
  --white:      #ffffff;
  --dark:       #0a2a30;
  --mid:        #2e6870;
  --danger:     #d63030;
  --success:    #2a9e58;
  --sidebar-w:  220px;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #eef6f8;
  color: var(--dark);
  min-height: 100vh;
}

/* =====================================================
   LAYOUT : sidebar fixe + zone principale
===================================================== */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--ocean);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(6,74,98,0.18);
}

.sidebar-logo {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 1px solid rgba(255,140,0,0.2);
}
.sidebar-logo a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 0.06em;
  color: var(--ocean-foam); text-decoration: none;
}
.sidebar-logo a span { color: var(--mango); }
.sidebar-logo p {
  font-size: 0.7rem; color: rgba(200,247,251,0.45);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 0.2rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.2rem 0;
  list-style: none;
}
.sidebar-nav li a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.4rem;
  color: rgba(200,247,251,0.65);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(255,255,255,0.07);
  color: var(--mango);
  border-left-color: var(--mango);
}
.sidebar-nav .ico { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,140,0,0.15);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 0.6rem;
  color: rgba(200,247,251,0.45);
  text-decoration: none; font-size: 0.8rem;
  transition: color 0.2s;
}
.sidebar-footer a:hover { color: var(--papaya); }

/* ─── Zone principale ─── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─── */
.topbar {
  height: 58px;
  background: var(--white);
  border-bottom: 1px solid #ddeef2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 2px 10px rgba(6,74,98,0.06);
  position: sticky; top: 0; z-index: 50;
}
.topbar h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem; letter-spacing: 0.06em;
  color: var(--ocean);
}
.topbar-right {
  display: flex; align-items: center; gap: 1rem;
}
.topbar-right span {
  font-size: 0.82rem; color: var(--mid);
}
.btn-logout {
  background: var(--papaya);
  color: white; font-size: 0.78rem; font-weight: 500;
  padding: 0.35rem 1rem; border-radius: 2rem;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-logout:hover { opacity: 0.85; }

/* ─── Contenu de page ─── */
.page-content {
  padding: 2rem;
  flex: 1;
}

/* =====================================================
   COMPOSANTS COMMUNS
===================================================== */

/* ─── Cartes stats (dashboard) ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: 1rem; padding: 1.4rem 1.6rem;
  box-shadow: 0 2px 14px rgba(6,74,98,0.07);
  border-top: 4px solid var(--ocean-light);
}
.stat-card.orange { border-top-color: var(--mango); }
.stat-card.red    { border-top-color: var(--papaya); }
.stat-card.green  { border-top-color: var(--kiwi); }

.stat-card .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem; letter-spacing: 0.04em;
  color: var(--ocean-mid); line-height: 1;
}
.stat-card .lbl {
  font-size: 0.78rem; color: var(--mid);
  margin-top: 0.3rem; font-weight: 400;
}

/* ─── Bloc (carte blanche) ─── */
.bloc {
  background: var(--white);
  border-radius: 1rem;
  padding: 1.6rem;
  box-shadow: 0 2px 14px rgba(6,74,98,0.06);
  margin-bottom: 2rem;
}
.bloc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #e8f4f7;
}
.bloc-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem; letter-spacing: 0.06em;
  color: var(--ocean);
}

/* ─── Tableau ─── */
table {
  width: 100%; border-collapse: collapse;
}
th {
  background: var(--ocean);
  color: var(--ocean-foam);
  padding: 0.7rem 1rem;
  text-align: left; font-size: 0.78rem;
  font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
th:first-child { border-radius: 0.5rem 0 0 0; }
th:last-child  { border-radius: 0 0.5rem 0 0; }
td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e8f4f7;
  font-size: 0.88rem; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5fbfc; }

/* ─── Badges fruit ─── */
.badge-fruit {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 500;
  padding: 0.2rem 0.7rem; border-radius: 2rem;
  background: var(--ocean-foam); color: var(--ocean);
}

/* ─── Boutons ─── */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem; border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: var(--ocean-mid); color: white; }
.btn-mango   { background: var(--mango); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.78rem; }

/* ─── Formulaires ─── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mid);
}
.field input, .field select, .field textarea {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #cde8ed;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.92rem;
  color: var(--dark); background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ocean-light);
}
.field textarea { resize: vertical; min-height: 80px; }

/* ─── Messages flash ─── */
.msg {
  padding: 0.8rem 1.2rem; border-radius: 0.5rem;
  font-size: 0.88rem; font-weight: 500; margin-bottom: 1.2rem;
}
.msg-ok  { background: #d4f5e2; color: #1a6b3c; border: 1px solid #a3e6c0; }
.msg-err { background: #fde8e8; color: #a02020; border: 1px solid #f5b0b0; }

/* ─── Filtre client ─── */
.filter-bar {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}
.filter-bar label { font-size: 0.82rem; color: var(--mid); font-weight: 500; }
.filter-bar select {
  padding: 0.5rem 0.9rem; border: 1.5px solid #cde8ed;
  border-radius: 0.5rem; font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; color: var(--dark); outline: none;
  transition: border-color 0.2s;
}
.filter-bar select:focus { border-color: var(--ocean-light); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo p,
  .sidebar-nav li a span { display: none; }
  .sidebar-nav li a { justify-content: center; padding: 0.75rem; }
  .main { margin-left: 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
