:root {
  --vert: #BCC63F;
  --noir: #111111;
  --gris: #F2F2F2;
  --gris-fonce: #555;
  --rouge: #DC2626;
  --bleu: #3B82F6;
  --jaune: #EAB308;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gris);
  color: var(--noir);
}

header {
  background: var(--noir);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .logo { color: var(--vert); font-weight: 700; font-size: 1.1rem; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }

.card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.btn {
  background: var(--vert);
  color: var(--noir);
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.btn:active { opacity: 0.8; }
.btn-secondary { background: var(--gris); }
.btn-danger { background: var(--rouge); color: white; }

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.dossard-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.dossard-pad button {
  padding: 18px;
  font-size: 1.4rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
}

.dossard-affichage {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  min-height: 1.4em;
}

.cartons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.carton-btn {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.carton-btn.selected { outline: 4px solid var(--noir); }

.incident-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-left: 6px solid #ccc;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
}
.incident-item.en-attente { border-left-color: var(--jaune); }
.incident-item.traite { border-left-color: var(--vert); opacity: 0.6; }

.tag-zone { font-size: 0.75rem; color: var(--gris-fonce); }

nav.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
nav.tabs a {
  padding: 8px 14px;
  border-radius: 20px;
  background: white;
  color: var(--noir);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
nav.tabs a.active { background: var(--noir); color: var(--vert); }

.calendrier-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendrier-jour-nom {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gris-fonce);
  padding: 4px 0;
}
.calendrier-case {
  min-height: 68px;
  background: white;
  border-radius: 6px;
  padding: 4px;
  border: 1px solid #eee;
}
.calendrier-case.hors-mois { background: #f7f7f7; border-color: transparent; }
.calendrier-case.aujourdhui { border-color: var(--vert); border-width: 2px; }
.calendrier-numero { font-weight: 600; font-size: 0.75rem; margin-bottom: 3px; color: var(--gris-fonce); }
.calendrier-case.hors-mois .calendrier-numero { color: #ccc; }
.calendrier-comp {
  display: block;
  padding: 2px 5px;
  border-radius: 4px;
  color: white;
  font-size: 0.65rem;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendrier-legende {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

@media (max-width: 480px) {
  .calendrier-case { min-height: 50px; font-size: 0.7rem; }
  .calendrier-comp { font-size: 0.58rem; }
}

.suggestions-dropdown {
  position: absolute;
  left: 0; right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  display: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.suggestion-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f2f2f2; font-size: 0.9rem; }
.suggestion-item:hover { background: var(--gris); }
.suggestion-item.suggestion-vide { color: var(--gris-fonce); cursor: default; font-style: italic; }
.suggestion-item.suggestion-vide:hover { background: white; }

.chip-selection {
  display: flex; align-items: center; justify-content: space-between;
  background: #eef4d1; border: 1px solid var(--vert);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 0.9rem;
}
.chip-fermer { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--gris-fonce); padding: 0 4px; }

.arbitre-carte {
  display: flex; gap: 12px; align-items: flex-start;
  background: white; border-radius: 10px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.arbitre-avatar {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--vert); color: var(--noir); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.arbitre-infos { flex: 1; min-width: 0; }
.arbitre-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 5px 0 9px; }
.arbitre-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-petit { padding: 6px 10px; font-size: 0.76rem; }

.couverture-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid #f2f2f2;
}
.couverture-item:last-child { border-bottom: none; }
.couverture-item.couverture-vide { background: #fef2f2; border-radius: 6px; padding: 8px; }

.edition-affectation { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.edition-affectation select { margin-bottom: 0; }

.grille-types-epreuve {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.type-epreuve-carte {
  background: white;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.type-epreuve-carte:hover { border-color: var(--vert); }
.type-epreuve-carte.selectionnee { border-color: var(--noir); background: #fafafa; }
.type-epreuve-carte.archivee { opacity: 0.5; }
.type-epreuve-nom { font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.type-epreuve-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 20px; }
.type-epreuve-badge-carton {
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  font-weight: 600;
}
.type-epreuve-carte-action {
  font-size: 0.72rem;
  text-decoration: underline;
  color: var(--gris-fonce);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
