* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a1f 0%, #14141a 100%);
  color: #e8e8ea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Barre de statut unique, en bas. Elle porte tout ce qui n'est pas une tuile
   (identite, version, compteur, actions, maj du launcher) : il n'y a
   volontairement pas d'entete, la fenetre fait 360 px de large et sa hauteur
   utile appartient aux cartes.
   Deux blocs : .status-line (identite + compteur) et .status-actions (boutons).
   En fenetre large ils partagent une ligne, actions calees a droite ; a 360 px
   (media query plus bas) chacun prend toute la largeur et les boutons se
   replient sur plusieurs rangees pleine largeur. */
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  /* Padding horizontal serre : a 360 px la marge se compte en pixels. */
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Identite a gauche, compteur a droite. min-width 0 : le bloc se comprime (nom
   en ellipse) plutot que de pousser les actions hors cadre. */
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #9a9aa3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto; /* largeur du contenu ; c'est le compteur qui est repousse a droite */
  min-width: 0; /* autorise le bloc identite a se comprimer plutot qu'a pousser le compteur hors cadre */
}

.logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4f8cff, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  color: #e8e8ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-version {
  font-size: 10px;
  font-weight: 400;
  color: #6c7086; /* gris discret */
  user-select: none;
}

#running-count {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Les boutons d'action. flex-wrap : ils se replient sur plusieurs rangees des
   que la ligne ne suffit plus, au lieu de deborder a droite hors fenetre
   (jusqu'a sept elements en admin local : chip bridge, TOTP, Droits,
   Deconnexion, Depots, Rafraichir, maj du launcher). */
.status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}

/* Fenetre etroite (360 px par defaut, colonne de droite de l'ecran) : identite
   et actions sur des lignes distinctes, et chaque bouton s'etire pour remplir
   sa rangee (aspect de barre d'outils reguliere plutot qu'une rangee en
   escalier). Les elements [hidden] sont en display:none et ne comptent pas.
   Le nom "Electron Launcher" reste visible : il partage sa ligne avec le seul
   compteur, et le compteur ne se replie jamais (nowrap) - c'est le nom qui
   se met en ellipse si la version ou l'avertissement users.json est long. */
@media (max-width: 480px) {
  .status-line,
  .status-actions {
    flex: 1 1 100%;
  }
  /* Selecteurs a deux classes : .btn-refresh / .btn-self-update / .bridge-control
     posent flex: 0 0 auto plus bas dans le fichier, a specificite egale un
     `.status-actions > *` perdrait. Boutons legerement plus petits (12 px) pour
     que l'admin local tienne en deux rangees meme avec les libelles longs
     ("Bridge erreur", "Deconnexion", "Mettre a jour (3)"). */
  .status-actions > .btn-refresh,
  .status-actions > .btn-self-update,
  .status-actions > .bridge-control {
    flex: 1 1 auto;
    font-size: 12px;
    padding-left: 9px;
    padding-right: 9px;
    text-align: center;
  }
  .status-actions {
    gap: 6px;
  }
  /* Le chip bridge etire : pastille + libelle colles a gauche (le libelle prend
     la place restante), bouton start/stop a droite. */
  .status-actions > .bridge-control {
    padding-right: 4px;
  }
  .status-actions > .bridge-control .bridge-info {
    flex: 1 1 auto;
    text-align: left;
  }
}

.btn-refresh {
  flex: 0 0 auto;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4dc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}

.btn-refresh:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* Le bridge et son bouton start/stop forment UN groupe visuel : un chip borde
   avec une pastille d'etat coloree, nettement distinct des boutons d'action
   generiques (Depots/Rafraichir) pour qu'on comprenne d'un coup d'oeil que le
   bouton pilote le bridge. */
.bridge-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 3px 5px 3px 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.bridge-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6e7681; /* defaut : arrete / gris */
}
.bridge-dot.is-on { background: #3fb950; box-shadow: 0 0 6px rgba(63, 185, 80, 0.55); }
.bridge-dot.is-waiting { background: #d29922; box-shadow: 0 0 6px rgba(210, 153, 34, 0.55); }
.bridge-dot.is-error { background: #f85149; box-shadow: 0 0 6px rgba(248, 81, 73, 0.55); }

.bridge-info { font-size: 11px; opacity: 0.85; align-self: center; white-space: nowrap; }

/* Toggle interne au chip : plus petit et plus discret que .btn-refresh pour
   rester subordonne au groupe bridge plutot que de rivaliser avec les actions. */
.bridge-toggle {
  flex: 0 0 auto;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #d4d4dc;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.bridge-toggle:hover:not(:disabled) { background: rgba(255, 255, 255, 0.17); }
.bridge-toggle:disabled { opacity: 0.5; cursor: progress; }

/* Bouton contextuel de maj du launcher. Meme gabarit que .btn-refresh ; seules la
   couleur et la bordure changent selon l'etat, en reprenant la palette des badges
   git des cartes (ambre = en retard, vert = a jour, rouge = diverge). */
.btn-self-update {
  flex: 0 0 auto;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #9a9aa3;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}

/* Les etats non actionnables restent lisibles (pas d'opacite ecrasee) : ils
   portent une information, ils ne sont pas "en attente". */
.btn-self-update:disabled {
  cursor: default;
}

.btn-self-update.is-uptodate { color: #22c55e; }
.btn-self-update.is-ahead { color: #4f8cff; }
.btn-self-update.is-diverged { color: #ef4444; }
.btn-self-update.is-updating { color: #6c7086; cursor: progress; }

.btn-self-update.is-available {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

/* En retard mais repo modifie : bouton inactif, on garde la couleur d'alerte sans
   le relief cliquable. */
.btn-self-update.is-available:disabled {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-self-update.is-available:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.22);
}

.btn-self-update.is-restart {
  color: #4f8cff;
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.45);
}

.btn-self-update.is-restart:hover {
  background: rgba(79, 140, 255, 0.24);
}

.cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  /* Rangees a hauteur de contenu : sans ca elles se compriment (card overflow:hidden) au lieu de deborder, et la detection du mode compact ne declenche jamais */
  grid-auto-rows: max-content;
  gap: 18px;
  padding: 28px;
  overflow-y: auto;
  align-content: start;
}

/* Etat vide pour un non-admin sans aucun droit coche (M1, revue) : la grille
   n'est jamais muette, l'utilisateur comprend qu'il faut demander l'acces. */
.cards-empty {
  grid-column: 1 / -1;
  padding: 20px;
  font-size: 13px;
  opacity: 0.7;
  text-align: center;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer; /* la carte est cliquable : bascule sa densite (compact/etendu) */
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent, #4f8cff);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

/* Tuile en lecture seule a distance (app sans webPath, IS_REMOTE) : grisee,
   sans soulevement au survol. L'icone est deja `disabled` (button:disabled
   attenue a 0.4) : on lui rend son opacite pour ne pas cumuler les deux voiles. */
.card.is-remote-locked {
  opacity: 0.45;
}
.card.is-remote-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.card.is-remote-locked .card-icon:disabled {
  opacity: 1;
  filter: grayscale(0.6);
}

/* Glisser-deposer (spec 2026-09-13 groupes) : element saisi estompe, trait
   d'insertion au-dessus ou en dessous de la cible, cadre bleu pour "dans ce
   groupe". Un box-shadow plat plutot qu'un pseudo-element : ::before de .card
   porte deja la bande d'accent et overflow:hidden ne clippe pas l'ombre de
   l'element lui-meme. */
.card.is-dragging,
.group.is-dragging {
  opacity: 0.4;
}
.card.drop-before,
.group.drop-before {
  box-shadow: 0 -4px 0 0 #4f8cff;
}
.card.drop-after,
.group.drop-after {
  box-shadow: 0 4px 0 0 #4f8cff;
}
.group.drop-into,
.group-empty.drop-into {
  box-shadow: inset 0 0 0 2px #4f8cff;
}

/* Tuile membre d'un groupe ouvert : retrait a gauche, pour lire d'un coup
   d'oeil ou le groupe s'arrete et ou les tuiles libres reprennent. */
.card.is-grouped {
  margin-left: 18px;
}

/* Groupes de tuiles (spec 2026-09-13 groupes). L'en-tete est une rangee pleine
   largeur de la grille, suivie de ses tuiles ; ferme, seules l'en-tete reste. */
.group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #9a9aa3;
}
.group:hover {
  background: rgba(255, 255, 255, 0.06);
}

.group-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
/* Chevron CSS (pas de glyphe) : ouvert = pointe en bas, ferme = pointe a droite. */
.group-toggle .chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid #9a9aa3;
  border-bottom: 2px solid #9a9aa3;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.12s ease;
}
.group.is-collapsed .chevron {
  transform: translateX(-2px) rotate(-45deg);
}

.group-name {
  font-weight: 600;
  color: #e8e8ea;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-count {
  flex: 1 1 auto;
  font-size: 12px;
  white-space: nowrap;
}

/* Croix discrete, visible au survol de l'en-tete ; armee = libelle orange. */
.group-delete {
  flex: 0 0 auto;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #9a9aa3;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.group:hover .group-delete,
.group-delete.is-confirming {
  opacity: 1;
}
.group-delete:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8ea;
}
.group-delete.is-confirming {
  font-size: 12px;
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

/* Champ de saisie en ligne (renommage, creation). */
.group-input {
  font: inherit;
  font-size: 13px;
  color: #e8e8ea;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(79, 140, 255, 0.6);
  border-radius: 6px;
  padding: 3px 7px;
  min-width: 0;
  width: 100%;
  max-width: 240px;
  outline: none;
}

/* Groupe ouvert et vide : zone de depot explicite. */
.group-empty {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 12px;
  color: #6c7086;
  text-align: center;
}

/* Ligne fantome de creation, en bas de la grille (locale seulement). */
.group-new {
  grid-column: 1 / -1;
}
.group-new-btn {
  width: 100%;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #6c7086;
  font: inherit;
  font-size: 12px;
  padding: 8px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.group-new-btn:hover {
  color: #9a9aa3;
  border-color: rgba(255, 255, 255, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent, #4f8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  flex: 0 0 auto; /* override du button global (flex:1) : l'icone garde sa taille */
  background-size: cover;
  background-position: center;
  /* Icone = bouton lancer/arreter */
  position: relative;
  padding: 0;
  border: none;
  cursor: pointer;
}

/* Voile sombre au survol (sauf si desactivee) */
.card-icon:not(:disabled)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.card-icon:not(:disabled):hover::before {
  opacity: 1;
}

/* Glyphe d'action, visible au survol : triangle (lancer) ou carre (arreter) */
.card-icon:not(:disabled)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.card-icon:not(:disabled):hover::after {
  opacity: 1;
}

/* Arretee -> triangle "lancer" */
.card-icon:not(.running)::after {
  transform: translate(-40%, -50%);
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

/* En cours -> carre "arreter" */
.card-icon.running::after {
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 2px;
}

/* Pastille verte "en cours" incrustee dans le coin de l'icone */
.run-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #14141a; /* decoupe sur le fond de la carte */
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
  pointer-events: none;
}

/* Etiquette "web" incrustee en bas a droite de l'icone : l'app est accessible
   via le bridge (webPath dans apps.json), dans les deux vues. Coin oppose au
   run-dot (haut droit reserve a "en cours"), meme decoupe sur le fond de carte.
   Bleu ciel : couleur reservee, distincte du vert (en cours), de l'orange
   (avertissement/confirmation) et du rouge (erreur). */
.web-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  height: 12px;
  line-height: 12px;
  padding: 0 4px;
  border-radius: 7px;
  background: #0ea5e9;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 2px solid #14141a; /* decoupe sur le fond de la carte */
  box-sizing: content-box;
  pointer-events: auto; /* porte sa propre infobulle */
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-status {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* version/statut colles au bord droit de la carte */
  gap: 6px;
  font-size: 11px;
  color: #9a9aa3;
  margin-top: 4px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
}

.card-version {
  color: #6c7086; /* gris discret, comme la version du launcher */
  user-select: none;
}

.git-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  white-space: nowrap;
}

/* Pastille coloree devant le libelle ; sa couleur suit le texte (currentColor),
   ce qui permet de la garder visible quand le texte est masque en compact. */
.git-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  flex-shrink: 0;
}

.git-uptodate { color: #22c55e; }
.git-ahead    { color: #4f8cff; }
.git-behind   { color: #f59e0b; }
.git-diverged { color: #ef4444; }
.git-untracked { color: #6c7086; }

/* Badge actionnable : meme rendu que le span (la couleur vient de .git-behind,
   on ne redefinit surtout pas color ici sinon on ecraserait la classe d'etat). */
button.git-badge {
  flex: 0 0 auto; /* override du button global (flex:1) : le badge garde sa taille de contenu, la ligne meta reste alignee a droite */
  border: none;
  background: none;
  padding: 2px 5px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

button.git-badge:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* Mise a jour en vol : libelle attenue, pastille grise, non cliquable. */
.git-updating { color: #6c7086; }

.meta-sep { color: #6c7086; }

.git-dirty { color: #eab308; } /* jaune : modifications locales non commitees */

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
}

.dot.running {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.dot.error {
  background: #ef4444;
}

.card-desc {
  font-size: 13px;
  color: #b8b8bf;
  line-height: 1.5;
  flex: 1;
}

.card-warning {
  font-size: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

button {
  flex: 1;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
  font-family: inherit;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  /* Au-dessus de la barre de statut, y compris quand elle passe sur deux lignes
     en fenetre etroite (~76 px). */
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- Mode compact ----
   Deux niveaux, pilotes par app.js :
   - .cards.compact (conteneur) : layout de grille en une colonne. Reflete la
     densite de BASE globale (auto-fit : actif quand tout-etendu deborderait).
   - .card.is-compact (par carte) : layout interne compact d'une carte donnee.
     Chaque carte est compactee = son override eventuel, sinon la base globale,
     ce qui permet d'etendre/compacter une seule carte au clic.
   Meme DOM que le mode normal : tout le compactage se fait ici. */

.cards.compact {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px 16px;
}

.card.is-compact {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
}

/* La barre d'accent passe du bord haut au bord gauche */
.card.is-compact::before {
  right: auto;
  bottom: 0;
  width: 4px;
  height: auto;
}

.card.is-compact:hover {
  transform: none;
}

.card.is-compact .card-header {
  flex: 1;
  min-width: 0;
  gap: 10px;
}

/* Le wrapper titre+statut passe en ligne et occupe toute la largeur dispo */
.card.is-compact .card-header > div:not(.card-icon) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card.is-compact .card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

.card.is-compact .card-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1; /* pousse version + points vers le bord droit de la ligne */
  min-width: 0;
}

/* font-size: 0 masque le texte du statut ; le dot (dimensions fixes) reste */
.card.is-compact .card-status {
  margin-top: 0;
  font-size: 0;
  gap: 0;
}

.card.is-compact .card-desc {
  display: none;
}

/* Warning reduit a une pastille orange ; le message complet est dans title */
.card.is-compact .card-warning {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  padding: 0;
  border-left: none;
  border-radius: 50%;
  background: #f59e0b;
  font-size: 0;
  overflow: hidden;
}

/* Glyphe d'action reduit dans l'icone plus petite du mode compact */
.card.is-compact .card-icon:not(.running)::after {
  border-left-width: 11px;
  border-top-width: 7px;
  border-bottom-width: 7px;
}

.card.is-compact .card-icon.running::after {
  width: 11px;
  height: 11px;
}

.card.is-compact .run-dot {
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
}

/* En compact l'etiquette "web" se reduit a un point bleu ciel (texte a
   font-size 0, meme technique que les badges), 10 px bordure comprise comme le
   run-dot compact. */
.card.is-compact .web-tag {
  bottom: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  line-height: 6px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
}

/* En compact : la version reste lisible (objectif : toujours voir la version) ;
   seuls le separateur et le marqueur "modifie" sont masques, et le badge git
   se reduit a sa pastille coloree (texte a font-size 0, ::before garde ses px).
   Le detail complet reste dans l'infobulle du badge. */
.card.is-compact .card-meta {
  margin-top: 0;
  gap: 6px; /* espace entre la version et la pastille git */
}

.card.is-compact .meta-sep {
  display: none;
}

/* En compact le texte "modifie" est masque, mais dirty ne change pas la couleur
   de la pastille d'etat : on materialise dirty par une 2e pastille jaune pour
   qu'il reste visible (meme langage visuel qu'une pastille par dimension). */
.card.is-compact .git-dirty {
  font-size: 0;
}

.card.is-compact .git-dirty::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor; /* #eab308 jaune, herite de .git-dirty */
  flex-shrink: 0;
}

.card.is-compact .card-version {
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0; /* la version ne se coupe pas ; c'est le titre qui ellipse */
}

.card.is-compact .git-badge {
  font-size: 0;
}

.card.is-compact .git-badge::before {
  margin-right: 0;
}

/* Exception en compact : un badge actionnable garde son libelle. Sans ca la
   cible de clic se reduit a la pastille de 8px. */
.card.is-compact button.git-badge {
  font-size: 10px;
  padding: 1px 4px;
}

.card.is-compact button.git-badge::before {
  margin-right: 4px;
}

/* ---- Vue Depots ---- */

/* .cards a display:grid et .repos-view display:flex : sans cette regle, l'attribut
   hidden (display:none du style UA, moins specifique) serait ecrase et les deux
   vues s'empileraient. */
.cards[hidden],
.repos-view[hidden] {
  display: none;
}

/* Meme piege : .bridge-control est en inline-flex, son display ecraserait le
   [hidden] UA - sans quoi le chip resterait visible en mode distant. */
.bridge-control[hidden] { display: none; }

.repos-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  overflow-y: auto;
}

/* Bandeau "GitHub inaccessible" en tete de vue (mode degrade local seulement). */
.repos-banner {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Barre d'actions globales (Tout recuperer / Tout pousser). */
.repos-global {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.repos-global button {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4dc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.repos-global button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.repos-global button:disabled { opacity: 0.5; cursor: progress; }

/* Premier clic donne : le bouton passe en confirmation, les lignes concernees
   se surlignent (.repo-row.is-confirming). */
.repos-global button.is-confirming {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

.repos-section-title {
  margin: 10px 2px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c7086;
}

/* Entetes repliables (A jour, Ignores) : meme gabarit, mais cliquables. */
button.repos-section-title {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  padding: 0;
}

button.repos-section-title:hover { color: #9a9aa3; }

.repo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.repo-row.is-confirming {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.07);
}

.repo-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d4d4dc;
}

/* Le badge git reprend les classes .git-* existantes (meme vocabulaire visuel
   que les cartes). Ici on borne juste sa taille. */
.repo-row .git-badge { font-size: 12px; flex: 0 0 auto; }

/* Resultat de la derniere action sur la ligne (ok ou premiere ligne d'erreur). */
.repo-result { font-size: 11px; flex: 0 0 auto; }
.repo-result.ok { color: #22c55e; }
.repo-result.err { color: #ef4444; }

.repo-row .repo-action {
  flex: 0 0 auto;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4dc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.repo-row .repo-action:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.repo-row .repo-action:disabled { opacity: 0.5; cursor: progress; }

/* Ignorer : action discrete, visible au survol de la ligne seulement. */
.repo-row .repo-ignore {
  flex: 0 0 auto;
  padding: 3px 6px;
  background: none;
  color: #6c7086;
  border: none;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  visibility: hidden;
}

.repo-row:hover .repo-ignore { visibility: visible; }
.repo-row .repo-ignore:hover { color: #d4d4dc; }

/* Page de connexion du bridge web */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { display: flex; flex-direction: column; gap: 14px; width: min(360px, 90vw); padding: 24px; border-radius: 12px; background: rgba(255,255,255,0.04); }
.login-box label { font-size: 12px; opacity: 0.8; }
.login-box input { padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.3); color: inherit; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; }
.login-box section { display: flex; flex-direction: column; gap: 8px; }
/* Sans cette regle, le display ci-dessus ecrase le [hidden] du style UA (moins
   specifique) et le formulaire d'enrolement reste visible en permanence. Meme
   piege que .cards / .repos-view. */
.login-box section[hidden] { display: none; }
.login-msg { margin: 0; font-size: 13px; opacity: 0.85; }
.login-msg.is-error { color: #f87171; opacity: 1; }
/* Lien discret vers l'enrolement TOTP (postes sans Bluetooth). Pas de display
   explicite : le [hidden] du style UA doit continuer de le masquer. */
.login-link { background: none; border: none; padding: 0; color: #7dd3fc; font-size: 12px; cursor: pointer; text-decoration: underline; align-self: flex-start; }
.login-link:hover { color: #bae6fd; }

/* Modale locale de configuration TOTP. Meme piege que .cards/.repos-view :
   le display:flex ci-dessous ecraserait le [hidden] UA sans la regle dediee. */
.totp-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.65); z-index: 50; }
.totp-modal[hidden] { display: none; }
.totp-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: 12px; background: #1c1f26; border: 1px solid rgba(255,255,255,0.12); width: min(300px, 92vw); text-align: center; }
.totp-box h2 { margin: 0; font-size: 15px; }
.totp-box p { margin: 0; font-size: 12px; opacity: 0.8; }
.totp-box img { border-radius: 8px; background: #fff; }
.totp-secret code { font-size: 11px; word-break: break-all; user-select: text; }

/* Modale de progression du bouton Rafraichir. Meme gabarit que .totp-modal, meme
   piege [hidden]. La liste des etapes est le conteneur qui defile : app.js remplace
   ses enfants a chaque evenement, a hauteur constante, donc le defilement tient. */
.refresh-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.65); z-index: 50; }
.refresh-modal[hidden] { display: none; }
.refresh-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 12px; background: #1c1f26; border: 1px solid rgba(255,255,255,0.12); width: min(320px, 92vw); max-height: 86vh; }
.refresh-box h2 { margin: 0; font-size: 15px; text-align: center; }
.refresh-box .btn-refresh { align-self: center; }
.refresh-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; font-size: 13px; }
/* Etape et depot : colonne d'etat fixe (pastille, anneau ou ok/echec) + libelle. */
.progress-step, .progress-item { display: grid; grid-template-columns: 40px 1fr; align-items: baseline; column-gap: 6px; }
.progress-step.is-wait { opacity: 0.45; }
.progress-label { min-width: 0; overflow-wrap: anywhere; }
.progress-detail { display: block; font-size: 11px; opacity: 0.75; }
.progress-items { grid-column: 1 / -1; margin: 4px 0 0; padding: 0 0 0 12px; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.progress-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-state { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.is-ok > .progress-state { color: #22c55e; }
.is-fail > .progress-state { color: #ef4444; }
.is-fail > .progress-name, .is-fail > .progress-label { color: #f87171; }
/* En cours : petit anneau qui tourne ; en attente : pastille grise. */
.is-run > .progress-state::before,
.is-wait > .progress-state::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }
.is-run > .progress-state::before { border: 2px solid rgba(255,255,255,0.2); border-top-color: #4f8cff; animation: progressSpin 0.8s linear infinite; }
.is-wait > .progress-state::before { width: 6px; height: 6px; margin-left: 2px; background: rgba(255,255,255,0.35); }
@keyframes progressSpin { to { transform: rotate(360deg); } }
.refresh-summary { margin: 0; font-size: 12px; text-align: center; opacity: 0.85; }
.refresh-summary.is-error { color: #f87171; opacity: 1; }
.refresh-summary.is-ok { color: #22c55e; opacity: 1; }

/* Badge "Arreter" (mode distant, app pontee en cours) : l'icone de la tuile
   porte l'ouverture de l'onglet, l'arret est ce geste secondaire. Rouge au
   repos, orange en attente de confirmation (meme vocabulaire que la vue
   Depots). */
button.git-badge.stop-badge { color: #f87171; cursor: pointer; }
button.git-badge.stop-badge:hover { background: rgba(248, 113, 113, 0.15); }
button.git-badge.stop-badge.is-confirming {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

/* Arret en deux clics : premier clic sur l'icone d'une app en cours, la carte
   passe en confirmation - anneau orange et glyphe carre affiches en permanence
   (pas de survol sur tactile), question dans la ligne de statut. */
.card-icon.is-confirming {
  outline: 2px solid rgba(245, 158, 11, 0.85);
  outline-offset: 2px;
}
.card-icon.is-confirming::before { opacity: 1; }
.card-icon.is-confirming::after { opacity: 1; background: #f59e0b; }

.card-status .confirm-stop { color: #f59e0b; }

/* A distance, l'icone d'une app pontee en cours ouvre l'onglet (se greffer) :
   glyphe chevron "ouvrir" au lieu du carre arreter. En compact, la regle
   .card.is-compact .card-icon.running::after (plus specifique) ne reajuste que
   width/height : le chevron reste un chevron, juste plus petit. */
.card-icon.is-open-web::after {
  width: 13px;
  height: 13px;
  background: none;
  border-radius: 0;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
  transform: translate(-60%, -40%); /* tip du chevron (coin haut-droit) recentre */
}

/* apps.json illisible cote main (self-status.appsError) : le compteur de la barre
   passe en orange, le detail vit dans son infobulle. Meme classe pour une erreur
   ou une copie de conflit users.json (renderUsersWarning). */
#running-count.has-error { color: #f59e0b; }
/* Repli local de users.json (SharePoint absent) : avertissement, pas une erreur -
   meme teinte ambre que has-error (ni l'un ni l'autre n'est une alarme rouge),
   classe distincte pour ne pas emprunter la semantique "erreur". */
#running-count.has-warn { color: #f59e0b; }

/* Vue Depots a distance : pull et clone sont reserves au poste ; un libelle
   passif remplace le bouton (revue M11). */
.repo-action-poste { opacity: 0.55; cursor: default; font-style: italic; }

/* ---- Porte de connexion et vue Droits (spec utilisateurs-et-droits) ---- */

/* Meme piege que .totp-modal : display:flex ecraserait le [hidden] UA. */
.user-gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a1f 0%, #14141a 100%); z-index: 40; }
.user-gate[hidden] { display: none; }
.user-gate-box { display: flex; flex-direction: column; gap: 10px; width: min(300px, 92vw); padding: 20px; border-radius: 12px; background: #1c1f26; border: 1px solid rgba(255,255,255,0.12); text-align: center; }
.user-gate-box h2 { margin: 0 0 6px; font-size: 15px; }
.user-gate-list { display: flex; flex-direction: column; gap: 8px; }
.user-choice { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: rgba(255,255,255,0.06); color: #e8e8ea; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.user-choice:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.user-choice:disabled { opacity: 0.5; cursor: progress; }
.user-role { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.06em; }
.user-gate-error { margin: 0; font-size: 12px; color: #f87171; }
.user-gate-error[hidden] { display: none; }

/* Vue Droits : troisieme vue, meme piege [hidden] que .repos-view. */
.rights-view { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; overflow-y: auto; }
.rights-view[hidden] { display: none; }
.rights-banner { padding: 8px 10px; border-radius: 8px; font-size: 12px; color: #9ca3af; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); word-break: break-all; }
.rights-banner.is-warn { color: #f59e0b; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35); }
.rights-banner.is-error { color: #f87171; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.35); }
.rights-hint { margin: 4px 2px; font-size: 12px; opacity: 0.7; }
.rights-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rights-table th { padding: 6px 4px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.rights-table th:not(:first-child), .rights-table td:not(:first-child) { text-align: center; width: 64px; }
.rights-table td { padding: 6px 4px; border-top: 1px solid rgba(255,255,255,0.06); }
.rights-app { display: flex; align-items: center; gap: 8px; }
.rights-icon { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--accent, #4f8cff) center / cover no-repeat; }
.rights-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: #4f8cff; cursor: pointer; }
.rights-table input[type="checkbox"]:disabled { opacity: 0.5; cursor: progress; }
