/* PSC Gestion — ce que le cadre PSC-RH-outils ne prévoyait pas : menus déroulants
   des modules de gestion, compte connecté, écran de connexion, pages de gestion. */

html.pscg-login, html.pscg-login body { overflow: hidden; }
html.pscg-login .suite, html.pscg-login #home, html.pscg-login .app { visibility: hidden; }

/* Menu : groupes déroulants dans la barre sombre */
.suite-in { padding-right: 10px; }
.suite .grp-btn::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 2px; opacity: .8; }
.suite .grp-btn[aria-expanded="true"] { background: var(--suite-hover); color: var(--suite-ink); }
.suite .grp-btn[aria-current="page"]::after { border-color: var(--suite-bg); }
.suite .spacer { flex: 1 1 auto; min-width: 8px; }
.suite .me-btn { gap: 8px; padding: 5px 12px 5px 5px; }
.suite .me-av { width: 28px; height: 28px; border-radius: 999px; background: var(--suite-hover); color: var(--suite-ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.suite .me-btn[aria-expanded="true"] .me-av, .suite .me-btn:hover .me-av { background: var(--suite-ink); color: var(--suite-bg); }
.suite .me-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }

.pscg-menu { position: fixed; z-index: 70; min-width: 250px; max-width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 80px); overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; font-family: var(--body); }
.pscg-menu h4 { margin: 8px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--body); }
.pscg-menu button, .pscg-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; text-align: left;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; }
.pscg-menu button:hover, .pscg-menu a:hover, .pscg-menu button:focus-visible { background: var(--accent-soft); outline: none; }
.pscg-menu button[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.pscg-menu small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.pscg-menu button[aria-current="page"] small { color: inherit; opacity: .85; }
.pscg-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pscg-menu .who { padding: 10px 12px 8px; }
.pscg-menu .who b { display: block; font-size: 15px; }
.pscg-menu .who span { color: var(--muted); font-size: 13px; }
.pscg-menu .themes { display: flex; gap: 4px; padding: 4px 8px 8px; }
.pscg-menu .themes button { justify-content: center; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); }
.pscg-menu .themes button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Pages de gestion (écrans repris de l'ancienne application) */
.app-admin { position: relative; }
.app-admin iframe { display: block; width: 100%; height: calc(100vh - var(--nav-h, 46px)); height: calc(100dvh - var(--nav-h, 46px)); border: 0; background: var(--bg); }
.app-admin .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; pointer-events: none; }

/* Écran de connexion */
.pscg-login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; overflow: auto;
  background: radial-gradient(circle at 20% 15%, rgba(161,154,238,.35), transparent 40%), var(--band, #0009E4); font-family: var(--body, 'Public Sans', system-ui, sans-serif); }
.pscg-login-card { width: min(420px, 100%); background: var(--surface, #fff); color: var(--ink, #0C0E3D); border-radius: 20px; padding: 30px 28px 26px; box-shadow: 0 30px 80px rgba(6,8,58,.35);
  display: flex; flex-direction: column; gap: 14px; }
.pscg-login-logo { align-self: flex-start; background: #fff; border-radius: 12px; padding: 6px 10px; box-shadow: -6px 6px 0 var(--layer1, #A19AEE), -12px 12px 0 var(--layer2, #DFDCFB); margin: 0 0 6px 12px; }
.pscg-login-logo img { height: 56px; width: auto; display: block; }
.pscg-login-card h1 { font-family: var(--display, 'Exo 2', sans-serif); font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.pscg-login-sub { color: var(--muted, #4A4E7D); margin: -6px 0 4px; }
.pscg-login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.pscg-login-card input:not([type=checkbox]) { font: inherit; font-weight: 400; padding: 11px 13px; border: 1px solid var(--line, #D3D5F0); border-radius: 10px; background: var(--surface, #fff); color: var(--ink, #0C0E3D); }
.pscg-login-card input:focus-visible { outline: 3px solid var(--accent, #0009E4); outline-offset: 1px; }
.pscg-login-chk { flex-direction: row !important; align-items: center; gap: 9px !important; font-weight: 500 !important; }
.pscg-login-chk input { width: 18px; height: 18px; accent-color: var(--accent, #0009E4); }
.pscg-login-err { color: var(--crit, #B3261E); background: var(--crit-soft, #FBE3E0); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 14px; margin: 0; }
.pscg-login-go { min-height: 50px; border: 0; border-radius: 12px; background: var(--accent, #0009E4); color: var(--on-accent, #fff); font: inherit; font-weight: 700; font-size: 16.5px; cursor: pointer; }
.pscg-login-go:hover { filter: brightness(1.1); }
.pscg-login-go:disabled { opacity: .6; cursor: progress; }
.pscg-login-note { color: var(--muted, #4A4E7D); font-size: 13px; margin: 0; }
html.pscg-login .pscg-login { visibility: visible; }

/* Import / export des données des outils RH */
#dRh { border: 0; border-radius: 16px; padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#dRh::backdrop { background: rgba(6,8,58,.45); }
#dRh .dx p { color: var(--muted); }
#dRh .ok { color: var(--ok, #1C6A3A); font-weight: 600; }

/* Historique des modifications (bouton du bandeau, sur tous les onglets) */
#dHist { border: 0; border-radius: 16px; padding: 0; max-width: min(760px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#dHist::backdrop { background: rgba(6,8,58,.45); }
#dHist .dx { gap: 12px; }
.hist-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hist-x { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.hist-f { display: flex; flex-wrap: wrap; gap: 8px; }
.hist-f select, .hist-f input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 0; }
.hist-f input { flex: 1 1 220px; }
.hist-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist-l .hist-j { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 0 4px; }
.hist-l .hist-i { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.hist-l .hist-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-l .hist-e { color: var(--accent); font-weight: 600; }
.hist-l ul { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 13px; }
.hist-l ul b { color: var(--ink); font-weight: 600; }
.hist-l s { opacity: .75; }
.hist-l .vide { color: var(--muted); padding: 12px 0; }
.hist-m { align-self: flex-start; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px 0; }
.suite .hist-btn svg { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .suite .me-name { display: none; }
  .suite .me-btn { padding-right: 6px; }
}

/* Le menu tient sur une ligne en 1 366 px : plus de place, un peu moins d'espacement que dans les outils seuls */
.suite-in { max-width: none; padding: 6px 12px; gap: 2px; }
.suite button { padding: 8px 11px; font-size: 14px; }
.suite .sep { margin-inline: 3px; }
.suite .me-btn[aria-current="page"] { background: var(--suite-ink); color: var(--suite-bg); }
@media (min-width: 1500px) { .suite button { padding: 8px 13px; font-size: 14.5px; } }
@media (max-width: 1599px) { .suite .me-name { display: none; } .suite .me-btn { padding: 5px; } }
