/* -----------------------------------------------
🌐 1. Base globale : couleur, typo, layout
-------------------------------------------------- */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background-color: #1e1e2f;  /* fond sombre */
  color: #ffffff;
  padding: 2em;
  box-sizing: border-box;
}

main {
  max-width: 1000px;
  margin: 0 auto;
}

/* Responsive padding desktop */
@media screen and (min-width: 769px) {
  body {
    padding: 2em 2em 2em 240px;
  }
}

/* Titres colorés */
h1, h2 {
  color: #ffcc00;
  margin-top: 1em;
}

a {
  color: #00bfff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}


/* -----------------------------------------------
🧾 2. Formulaires & champs
-------------------------------------------------- */
form {
  background: #2a2a40;
  padding: 1em;
  border-radius: 8px;
  margin: 1em 0 2em;
}

input[type="text"],
input[type="checkbox"],
select {
  padding: 0.4em 0.6em;
  margin: 0.4em 0;
  border-radius: 4px;
  border: none;
  font-size: 1em;
}

form:focus-within {
  outline: none;
  box-shadow: none;
}


/* -----------------------------------------------
🖱️ 3. Boutons
-------------------------------------------------- */
button {
  background: #00bfff;
  color: white;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #008ccc;
}

button:focus {
  outline: none;
  box-shadow: none;
}

/* 🔴 Bouton "Supprimer" */
.btn-danger {
  background: #ff4d4d;
}
.btn-danger:hover {
  background: #d93838;
}


/* -----------------------------------------------
📌 4. Statuts visuels (modules, état)
-------------------------------------------------- */
.status {
  padding: 0.2em 0.6em;
  border-radius: 5px;
  font-weight: bold;
}

.on {
  background-color: #4caf50;
  color: white;
}
.off {
  background-color: #f44336;
  color: white;
}


/* -----------------------------------------------
📊 5. Tableau des infractions
-------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}

th, td {
  padding: 12px;
  text-align: center;
}

thead {
  background-color: #2b2d42;
  color: #ffffff;
}

tbody tr {
  background-color: #1e1f2b;
  border-bottom: 1px solid #333;
}

td:first-child {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

td img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

/* Correction bouton dans cellule */
form.inline-form {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

form button {
  background-clip: padding-box !important;
}


/* -----------------------------------------------
📐 6. Sidebar + responsive layout
-------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #1e1e2f;
  color: white;
  width: 220px;
  height: 100vh;
  padding: 1em;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1em;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

@media screen and (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.sidebar-header h1 {
  font-size: 1.2em;
  margin: 0;
  color: #ffcc00;
}

.sidebar-nav a {
  color: white;
  text-decoration: none;
  margin: 0.5em 0;
  display: block;
}
.sidebar-nav a:hover {
  text-decoration: underline;
}
.sidebar-nav a.active {
  background-color: #00bfff;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  font-weight: bold;
}


/* ☰ Burger menu mobile */
.burger {
  font-size: 1.5em;
  cursor: pointer;
  padding: 1em;
  background: #1e1e2f;
  color: white;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

@media screen and (max-width: 768px) {
  .burger {
    display: block;
  }

  body {
    padding-left: 1em;
    padding-right: 1em;
  }
}


/* -----------------------------------------------
🎯 7. Fixes visuels avancés (focus / bug form)
-------------------------------------------------- */
td:has(form:focus-within) {
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.config-block {
  background: #2a2a40;
  padding: 1.5em;
  margin-bottom: 2em;
  border-radius: 8px;
  box-shadow: 0 0 0 1px #3a3a50 inset;
}

.config-block h2 {
  margin-top: 0;
  color: #ffc107;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.config-block label {
  display: block;
  margin-top: 1em;
  font-weight: bold;
}

.config-block select,
.config-block input[type="text"] {
  margin-top: 0.5em;
  width: 100%;
  max-width: 400px;
}

.section-title {
  font-size: 1.4em;
  color: #61dafb;
  margin-bottom: 0.5em;
}

.sub-label {
  font-weight: normal;
  font-size: 0.9em;
  color: #bbb;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.sidebar-nav .tab-link {
  display: block;
  margin: 0.3em 0;
  padding: 0.4em 0.8em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  border-radius: 4px;
  text-decoration: none;
}

.sidebar-nav .tab-link:hover {
  background-color: #333;
}

.sidebar-nav .tab-link.active {
  background-color: #00bfff;
  font-weight: bold;
}

.home-intro {
  text-align: center;
  margin-top: 3em;
}

.home-intro .brand {
  color: #ffcc00;
}

.features {
  max-width: 600px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  color: #00bfff;
  margin-bottom: 1em;
}

.features ul {
  list-style: none;
  padding: 0;
}

.features ul li {
  background: #2a2a40;
  padding: 1em;
  margin-bottom: 0.8em;
  border-radius: 6px;
  border-left: 5px solid #00bfff;
  font-size: 1.05em;
}

.btn-primary {
  display: inline-block;
  margin-top: 1.5em;
  background: #00bfff;
  color: white;
  padding: 0.6em 1.2em;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #008ccc;
}
