:root {
  --primary: #2c3e50;
  --accent: #27ae60;
  --background: #f5f7fa;
  --surface: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: #dfe6e9;
  --error: #e74c3c;
  --success: #2ecc71;
  --overlay: rgba(0, 0, 0, 0.8);
}

body.dark {
  --primary: #ecf0f1;
  --accent: #2ecc71;
  --background: #1e272e;
  --surface: #2c3e50;
  --text: #ecf0f1;
  --text-muted: #95a5a6;
  --border: #34495e;
  --error: #e74c3c;
  --success: #2ecc71;
  --overlay: rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 960px;
  margin: 40px auto;
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

p {
  margin-bottom: 20px;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
  padding-left: 0;
}
ul li {
  padding: 6px 0;
}

/* Boutons */
.btn {
  display: inline-block;
  margin: 10px 8px 10px 0;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn:hover {
  background: #219150;
}
.btn:active {
  transform: scale(0.98);
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 30px;
  font-size: 0.95rem;
}
table thead {
  background-color: var(--background);
}
table th,
table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
table tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Formulaires */
form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
label {
  font-weight: 500;
  color: var(--primary);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.3s ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: none;
}
body.dark input,
body.dark select,
body.dark textarea {
  background: #34495e;
  color: #ecf0f1;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  margin-right: 8px;
}

/* Alertes */
.success {
  color: var(--success);
  font-weight: 500;
}
.error {
  color: var(--error);
  font-weight: 500;
}

/* Footer */
footer {
  margin-top: 60px;
  text-align: center;
  font-size: 0.85em;
  color: var(--text-muted);
}

/* Menu plein écran */
.fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease-out forwards;
}
.fullscreen-menu.open {
  display: flex;
}
.fullscreen-menu a {
  font-size: 1.5rem;
  margin: 12px 0;
  color: #fff;
  transition: transform 0.2s;
}
.fullscreen-menu a:hover {
  transform: scale(1.1);
  text-decoration: underline;
}

/* Animation ouverture */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  table th, table td {
    font-size: 0.85rem;
    padding: 8px;
  }
}
