/* CEJC · shared presentation layer. Business rules remain in each module. */
:root {
  --bg: #fbf9fa;
  --text: #30272b;
  --text-muted: #6b6065;
  --border: #e8dfe2;
  --accent2: #8d002c;
  --navy-soft: #8d002c;
  --rouge-dark: #7a0026;
  --rouge: #b9003a;
  --rouge-light: #f9edf1;
  --shadow: 0 3px 16px rgba(90, 20, 40, .045);
  --radius: 12px;
  --portal-rail: 204px;
  --portal-header: 76px;
}
body { line-height: 1.5; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #b9003a;
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .55; }
:where(main, section, article, aside, form) { min-width: 0; }
[hidden] { display: none !important; }
.topbar {
  height: var(--portal-header);
  background: #fff;
  box-shadow: none;
  padding: 0 24px;
  gap: 16px;
}
.topbar__brand { font-size: 1rem; white-space: nowrap; }
.topbar__brand img { width: 108px; height: 49px; box-shadow: none; }
.topbar__user { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
#topbarUserName { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__icon-link, .topbar__site-link, .btn-logout { box-shadow: none; min-height: 36px; }
.topbar__site-link.topbar__admin-link {
  width: auto;
  border-radius: 8px;
  border-color: #e7b9c7;
  background: #fff2f6;
  color: #94002f !important;
  white-space: nowrap;
}
.topbar__site-link.topbar__admin-link span { display: inline; }
.topbar__site-link.topbar__admin-link:hover,
.topbar__site-link.topbar__admin-link.is-current {
  border-color: #b9003a;
  background: #b9003a;
  color: #fff !important;
}
.portal-skip { position: fixed; top: -80px; left: 16px; padding: 12px 18px; background: #fff; z-index: 500; border-radius: 8px; }
.portal-skip:focus { top: 10px; }
.portal-menu-toggle { display: none; }
body.has-erp-rail .erp-rail {
  position: fixed;
  top: var(--portal-header);
  bottom: 0;
  left: 0;
  width: var(--portal-rail);
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 12px;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 70;
  scrollbar-width: thin;
}
.erp-rail::before { content: 'ESPACE CEJC'; color: #8d002c; letter-spacing: .15em; font-size: .66rem; font-weight: 700; padding: 0 14px 16px; }
body.has-erp-rail .erp-rail__item,
body.has-erp-rail .erp-rail__group-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 500;
  color: #5c4a51;
  border-radius: 8px;
}
body.has-erp-rail .erp-rail__icon { background: transparent; width: 23px; height: 23px; flex-shrink: 0; }
body.has-erp-rail .erp-rail__item:hover { background: #f9edf1; color: #8d002c; border-color: transparent; }
body.has-erp-rail .erp-rail__item.is-current { background: #b9003a; color: #fff; border-color: #b9003a; font-weight: 700; box-shadow: none; }
.erp-rail__group { padding: 0; border: 0; }
.erp-rail__group-title { opacity: .85; }
body.has-erp-rail .erp-rail__child { text-align: left; padding: 8px 12px 8px 47px; color: #5c4a51; font-size: .8rem; font-weight: 500; }
body.has-erp-rail .erp-rail__child.is-current { background: #b9003a; color: #fff; }
body.has-erp-rail .erp-rail__child:hover { background: #f9edf1; color: #8d002c; }
.erp-rail__group.is-current { background: transparent; }
body.has-erp-rail .erp-workspace { display: block; margin-left: var(--portal-rail); }
body.erp-module-shell > :is(main, .adhesion-page, .nav-shell-pad) { margin-left: var(--portal-rail); }
body.has-erp-rail > .pwa-action-banner { margin-left: var(--portal-rail); }
body.has-erp-rail :is(.formation-app, .erp-shell, .extranet-page, .member-mail) {
  max-width: none; padding: 28px 30px 48px;
}
:where(.formation-header, .erp-toolbar, .extranet-hero, .member-mail__header) { flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
:is(.formation-header, .erp-toolbar, .extranet-hero, .member-mail__header) h1 { font-size: clamp(1.65rem, 2.2vw, 2.15rem); letter-spacing: -.04em; color: var(--accent2); line-height: 1.25; }
.extranet-kicker { color: var(--rouge); letter-spacing: .1em; font-size: .7rem; font-weight: 700; margin-bottom: 7px; }
.portal-page-description { color: var(--text-muted); font-size: .9rem; margin-top: 8px; max-width: 570px; }
.extranet-hero { background: none; border: 0; padding: 0; box-shadow: none; }
.extranet-hero p:not(.extranet-kicker) { max-width: 680px; line-height: 1.6; }
.extranet-hero__status { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.btn { border-radius: 7px; min-height: 38px; font-weight: 600; padding: 8px 14px; line-height: 1.3; white-space: normal; }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: .8rem; }
.btn-primary { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-primary:hover { background: #8d002c; border-color: #8d002c; }
.btn-secondary { background: #fff; border-color: #e2cdd4; color: #8d002c; }
.btn-secondary:hover { background: #fcf0f4; border-color: #be7c91; color: #b9003a; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) { max-width: 100%; min-height: 39px; border-radius: 7px; }
input[type=checkbox], input[type=radio] { accent-color: var(--rouge); }
.panel { border-radius: 12px; }
.panel__title { padding: 14px 18px; font-size: .74rem; letter-spacing: .055em; background: #fdfafb; color: #6b6065; }
.panel__body { padding: 20px; }
.formation-header__actions { justify-content: flex-start; }
.formation-header__actions input { width: 240px; }
.formation-year-dashboard { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.formation-year-dashboard__title { grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; background: none; border: 0; padding: 0 0 3px; }
.formation-year-dashboard__title span { font-size: .82rem; }
.formation-stat { background: #fff; padding: 14px 16px; border-radius: 10px; min-width: 0; }
.formation-stat strong { color: var(--accent2); font-size: clamp(1.2rem, 1.8vw, 1.55rem); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.formation-layout { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 20px; }
.formation-list-panel { top: calc(var(--portal-header) + 20px); }
.formation-list { padding: 10px; }
.formation-item { padding: 14px; line-height: 1.5; background: #fff; }
.formation-item.is-current { background: #f9edf1; border-color: #b87389; box-shadow: inset 3px 0 var(--rouge); }
.formation-titlebar { display: block; padding: 22px; }
.formation-titlebar h2 { font-size: 1.4rem; letter-spacing: -.025em; }
.formation-titlebar__actions { margin-top: 18px; justify-content: flex-start; gap: 8px; }
.formation-titlebar__manage { gap: 8px; margin-left: 14px; }
.formation-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 18px; background: #fdfafb; }
.formation-stats .formation-stat { padding: 10px; border: 0; background: transparent; }
.formation-stats .formation-stat strong { font-size: 1.2rem; }
.formation-section-head { padding: 10px 16px; gap: 10px; background: #fdfafb; }
.formation-section-head .panel__title { padding: 4px 0; }
.formation-section-head > div:not(.panel__title) { display: flex; flex-wrap: wrap; gap: 8px; }
.formation-table :is(td, th) { padding: 12px 14px; }
.formation-table tbody tr:hover { background: #fdf8fa; }
.portal-workflow > summary { padding: 15px 20px; color: #6b6065; font-size: .85rem; font-weight: 600; cursor: pointer; }
.portal-workflow { border-bottom: 1px solid var(--border); }
.portal-workflow .formation-workflow { border-bottom: 0; }
.portal-export-menu summary { cursor: pointer; padding: 7px 11px; border: 1px solid #e2cdd4; border-radius: 7px; font-size: .8rem; min-height: 34px; }
.portal-export-menu > div { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.erp-toolbar { align-items: start; }
.erp-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
.erp-stat { background: #fff; border-radius: 10px; padding: 12px 16px; }
.erp-stat strong { color: var(--accent2); }
.erp-layout { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; }
.erp-directory { top: calc(var(--portal-header) + 20px); max-height: calc(100vh - 116px); border-radius: 12px; }
.erp-detail { border-radius: 12px; min-height: 450px; padding: 24px; overflow-wrap: anywhere; }
.erp-member-item { padding: 12px; border-radius: 7px; }
.erp-member-item.is-active { background: var(--rouge-light); border-color: #b87389; }
:is(.extranet-member-tabs, .treasury-filter-tabs) { gap: 8px; flex-wrap: wrap; }
.extranet-member-tabs { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 22px; }
.extranet-member-tabs :is(button, a) { border-radius: 7px; padding: 10px 16px; font-weight: 600; min-height: 40px; }
.extranet-member-tabs :is(button, a).is-active { background: #b9003a; color: #fff; border-color: #b9003a; }
.treasury-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
:is(.treasury-toolbar, .treasury-toolbar__actions, .extranet-v1-head, .extranet-detail-actions) { flex-wrap: wrap; gap: 10px; }
.extranet-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); }
:is(.extranet-table-wrap, .erp-table-wrap, .treasury-members, .extranet-history, .formation-attendees, .formation-invoices) { max-width: 100%; overflow-x: auto; }
.modal-backdrop { padding: 24px; overflow-y: auto; }
.modal { border-radius: 14px; max-width: 100%; max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 24px 80px #0c234033; }
.pwa-action-banner { background: #f9edf1; border-color: #e8dfe2; color: #6b6065; box-shadow: none; }
.pwa-action-banner__inner { padding: 10px 28px; }
.pwa-action-banner__link { color: #6b6065; font-size: .8rem; font-weight: 500; text-decoration-thickness: 1px; }
.login-wrap { background: radial-gradient(ellipse at top left, #f9edf1, transparent 65%), #fbf9fa; padding: 32px 20px; }
.login-card { border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 65px #7a002610; padding: 36px; }
.login-card h1 { color: #b9003a; }
@media (max-width: 1200px) {
  .formation-layout { grid-template-columns: 1fr; }
  .formation-list-panel { position: static; }
  .formation-list { display: grid; }
  .formation-item { flex: none; }
  .member-mail__grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --portal-rail: 166px; }
  .topbar { padding: 0 16px; }
  body.has-erp-rail :is(.formation-app, .erp-shell, .extranet-page, .member-mail) { padding: 24px 20px 40px; }
  .erp-layout { grid-template-columns: 1fr; }
  .erp-directory { position: static; max-height: 370px; }
  .formation-year-dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --portal-header: 136px; }
  .topbar { min-height: var(--portal-header); height: auto; padding: 12px; gap: 8px; flex-wrap: wrap; align-items: center; }
  .topbar__brand { flex: 1; font-size: .88rem; gap: 8px; }
  .topbar__brand img { width: 80px; height: 36px; }
  .topbar__user { width: 100%; justify-content: flex-end; gap: 8px; }
  #topbarUserName { flex-basis: 100%; margin-right: auto; max-width: none; font-size: .7rem; text-align: right; }
  .topbar__site-link { font-size: .75rem; padding: 5px 8px; }
  .btn-logout { font-size: .7rem; padding: 5px 8px; }
  .portal-menu-toggle { display: block; border: 1px solid #e2cdd4; border-radius: 7px; padding: 8px 12px; color: #b9003a; background: #fff; font-size: .8rem; }
  body.has-erp-rail .erp-rail { display: none; width: min(290px, 85vw); padding: 16px; box-shadow: 12px 0 40px #7a002626; }
  body.portal-menu-open .erp-rail { display: flex; }
  body.has-erp-rail .erp-workspace,
  body.erp-module-shell > :is(main, .adhesion-page, .nav-shell-pad),
  body.has-erp-rail > .pwa-action-banner { margin-left: 0; }
  body.has-erp-rail :is(.formation-app, .erp-shell, .extranet-page, .member-mail) { padding: 22px 14px 36px; }
  .formation-header__actions { width: 100%; }
  .formation-header__actions input { flex: 1; min-width: 150px; width: auto; }
  .formation-year-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formation-titlebar { padding: 18px; }
  .formation-workflow { grid-template-columns: 1fr; }
  .erp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-detail { padding: 16px; }
  .panel__body { padding: 16px; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); }
  .kanban-board { grid-template-columns: minmax(0, 1fr); }
  .kanban-col__body--cloture { display: block; }
  .pwa-action-banner__inner { padding: 10px 14px; }
  .login-card { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .topbar, .erp-rail, .portal-menu-toggle, .pwa-action-banner, .portal-skip { display: none !important; }
  body.has-erp-rail .erp-workspace, body.erp-module-shell > main { margin-left: 0; }
}
/* Keep the rail full-height even when the original grid aligns its items at start. */
body.has-erp-rail .erp-rail { height: calc(100dvh - var(--portal-header)); align-self: stretch; }
.formation-year-dashboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-annual-details { grid-column: 1 / -1; }
.portal-annual-details summary { color: #6b6065; font-size: .82rem; cursor: pointer; padding: 3px 0; }
.portal-annual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin-top: 12px; }
.extranet-page > :is(.panel, .extranet-grid, details) { margin-bottom: 22px; }
.portal-section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.portal-section-nav a { border: 1px solid #e2cdd4; border-radius: 7px; background: #fff; color: #8d002c; padding: 9px 14px; font-size: .85rem; }
.portal-section-nav a:hover { background: #fcf0f4; text-decoration: none; }
:is(#migrationImport, #migrationModel, #migrationReadiness, #migrationHistory) { scroll-margin-top: 100px; }
.extranet-page > details > summary { cursor: pointer; }
#historyRows { margin: 18px 0; }
#readinessResults { margin-top: 16px; }
#historyCount { margin-top: 16px; }
#historyImport, #historyAuthor, #historyStatus, #historyType { width: 100%; margin-top: 5px; }
#migrationHistory .panel__body > label { display: inline-block; width: calc(50% - 12px); vertical-align: top; margin: 16px 8px 16px 0; color: #6b6065; font-size: .82rem; }
@media (max-width: 640px) {
  .formation-year-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #migrationHistory .panel__body > label { width: 100%; margin-bottom: 4px; }
  :is(#migrationImport, #migrationModel, #migrationReadiness, #migrationHistory) { scroll-margin-top: 135px; }
}
.admin-users-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .65fr) auto; gap: 10px; align-items: center; }
.admin-users-filters :is(input, select) { min-width: 0; width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.documents-sidebar { background: #fdfafb; }
@media (max-width: 640px) {
  .admin-users-filters { grid-template-columns: minmax(0, 1fr); }
  .documents-header { align-items: flex-start; }
}
body.erp-module-shell > :is(.admin-wrap, .aide-wrap, .ticket-layout, .ticket-header) { margin-left: var(--portal-rail); }
body.erp-module-shell > :is(.admin-wrap, .aide-wrap) { max-width: none; }
@media (max-width: 640px) {
  body.erp-module-shell > :is(.admin-wrap, .aide-wrap, .ticket-layout, .ticket-header) { margin-left: 0; }
}
@media (max-width: 380px) {
  :root { --portal-header: 116px; }
  .topbar__user { gap: 4px; }
  .topbar__site-link.topbar__admin-link { padding-inline: 6px; gap: 4px; }
  #topbarUserName { display: none; }
  .topbar__user { justify-content: flex-end; }
}
/* Votes: make the current phase and next human action explicit. */
.vote-page-header { margin: 10px 0 22px; }
.vote-page-header h1 { color: var(--accent2); font-size: 2rem; letter-spacing: -.035em; }
.vote-page-header > p:last-child { color: var(--text-muted); margin-top: 7px; }
.vote-page .adhesion-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.vote-page .adhesion-form-panel > summary { cursor: pointer; }
.vote-page .adhesion-form-panel form { max-width: 760px; }
.vote-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.vote-overview > div { padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.vote-overview span { color: var(--text-muted); font-size: .82rem; }
.vote-overview strong { display: block; font-size: 1.6rem; color: var(--accent2); }
.vote-workflow { padding: 22px; background: #fdf8fa; border: 1px solid #eadce2; border-radius: 12px; margin-bottom: 24px; }
.vote-workflow h3 { font-size: 1.35rem; color: var(--accent2); }
.vote-workflow ol { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 18px 0; padding: 0; }
.vote-workflow li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font-size: .85rem; color: var(--text-muted); }
.vote-workflow li span { border-radius: 50%; background: #f6edf0; width: 24px; height: 24px; display: grid; place-items: center; }
.vote-workflow li.is-current { background: #b9003a; border-color: #b9003a; color: #fff; font-weight: 700; }
.vote-workflow li.is-current span { background: #ffffff26; }
.vote-workflow li.is-done { color: #24563e; background: #eef6f1; }
.vote-next { border-left: 3px solid #b9003a; padding: 10px 14px; background: #fff; line-height: 1.6; }
.vote-next p { margin-top: 4px; }
.vote-participation { margin-top: 18px; }
.vote-participation small { display: block; margin-top: 6px; color: var(--text-muted); }
.vote-participation progress { width: min(100%, 480px); height: 10px; accent-color: #b9003a; display: block; margin-top: 10px; }
.vote-mine { margin-top: 10px; font-weight: 600; }
.vote-close-warning { padding: 12px 16px; border-radius: 8px; background: #fcf3e4; color: #735218; margin-bottom: 10px; }
.vote-admin-actions { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 26px; }
.vote-admin-actions summary { cursor: pointer; color: var(--text-muted); font-size: .85rem; }
.vote-page .adhesion-list-item__meta { line-height: 1.8; }
.vote-page #detailPanel { scroll-margin-top: 100px; }
@media (max-width: 640px) {
  .vote-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vote-workflow { padding: 16px; }
  .vote-workflow ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vote-workflow li { padding: 8px; font-size: .75rem; }
  .vote-page #detailPanel { scroll-margin-top: 130px; }
}
.vote-report-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; padding: 14px; margin-top: 12px; background: #fdf8fa; font: inherit; font-size: .9rem; }

body.has-erp-rail .erp-rail__item.is-current .erp-rail__icon { background: transparent; }
/* Each stage has its own queue; drafts never appear among expected votes. */
.vote-stage-nav { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.vote-stage-nav button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid #e2cdd4; border-radius: 8px; background: #fff; color: #6b6065; font-weight: 600; }
.vote-stage-nav button.is-active { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.vote-stage-nav button span { padding: 1px 8px; border-radius: 20px; background: #f6edf0; color: #8d002c; font-size: .8rem; }
.vote-stage-nav button.is-active span { background: #ffffff26; color: #fff; }
.vote-queue + .vote-queue { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); }
.vote-queue h3 { font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 10px; }
.vote-queue h3 span { color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.vote-queue-help { color: var(--text-muted); font-size: .85rem; margin: 6px 0 16px; line-height: 1.6; }
.photo-pending-list { display: grid; gap: 14px; }
.photo-pending-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.photo-pending-card__media img,
.photo-pending-card__placeholder {
  width: 126px;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  display: grid;
  place-items: center;
  font: 800 2.4rem 'Manrope', system-ui, sans-serif;
  color: var(--rouge);
}
.photo-pending-card__body { display: grid; gap: 4px; min-width: 0; }
.photo-pending-card__body strong { font-size: 1rem; }
.photo-pending-card__body span { color: var(--text-muted); font-size: .85rem; }
.photo-pending-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) {
  .vote-stage-nav { display: grid; grid-template-columns: 1fr; }
  .vote-stage-nav button { justify-content: space-between; text-align: left; }
  .photo-pending-card { grid-template-columns: 1fr; }
}

/* Readable empty states and feedback across the portal. */
.portal-empty { padding: 40px 24px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; background: #fff; }
.portal-empty h2 { font-size: 1.15rem; color: var(--accent2); margin: 0 0 8px; }
.portal-empty p { color: var(--text-muted); margin: 0; }
.portal-dialog-open { overflow: hidden; }
.toast-container { max-width: min(440px, calc(100vw - 32px)); max-height: 65vh; overflow-y: auto; }
.toast { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.toast-close { flex: 0 0 28px; min-height: 28px; border: 0; background: transparent; color: inherit; font-size: 1.3rem; cursor: pointer; }
@media (max-width: 640px) {
  .toast-container { right: 16px; bottom: 16px; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); }
  .modal__actions { flex-wrap: wrap; }
  .modal__actions .btn { min-height: 44px; }
}

.portal-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: .82rem; color: var(--text-muted); }
.portal-field :is(input, select) { width: 100%; color: var(--text); }

/* Passe ergonomie 16/10 : barre d’outils de l’accueil, bandeaux et repères d’état. */
.kanban-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.kanban-toolbar__main { flex-wrap: wrap; row-gap: .75rem; }
.task-view-switch__btn { white-space: nowrap; }
.erp-workspace__main > #mailStatusBanner { margin: 0 1.5rem 1.25rem; border-radius: 8px; }
.erp-workspace__main > .ca-votes-home-panel { margin: 1rem 1.5rem; }
.portal-tech-details { margin-top: 6px; font-size: .82rem; color: var(--text-muted); }
.portal-tech-details summary { cursor: pointer; width: fit-content; }
.portal-tech-details[open] summary { margin-bottom: 4px; }
/* Indicateur de contexte (et non bouton) en haut des pages. */
.extranet-hero__status { border: 0; background: #f6edf0; color: #8d002c; border-radius: 999px; padding: 6px 14px; font-size: .78rem; font-weight: 600; align-self: flex-start; }
.sidebar-section .mail-assignee-picker label { display: flex; align-items: center; margin: 0; text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 500; color: var(--text); gap: .6rem; }
@media (max-width: 640px) {
  .erp-workspace__main > #mailStatusBanner { margin: 0 1rem 1rem; }
  .erp-workspace__main > .ca-votes-home-panel { margin: 1rem; }
  .task-view-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
}
/* Le rail mène déjà à l’accueil ; la fiche demande garde son retour vers la liste. */
body.has-erp-rail .nav-back[href="/ERP"]:not(.nav-back--list) { display: none; }

/* Rail regroupé par usage, avec compteurs. */
.erp-rail::before { content: none; }
.erp-rail__section { margin: 14px 14px 4px; color: #9a8a90; font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.erp-rail__section:first-child { margin-top: 0; }
body.has-erp-rail .erp-rail__item { position: relative; }
.erp-rail__item .nav-badge { margin-left: auto; background: #b9003a; color: #fff; border: 0; min-width: 1.35rem; height: 1.35rem; font-size: .7rem; }
body.has-erp-rail .erp-rail__item.is-current .nav-badge { background: #fff; color: #b9003a; }

/* Accueil : en-tête de page et cartes de demandes. */
.home-header { padding: 28px 1.5rem 18px; }
.home-header h1 { color: var(--accent2); font-size: clamp(1.65rem, 2.2vw, 2.15rem); letter-spacing: -.04em; line-height: 1.2; }
.home-header .extranet-kicker::first-letter { text-transform: uppercase; }
.erp-workspace__main > .kanban-toolbar { border-top: 1px solid var(--border); }
.mail-bulk__help { margin: 8px 0 0; }
.ticket-card { border-radius: 10px; padding: .85rem .95rem; box-shadow: 0 1px 2px rgba(90, 20, 40, .04); }
.ticket-card:hover { box-shadow: 0 6px 18px rgba(90, 20, 40, .09); }
.ticket-card__sender { color: var(--text); font-weight: 500; }
.badge-assign { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--text); font-weight: 600; padding: 0; }
.badge-assign__initials { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: #f6edf0; color: #8d002c; font-size: .62rem; font-weight: 700; }
.badge-assign--none { color: var(--text-muted); font-weight: 500; font-style: italic; }
.badge-msg { background: #f7f3f4; }
@media (max-width: 640px) { .home-header { padding: 22px 1rem 14px; } }

/* Mon espace : indicateurs cliquables vers leur onglet, solde mis en avant. */
.extranet-metric--link { display: flex; flex-direction: column-reverse; gap: 2px; text-align: left; font: inherit; cursor: pointer; background: #fff; border-radius: 10px; padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.extranet-metric--link:hover { border-color: #d9a9b8; box-shadow: 0 4px 14px rgba(90, 20, 40, .07); }
.extranet-metric--due { background: #fdf3f6; border-color: #e7bccb; }
.extranet-metric--ok strong { color: #24563e; }
.member-invoice-status { font-weight: 600; }
.member-invoice-status.is-due { color: #8d002c; }
.member-invoice-status.is-paid { color: #24563e; }
.member-documents-section { margin-top: 8px; margin-bottom: 28px; }
.member-documents-section h4 { color: var(--accent2); font-size: 1rem; margin: 0 0 12px; }
.member-received-doc-tabs { margin-top: 4px; margin-bottom: 14px; }
.member-received-panels { min-height: 40px; }
.member-profile-field-tabs { margin: 0 0 16px; }
