/* ProjectOS — comptes : écran de connexion, page d'invitation, « Mon compte », « Administration »,
   boîtes de dialogue (.ac-dialog). Classes préfixées .ac- (sauf compléments de .login-card). */

/* --- Connexion et invitation ------------------------------------------------------------------- */
.login-card .ctl { font-family: var(--f-body); }
.login-intro { color: var(--ok) !important; font-weight: 600; }
.ac-field { display: grid; gap: 5px; min-width: 0; }
.ac-field > label { font-weight: 600; font-size: 13px; }
.ac-field .ctl { width: 100%; min-height: 38px; }
.ac-pass { position: relative; display: flex; align-items: center; }
.ac-pass .ctl { padding-right: 84px; }
.ac-eye { position: absolute; right: 4px; min-width: 70px; }
.ac-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.ac-error { margin: 0; color: var(--accent); font-weight: 600; }
.ac-who { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.ac-who .mono { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ac-invite-form { display: grid; gap: 12px; }
/* Titres qui reçoivent le focus par programme (annonce du changement d'écran) : pas de cadre. */
.login-card h1:focus, .view-title h1:focus, .ac-link h2:focus { outline: none; }

.ac-rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }
.ac-rules li { display: flex; align-items: center; gap: 7px; }
.ac-rules li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); flex: 0 0 auto;
}
.ac-rules li.ok { color: var(--ok); }
.ac-rules li.ok::before { content: "✓"; border: 0; width: auto; height: auto; font-weight: 700; font-size: 11px; }
.ac-rules li.ko { color: var(--accent); }
.ac-rules li.ko::before { border-color: var(--accent); background: var(--accent-soft); }

/* --- Menu utilisateur --------------------------------------------------------------------------- */
.menu-role { font-size: 11px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent) !important; }

/* --- Mise en page des vues ---------------------------------------------------------------------- */
.ac-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; max-width: 1180px; }
.ac-col { display: grid; gap: 16px; min-width: 0; }
.ac-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  display: grid; gap: 12px; min-width: 0;
}
.ac-card > h2 { font-size: 17px; font-weight: 700; }
.ac-form { display: grid; gap: 12px; max-width: 460px; }
.ac-inline { grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: none; }
.ac-inline > .ac-actions { margin-top: 23px; }
.ac-inline .ac-actions .btn { min-height: 38px; }
.ac-inline .ac-error { grid-column: 1 / -1; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ac-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.ac-dl dt { color: var(--muted); font-weight: 600; font-size: 13px; }
.ac-dl dd { margin: 0; overflow-wrap: anywhere; }
.ac-empty { margin: 0; color: var(--muted); }
.ac-warn { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); }

/* Jeton fraîchement créé */
.ac-fresh { display: grid; gap: 10px; padding: 14px; border-radius: 10px; border: 2px solid var(--ok); background: var(--ok-soft); }
.ac-fresh h3 { font-size: 15.5px; }
.ac-fresh h4 { font-family: var(--f-display); font-size: 14px; margin: 4px 0 0; }
.ac-fresh h3:focus { outline: none; }
.ac-copy { display: flex; gap: 6px; min-width: 0; }
.ac-copy-v { flex: 1; min-width: 0; font-size: 12.5px; }
.ac-fresh, .ac-fresh > *, .ac-card > * { min-width: 0; }
.ac-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; min-width: 0; }
.ac-steps li { padding-left: 2px; min-width: 0; }
.ac-steps .ac-hint { margin-top: 6px; }
.ac-codebox { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; min-width: 0; }
.ac-code {
  flex: 1; min-width: 0; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); overflow-x: auto; font-size: 12px; white-space: pre;
}
.ac-code code { background: none; padding: 0; }

/* Tableaux (jetons, membres) */
.ac-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ac-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.ac-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ac-table tbody tr:last-child td { border-bottom: 0; }
.ac-table .ac-num { text-align: right; font-variant-numeric: tabular-nums; }
.ac-td-act { text-align: right; }
.ac-users-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ac-users-box > .ac-empty, .ac-users-box > .ac-error { padding: 24px; }
.ac-users td:first-child { min-width: 230px; }
.ac-member { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ac-member-t { display: grid; min-width: 0; }
.ac-mail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ac-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ac-off td { color: var(--muted); }
.ac-off .avatar { opacity: .5; }
.ac-state { font-size: 12.5px; font-weight: 600; }
.ac-state::before { content: "● "; }
.ac-state.on { color: var(--ok); }
.ac-state.wait { color: var(--warn-ink); }
.ac-state.none { color: var(--muted); }
.ac-state.off { color: var(--accent); }
.ac-link { border: 2px solid var(--ok); background: var(--ok-soft); margin-bottom: 14px; }
.ac-link h2:focus { outline: none; }
.ac-link p { margin: 0; }
.ac-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.ac-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* --- Boîtes de dialogue ------------------------------------------------------------------------- */
.ac-dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
.ac-dialog::backdrop { background: #0b0e23; opacity: .5; }
.ac-dialog-in { display: grid; gap: 12px; padding: 20px 22px; }
.ac-dialog-in h2 { font-size: 18px; }
.ac-dialog-in p { margin: 0; color: var(--muted); }
.ac-dialog-in .ac-error { color: var(--accent); }
.ac-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn.danger-fill { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* --- Responsive --------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  /* Tableaux en cartes : chaque cellule porte son libellé (data-l). */
  .ac-table thead { display: none; }
  .ac-table, .ac-table tbody, .ac-table tr, .ac-table td { display: block; width: 100%; }
  .ac-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .ac-table tbody tr:last-child { border-bottom: 0; }
  .ac-table td { border: 0; padding: 3px 0; text-align: left; }
  .ac-table td[data-l]:not([data-l="Membre"]):not([data-l="Libellé"])::before {
    content: attr(data-l) " : "; color: var(--muted); font-size: 12px; font-weight: 600;
  }
  .ac-table .ac-num { text-align: left; }
  .ac-td-act { padding-top: 8px !important; }
  .ac-row-actions { justify-content: flex-start; }
  .ac-inline { grid-template-columns: minmax(0, 1fr); }
  .ac-card { padding: 14px; }
}

/* Groupe de cases à cocher d'un dialogue (projets à ouvrir à l'invitation) */
.ac-cases { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.ac-cases legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.ac-cases .ac-check { font-weight: 500; }
