* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f6f8; color: #222;
  display: flex; min-height: 100vh;
}
a { text-decoration: none; }

/* LOGIN */
.login-page {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a3c5e, #2c5f8a);
}
.login-box {
  background: #fff; padding: 40px; border-radius: 16px;
  width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.login-box h1 { color: #1a3c5e; text-align: center; margin-bottom: 5px; font-size: 22px; }
.login-box > p { text-align: center; color: #666; margin-bottom: 25px; font-size: 14px; }
.alert-error {
  background: #ffe6e6; color: #c0392b; padding: 12px;
  border-radius: 8px; margin-bottom: 15px; font-size: 14px;
}

/* FORMULAIRES */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: #333; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px;
  font-family: inherit; font-size: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* BOUTONS */
.btn-primary, .btn-secondary, .btn-sm, .btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: #1a3c5e; color: #fff; }
.btn-primary:hover { background: #f39c12; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #ddd; }
.btn-sm { padding: 6px 10px; font-size: 12px; background: #1a3c5e; color: #fff; }
.btn-sm:hover { background: #f39c12; }
.btn-danger { background: #e74c3c !important; color: #fff; }

/* SIDEBAR */
.admin-sidebar {
  width: 250px; background: #1a3c5e; color: #fff;
  padding: 25px 0; position: fixed; height: 100vh; overflow-y: auto;
}
.sidebar-logo { padding: 0 20px 20px; border-bottom: 1px solid #2c5f8a; margin-bottom: 15px; }
.sidebar-logo h2 { font-size: 18px; }
.sidebar-logo h2 span { color: #f39c12; }
.sidebar-logo p { font-size: 11px; color: #8fb0cc; text-transform: uppercase; letter-spacing: 1px; }
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-sidebar nav a {
  color: #cce; padding: 12px 20px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; transition: all .2s;
}
.admin-sidebar nav a:hover { background: #2c5f8a; color: #fff; padding-left: 25px; }
.admin-sidebar nav i { width: 18px; text-align: center; }

/* CONTENU */
.admin-content { flex: 1; margin-left: 250px; padding: 30px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
}
.admin-header h1 { font-size: 22px; color: #1a3c5e; }
.user-info {
  background: #fff; padding: 10px 18px; border-radius: 25px;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.btn-logout { color: #e74c3c; font-size: 16px; }

/* STATS */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px; margin-bottom: 30px;
}
.stat-card {
  background: #fff; padding: 20px; border-radius: 12px;
  display: flex; align-items: center; gap: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  border-left: 4px solid #1a3c5e;
}
.stat-card i { font-size: 30px; color: #1a3c5e; opacity: .8; }
.stat-card.warning { border-left-color: #f39c12; }
.stat-card.warning i { color: #f39c12; }
.stat-card.success { border-left-color: #27ae60; }
.stat-card.success i { color: #27ae60; }
.stat-value { display: block; font-size: 22px; font-weight: bold; color: #1a3c5e; }
.stat-label { display: block; font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: .5px; }

/* SECTIONS */
.admin-section {
  background: #fff; padding: 20px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); margin-bottom: 25px;
}
.admin-section h2 { font-size: 16px; color: #1a3c5e; margin-bottom: 15px; }

/* TABLEAUX */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: 12px 10px; font-size: 12px;
  color: #888; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid #eee;
}
.admin-table td { padding: 12px 10px; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.admin-table tr:hover { background: #f9fbfd; }
.admin-table tfoot th, .admin-table tfoot td { padding: 10px; font-size: 14px; }
.admin-table .total-row { background: #eef3f8; color: #1a3c5e; font-size: 16px; }

/* BADGES */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px;
  color: #fff;
}
.badge-en_attente { background: #f39c12; }
.badge-confirmee { background: #3498db; }
.badge-en_livraison { background: #9b59b6; }
.badge-livree { background: #27ae60; }
.badge-annulee { background: #e74c3c; }

/* FILTRES */
.filters {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
  background: #fff; padding: 15px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.filters input, .filters select {
  padding: 10px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; flex: 1; min-width: 180px;
}

/* DETAILS */
.detail-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-table { width: 100%; font-size: 14px; }
.detail-table th { text-align: left; padding: 8px 10px 8px 0; color: #888; width: 120px; font-weight: 600; font-size: 13px; }
.detail-table td { padding: 8px 0; }
.statut-form { display: flex; gap: 10px; flex-wrap: wrap; }
.statut-form select { padding: 10px; border: 1px solid #ddd; border-radius: 8px; }
.statut-form input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 8px; }

/* TIMELINE */
.timeline { list-style: none; padding: 0; }
.timeline li {
  padding: 12px 0 12px 25px; border-left: 3px solid #1a3c5e;
  position: relative; font-size: 14px;
}
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 18px;
  width: 11px; height: 11px; background: #1a3c5e; border-radius: 50%;
}

/* FORMULAIRE ADMIN */
.admin-form { background: #fff; padding: 25px; border-radius: 12px; max-width: 700px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.admin-form .form-group input, .admin-form .form-group select { padding: 12px; }