/**
 * Kapela — Style : droits (niveaux aucun / lecture / modification, grille des rôles, droits d'une personne)
 * Auteur : Jacks Ngalangala
 */

/* ───── Niveaux de droits : —, lecture, modification ───── */
.niv {
  width: 36px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-ui);
  background: var(--surf);
  color: var(--muted);
  cursor: pointer;
  position: relative;
}
.niv.mini {
  width: 26px;
  height: 24px;
  cursor: default;
}
.niv:disabled {
  cursor: default;
  opacity: 0.75;
}
.niv-lecture {
  background: var(--sig);
  border-color: var(--sig);
  color: var(--gold);
}
.niv-modification {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--dark-t);
}
.niv.chg {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.niv-t {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.niv-t.niv-lecture,
.niv-t.niv-modification {
  background: none;
  color: var(--ink);
  font-weight: 600;
}
.niv-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}
.niv-leg > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Grille des droits (Paramètres → Équipe et droits) */
.droits-tw {
  max-height: 70vh;
  overflow: auto;
}
.tbl.droits {
  min-width: 100%;
}
.tbl.droits th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surf);
}
.droits .droits-r {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surf);
  min-width: 260px;
  max-width: 320px;
}
.droits th.droits-r {
  z-index: 3;
}
.droits td.droits-r b {
  display: block;
  font-size: 14px;
}
.droits td.droits-r small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.droits td.droits-r .badge {
  height: 20px;
  margin: 2px 0;
  font-size: 11px;
}
.droits-c {
  text-align: center;
  min-width: 96px;
}
.droits-h {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  white-space: nowrap;
}
.droits-h .iconbtn {
  width: 28px;
  height: 28px;
}
th.perso .droits-h b {
  color: var(--acc);
}
.droits-c.dif .niv::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
}
.droits-g td {
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--cap-ls);
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  left: 0;
}
tr.hf td {
  opacity: 0.7;
}
.droits-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-pop);
  background: var(--dark);
  color: var(--dark-t);
  box-shadow: var(--shadow);
}
.droits-bar .btn.ghost {
  color: var(--dark-t);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Droits d'une personne (fiche employé) */
.tbl.dper tr.dif td {
  background: var(--sig);
}
.dseg button {
  min-width: 40px;
  justify-content: center;
}
.dseg button:first-child {
  padding: 0 12px;
  font-size: 13px;
}

/* Paramètres en lecture seule : tous les champs et boutons de l'onglet sont désactivés */
.fs-lect {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Fenêtre d'édition en lecture seule (Modal lecture) : même espacement que le corps de la fenêtre */
.fs-modal {
  gap: 14px;
}
/* Les champs consultés sans pouvoir être changés : fond du papier, texte lisible, pas de main au survol */
.fs-modal :is(.inp, input, select, textarea):disabled {
  background: var(--bg);
  color: var(--ink);
  opacity: 1;
  cursor: default;
}
.fs-modal :is(label.btn, .btn, .switch) {
  pointer-events: none;
  opacity: 0.55;
}
.modal .mf .mf-lect {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 860px) {
  .droits .droits-r {
    min-width: 170px;
  }
  .droits td.droits-r small {
    display: none;
  }
  .droits-c {
    min-width: 64px;
  }
}
