/* outil-rh — feuille de style minimale (login + page protégée). */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #57606a;
  --accent: #0b6bcb;
  --border: #d0d7de;
  --danger: #b5330b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Liberation Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
code {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  background: #eef1f4; border: 1px solid #e2e7ec; border-radius: 4px;
  padding: .08em .35em; font-size: .9em; color: var(--danger);
}

/* ── Barre supérieure (page app) ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand-name { font-weight: 800; letter-spacing: .3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: .9rem; }

.btn {
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.btn:hover { background: #f0f3f6; }
.btn.ghost { color: var(--muted); }

/* ── Contenu ── */
.container { max-width: 820px; margin: 32px auto; padding: 0 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 30px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card h1 { margin: 0 0 .5em; font-size: 1.6rem; }
.card ul { padding-left: 1.2em; }
.card li { margin: .3em 0; }
.muted { color: var(--muted); font-size: .92rem; margin-top: 1.4em; }
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  background: #e7f0fb; color: var(--accent); font-size: .82rem; font-weight: 600;
}

/* ── Page de connexion ── */
.login-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.login-card .brand-name { font-size: 1.15rem; margin-bottom: 18px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; text-align: left; }
.login-brand .brand-name { margin-bottom: 0; }
.login-brand img, .brand-logo { height: 42px; width: auto; max-width: 200px; }
.brand-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.login-title { margin: .2em 0; font-size: 1.7rem; }
.login-subtitle { color: var(--muted); margin: 0 0 24px; }
.sso-error {
  background: #fdecea; color: #8a1c0a; border: 1px solid #f5c6bf;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; font-size: .9rem;
}
.ms-btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 600;
}
.ms-btn:hover { background: #f0f3f6; }

/* ── Utilitaires ── */
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.alert {
  background: #fdecea; color: #8a1c0a; border: 1px solid #f5c6bf;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: .92rem;
}
.notice {
  background: #eaf2fd; color: #0b4a8a; border: 1px solid #c6dbf5;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: .92rem;
}
#overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(244, 246, 248, .72);
  display: flex; align-items: center; justify-content: center;
}
.loader {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Usurpation d'identité (« voir comme… ») ── */
/* Bandeau pleine largeur, en tête de page : volontairement impossible à manquer.
   Quelqu'un qui oublierait qu'il regarde l'écran avec les droits d'un autre en
   tirerait des conclusions fausses. C'est le seul garde-fou côté interface. */
.imperso-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 10px 20px;
  background: #8a5a12; color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.imperso-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.imperso-txt strong { font-size: .95rem; font-weight: 700; }
.imperso-sub { font-size: .78rem; opacity: .92; }
/* Bouton clair sur l'aplat : le `.btn` standard serait blanc sur blanc ici. */
.imperso-quit {
  flex: 0 0 auto; background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .55); color: #fff;
}
.imperso-quit:hover { background: #fff; border-color: #fff; color: #8a5a12; }

.imperso-liste {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--bg);
}
.imperso-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border: 1px solid transparent; border-radius: 8px;
  background: var(--card); cursor: pointer; font: inherit;
}
.imperso-item:hover { border-color: var(--border); background: #f6f8fa; }
.imperso-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.imperso-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.imperso-nom {
  font-size: .9rem; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imperso-sous {
  font-size: .78rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imperso-nb { flex: 0 0 auto; font-size: .78rem; font-weight: 600; color: var(--muted); }
.imperso-vide { padding: 22px; text-align: center; font-size: .9rem; color: var(--muted); }
.badge {
  display: inline-block; border-radius: 6px; padding: 2px 9px;
  font-size: .72rem; font-weight: 600; background: #e7f0fb; color: var(--accent);
}
.ent-default { background: #eceff2; color: var(--muted); }

/* ── Modale ── */
.overlay-modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(20, 30, 40, .46);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 46px 18px; overflow-y: auto;
}
.modal {
  width: min(560px, 100%); background: var(--card); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28); overflow: hidden;
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.modal-title { font-size: 1.15rem; font-weight: 700; margin: 2px 0; }
.modal-meta { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.modal-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-size: .95rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #fdecea; color: var(--danger); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.input {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  background: var(--card); color: var(--ink); font: inherit; font-size: .92rem;
}
.input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 700px) {
  .imperso-bar { padding: 10px 14px; }
}
