/* admin/style-admin.css */

/* ==========================================================================
   1. VARIABLES DE CHARTE GRAPHIQUE & REINITIALISATION
   ========================================================================== */
:root {
  --vert-eden: #004B23;       /* Vert foncé officiel d'Eden */
  --vert-bouton: #70B130;    /* Vert clair dynamique pour les actions */
  --bg-clair: #F8F9FA;       /* Fond de page gris/blanc doux */
  --texte-sombre: #2D3748;   /* Couleur de texte principale */
  --gris-bordure: #E2E8F0;   /* Couleur des lignes de séparation */
  --or-eden: #A07830;        /* Teinte dorée pour les références */
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
}

body {
  background-color: var(--bg-clair);
  color: var(--texte-sombre);
  min-height: 100vh;
  display: flex;
}

/* ==========================================================================
   2. INTERFACE DE CONNEXION (LOGIN UX/UI PREMIUM)
   ========================================================================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  background-color: #F4F6F8;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  padding: 40px 35px;
  box-shadow: 0 10px 30px rgba(0, 75, 35, 0.04);
  border: 1px solid var(--gris-bordure);
  text-align: center;
}

.login-logo {
  height: 80px;
  object-fit: contain;
  margin-bottom: 20px;
}

.login-card .brand-title {
  color: var(--vert-eden);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
}

.login-card .brand-subtitle {
  color: #718096;
  font-size: 13px;
  margin-bottom: 30px;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #A0AEC0;
}

.input-with-icon {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 1px solid #CBD5E0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
  background-color: #F8FAFC;
}

.input-with-icon:focus {
  border-color: var(--vert-eden);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 75, 35, 0.1);
  outline: none;
}

.btn-login {
  background-color: var(--vert-eden);
  color: white;
  border: none;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.2s;
}

.btn-login:hover {
  background-color: #003318;
}

.alert-error {
  background-color: #FED7D7;
  color: #C53030;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

/* ==========================================================================
   3. UNIQUE MENU LATÉRAL DE GAUCHE (FIXE ET CONTINU)
   ========================================================================== */
.sidebar {
  width: 260px;
  background-color: var(--vert-eden);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar .logo-area {
  text-align: left;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

.sidebar h2 { 
  font-size: 18px; 
  margin: 0; 
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Placement des menus principaux sur la partie supérieure */
.sidebar-menu { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  flex: 1; /* Pousse le footer vers le bas */
}

.sidebar-menu a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu a.active, 
.sidebar-menu a:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Section intercalaire pour les sous-configurations (optionnel) */
.sidebar-submenu-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-top: 25px;
  margin-bottom: 5px;
  padding-left: 10px;
}

.sidebar-footer {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   4. ZONE DE CONTENU PRINCIPAL DECALE A DROITE
   ========================================================================== */
.main-content {
  margin-left: 260px; /* Laisse la place exacte pour le menu de gauche */
  padding: 40px;
  flex: 1;
  min-width: 0;
  width: calc(100% - 260px);
}

/* Layout pour l'arborescence des paramètres (Page Config) */
.config-layout {
  display: flex;
  gap: 30px;
}

.config-sub-menu {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.config-sub-menu a {
  color: #4A5568;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.config-sub-menu a.active, .config-sub-menu a:hover {
  background-color: #E6F4EA;
  color: var(--vert-eden);
}

.config-main-area {
  flex: 1;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
  gap: 20px;
}

.page-title h1 { 
  margin: 0; 
  font-size: 26px; 
  font-weight: 700;
  color: var(--vert-eden); 
}

/* ==========================================================================
   5. COMPOSANTS ET ANTI-DÉBORDEMENT DES TABLEAUX
   ========================================================================== */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 35px;
}

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
  border: 1px solid var(--gris-bordure);
}

.kpi-card .kpi-title { 
  font-size: 12px; 
  color: #718096; 
  text-transform: uppercase; 
  font-weight: 700; 
  letter-spacing: 0.5px;
}

.kpi-card .kpi-value { 
  font-size: 24px; 
  font-weight: 700; 
  color: var(--texte-sombre); 
  margin-top: 8px; 
}

.btn-admin {
  background-color: var(--vert-bouton);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-admin:hover { opacity: 0.9; }
.btn-danger { background-color: #E53E3E; }

.data-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--gris-bordure);
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  margin-top: 15px;
  table-layout: fixed;
}

.admin-table th {
  padding: 14px 16px;
  border-bottom: 2px solid var(--gris-bordure);
  color: #718096;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--gris-bordure);
  font-size: 14px;
  vertical-align: middle;
  word-wrap: break-word;
}

.admin-table tr:hover { background-color: #F8FAFC; }

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   6. FORMULAIRES ET INPUTS
   ========================================================================== */
.form-group { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 20px; 
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #4A5568;
}

.form-control {
  padding: 12px 16px;
  border: 1px solid var(--gris-bordure);
  border-radius: 8px;
  font-size: 14px;
  background-color: #F8FAFC;
  transition: all 0.2s ease;
  color: var(--texte-sombre);
}

.form-control:focus { 
  border-color: var(--vert-eden); 
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 75, 35, 0.08);
  outline: none; 
}