/* ==========================================
   1. VARIABLES & RESET GLOBAL
   ================================---------- */
:root {
  --primary-color: #1b365d;
  /* Bleu institutionnel douanier */
  --secondary-color: #d99b26;
  /* Accent doré / jaune officiel */
  --bg-color: #f4f7f6;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-color: #d1d5db;
  --success-color: #10b981;
  --error-color: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Structure globale pour l'affichage avec Menu Latéral Fixe */
body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================
   2. MENU LATÉRAL (SIDEBAR)
   ================================---------- */
.sidebar {
  width: 260px;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: #1abc9c;
}

.sidebar-header p {
  font-size: 0.85rem;
  color: #bdc3c7;
  margin-bottom: 30px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.sidebar-menu li {
  margin-bottom: 10px;
}

.sidebar-menu a {
  display: block;
  color: #ecf0f1;
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 4px;
  transition: background 0.3s;
  font-size: 0.95rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: #34495e;
  color: #1abc9c;
}

.sidebar-footer a {
  color: #e74c3c;
  text-decoration: none;
  font-weight: bold;
  display: block;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background 0.3s;
}

.sidebar-footer a:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

/* ==========================================
   3. CONTENU PRINCIPAL
   ================================---------- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.main-header {
  background-color: #ffffff;
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-header h2 {
  color: var(--primary-color);
  font-size: 1.4rem;
}

.main-body {
  padding: 30px;
}

/* ==========================================
   4. COMPOSANTS (Cartes, Formulaires, Tableaux)
   ================================---------- */
.welcome-card,
.form-container,
.table-container,
.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.card p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

/* Formulaires */
.form-group {
  margin-bottom: 15px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.1);
}

/* Boutons */
.btn,
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.btn:hover,
.btn-primary:hover {
  background-color: #12243e;
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background-color: var(--primary-color);
  color: white;
}

tr:hover {
  background-color: #f9fafb;
}

/* Alertes */
.alert {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.alert.success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid var(--success-color);
}

.alert.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid var(--error-color);
}