/* --- Variables et Couleurs --- */
:root {
  --primary-blue: #0056b3; /* Bleu Liemza */
  --dark-blue: #004494; /* Bleu foncé */
  --accent-yellow: #ffc107; /* Jaune Liemza */
  --text-dark: #2c3e50;
  --text-light: #6c757d;
  --bg-light: #f4f7f6; /* Fond général très doux */
  --white: #ffffff;
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.08);
  --sidebar-width: 260px;
  --radius: 12px;
}

/* Reset et Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", "Roboto", Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* --- Layout --- */
.container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar Moderne --- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(
    180deg,
    var(--primary-blue) 0%,
    var(--dark-blue) 100%
  );
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 25px;
  position: relative;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.logo-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.02);
}

.app-logo {
  max-width: 100%;
  height: auto;
  display: block;
}

.sidebar ul {
  list-style: none;
  flex-grow: 1;
}

.sidebar ul li {
  margin-bottom: 12px;
}

.sidebar ul li a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animation fluide */
  position: relative;
  overflow: hidden;
}

/* Effet Hover Fluide */
.sidebar ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--white);
  transform: translateX(5px); /* Petit décalage vers la droite */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* État Actif */
.sidebar ul li.active a {
  background-color: var(--white);
  color: var(--primary-blue);
  font-weight: 700;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.sidebar ul li.active a i {
  color: var(--accent-yellow); /* Icône jaune sur l'actif */
}

.logout a {
  background: rgba(0, 0, 0, 0.1);
  justify-content: center;
}
.logout a:hover {
  background: #ff4757;
  color: white;
}

/* --- Contenu Principal --- */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  background-color: var(--white);
  padding: 20px 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

header h1 {
  font-size: 1.5rem;
  color: var(--primary-blue);
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 600;
}

.profile-pic {
  width: 45px;
  height: 45px;
  background-color: var(--accent-yellow);
  color: var(--dark-blue);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* --- Stats Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.card {
  background-color: var(--white);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--primary-blue);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card.highlight {
  border-left-color: var(--accent-yellow);
}

.card h3 {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* --- Barre d'outils (Recherche & Tri) --- */
.toolbar {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  background: white;
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 2;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}

.search-box input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #f9f9f9;
  font-size: 0.95rem;
  transition: 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.sort-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-box select {
  width: 100%;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #f9f9f9;
  cursor: pointer;
}

/* --- Tableau Moderne (Lignes flottantes) --- */
.table-container {
  background: transparent; /* On enlève le fond blanc du conteneur */
}

table {
  width: 100%;
  border-collapse: separate; /* Important pour les lignes séparées */
  border-spacing: 0 12px; /* Espace entre les lignes */
}

thead th {
  text-align: left;
  padding: 0 20px 10px 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

tbody tr {
  background-color: var(--white);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 10px; /* Ne marche que si les TD ont aussi des border-radius */
}

tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  z-index: 10;
  position: relative;
}

tbody td {
  padding: 20px;
  vertical-align: middle;
  border: none; /* Pas de ligne grise */
}

/* Arrondir les coins de la première et dernière cellule de chaque ligne */
tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Styles spécifiques texte */
.quote-ref {
  font-weight: 700;
  color: var(--primary-blue);
  font-size: 1.05rem;
}
.client-name {
  font-weight: 600;
  color: var(--text-dark);
  display: block;
}
.client-contact {
  font-size: 0.85rem;
  color: #888;
}
.quote-date {
  color: #666;
  font-weight: 500;
}

/* Bouton Traiter */
.btn-traiter {
  background-color: var(--accent-yellow);
  color: #333;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 25px;
  border-radius: 30px; /* Bouton pilule */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(255, 193, 7, 0.2);
  transition: all 0.3s ease;
}

.btn-traiter:hover {
  background-color: #ffca2c;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 193, 7, 0.3);
}

/* Bouton Nouveau Devis */
.btn-primary {
  background-color: var(--primary-blue);
  color: white;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  transition: 0.3s;
}
.btn-primary:hover {
  background-color: var(--dark-blue);
  box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

/* Message Vide */
.empty-state {
  text-align: center;
  padding: 50px;
  background: white;
  border-radius: var(--radius);
  color: #888;
  box-shadow: var(--shadow-soft);
}

/* --- Badges de Statut (Nouveau) --- */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* En attente (Orange) */
.badge.pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* À signer / Validé par Admin (Bleu) */
.badge.sent {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

/* Signé / Accepté (Vert) */
.badge.accepted {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Refusé (Rouge) */
.badge.rejected {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
