/* Identité du portail ; Bootstrap reste distribué localement sans modification. */
:root {
  --pt-ink: #1d3038;
  --pt-muted: #53646b;
  --pt-paper: #f5f4f0;
  --pt-surface: #ffffff;
  --pt-primary: #0b5556;
  --pt-primary-hover: #083e3f;
  --pt-active: #e6f0ec;
  --pt-accent: #9b4a2a;
  --pt-border: #d8dfdc;
  --pt-control-border: #71878b;
  --pt-focus: #8c3f17;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --bs-body-color: var(--pt-ink);
  --bs-body-bg: var(--pt-paper);
  --bs-secondary-color: var(--pt-muted);
  --bs-tertiary-bg: #edf2f0;
  --bs-border-color: var(--pt-border);
  --bs-primary: var(--pt-primary);
  --bs-primary-rgb: 11, 85, 86;
  --bs-link-color: var(--pt-primary);
  --bs-link-color-rgb: 11, 85, 86;
  --bs-link-hover-color: var(--pt-primary-hover);
  --bs-link-hover-color-rgb: 8, 62, 63;
}
body { margin: 0; font-size: 1rem; line-height: 1.6; }
a { text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--pt-focus) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px white !important;
}
.visually-hidden-focusable:focus { position: absolute; z-index: 20; top: 1rem; left: 1rem; background: white; padding: .75rem 1rem; }
h1, h2, h3, h4, h5, h6 { color: var(--pt-ink); font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 2.5vw, 2.125rem); }
h2 { font-size: 1.4rem; }
.h2 { font-size: clamp(1.75rem, 2.5vw, 2.125rem); }
.h4 { font-size: 1.25rem; }
.h5 { font-size: 1.125rem; }
.h6 { font-size: 1rem; }
.small, small, .form-text { font-size: .875rem; }
.lead { font-size: 1.125rem; color: var(--pt-muted); }
code, pre, .font-monospace { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; }
code { color: var(--pt-primary); overflow-wrap: anywhere; }
.portal-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar { padding: 1.5rem 1rem; border-right: 1px solid var(--pt-border); background: white; min-width: 0; }
.portal-brand { display: flex; align-items: center; gap: .65rem; width: fit-content; text-decoration: none; font-size: 1.6rem; font-weight: 450; letter-spacing: -.06em; color: var(--pt-ink); }
.portal-brand:hover { color: var(--pt-ink); }
.portal-brand strong { font-weight: 750; }
.portal-dot { color: var(--pt-accent); }
.portal-mark { display: inline-block; width: 24px; height: 27px; border-left: 5px solid var(--pt-primary); border-top: 5px solid var(--pt-primary); position: relative; flex-shrink: 0; }
.portal-mark::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-right: 5px solid var(--pt-accent); border-bottom: 5px solid var(--pt-accent); }
.portal-caption { margin: .55rem 0 1.5rem; font-size: .875rem; color: var(--pt-muted); }
.portal-menu > summary { display: none; }
.portal-nav { display: flex; flex-direction: column; gap: .2rem; }
.portal-nav a { min-height: 44px; display: flex; align-items: center; padding: .6rem .7rem; text-decoration: none; color: var(--pt-muted); border-left: 3px solid transparent; border-radius: 0 5px 5px 0; font-size: .9rem; }
.portal-nav a:hover { background: var(--pt-paper); color: var(--pt-ink); }
.portal-nav a[aria-current] { background: var(--pt-active); color: var(--pt-primary); border-color: var(--pt-primary); font-weight: 650; }
.nav-group-label { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--pt-muted); padding: 1.1rem .9rem .3rem; margin: 0; }
.portal-session { margin-top: 1.5rem; padding: 1rem .3rem 0; border-top: 1px solid var(--pt-border); }
.portal-username { display: block; margin-bottom: .7rem; color: var(--pt-muted); font-size: .875rem; overflow-wrap: anywhere; }
.portal-workspace { display: flex; flex-direction: column; min-width: 0; }
main { padding: 1.75rem clamp(1.25rem, 2.5vw, 2.5rem) 2rem; width: 100%; max-width: 1320px; margin: 0 auto; flex-grow: 1; min-width: 0; }
main:focus { outline: none; }
.portal-footer { border-top: 1px solid var(--pt-border); padding: 1rem 2rem; font-size: .875rem; color: var(--pt-muted); }
.portal-guest { display: flex; flex-direction: column; }
.portal-guest .portal-sidebar { border: 0; background: transparent; padding: 1.75rem 1.25rem 0; }
.portal-guest .portal-brand { margin: 0 auto; }
.portal-guest .portal-caption { text-align: center; margin-bottom: 0; }
.portal-guest .portal-workspace { flex-grow: 1; }
.portal-public { display: flex; flex-direction: column; }
.portal-public .portal-sidebar { width: 100%; max-width: 1160px; margin: 0 auto; border: 0; border-bottom: 1px solid var(--pt-border); background: transparent; padding: 1.25rem 2rem .9rem; }
.portal-public .portal-caption { margin-bottom: 0; }
.portal-public .portal-workspace { flex-grow: 1; }
.portal-public main { max-width: 1160px; padding: 1.75rem 2rem 2rem; }
.public-intro { max-width: 72ch; margin-bottom: 1.75rem; }
.public-intro h1 { margin-bottom: 1rem; }
.public-intro .lead { margin-bottom: 1.25rem; }
.public-process { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; counter-reset: public-step; }
.public-process li { counter-increment: public-step; border-top: 1px solid var(--pt-border); padding-top: .8rem; }
.public-process li::before { content: "0" counter(public-step); display: block; color: var(--pt-accent); font-size: .875rem; font-weight: 650; margin-bottom: .4rem; }
.public-process strong { display: block; margin-bottom: .3rem; }
.public-process span { display: block; color: var(--pt-muted); font-size: .9375rem; }
.login-panel { max-width: 480px; margin: 0 auto; }
.page-heading { margin-bottom: 1.5rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--pt-border); }
.page-heading h1 { margin-bottom: .6rem; }
.page-heading p:last-child { max-width: 70ch; }
.eyebrow { color: var(--pt-primary); text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; font-weight: 700; margin-bottom: .6rem; }
.breadcrumb { font-size: .875rem; --bs-breadcrumb-divider-color: var(--pt-muted); --bs-breadcrumb-item-active-color: var(--pt-muted); }
.card { background: white; border: 1px solid var(--pt-border); border-radius: 8px; }
.card.shadow-sm { box-shadow: none !important; }
.card-body { padding: 1.4rem; min-width: 0; overflow-wrap: anywhere; }
.tool-panel { border-top: 3px solid var(--pt-primary); }
.tool-panel .card-body { display: flex; gap: 1.4rem; padding: 1.75rem; }
.tool-sign { width: 48px; height: 48px; border-radius: 7px; background: var(--pt-active); color: var(--pt-primary); display: grid; place-content: center; font-size: 1.5rem; font-weight: 650; flex-shrink: 0; }
.empty-state { max-width: 800px; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.btn { font-size: .9rem; font-weight: 600; border-radius: 5px; padding: .65rem 1rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1.45; }
.btn-sm { font-size: .875rem; padding: .4rem .7rem; min-height: 36px; }
.btn-primary { --bs-btn-bg: var(--pt-primary); --bs-btn-border-color: var(--pt-primary); --bs-btn-color: white; --bs-btn-hover-bg: var(--pt-primary-hover); --bs-btn-hover-border-color: var(--pt-primary-hover); --bs-btn-hover-color: white; --bs-btn-active-bg: var(--pt-primary-hover); --bs-btn-active-border-color: var(--pt-primary-hover); --bs-btn-active-color: white; --bs-btn-disabled-bg: var(--pt-primary); --bs-btn-disabled-border-color: var(--pt-primary); }
.btn-outline-primary, .btn-outline-secondary { --bs-btn-color: var(--pt-primary); --bs-btn-border-color: var(--pt-control-border); --bs-btn-hover-color: var(--pt-primary); --bs-btn-hover-bg: var(--pt-active); --bs-btn-hover-border-color: var(--pt-primary); --bs-btn-active-color: var(--pt-primary); --bs-btn-active-bg: var(--pt-active); --bs-btn-active-border-color: var(--pt-primary); background: white; }
label { display: inline-block; margin-bottom: .5rem; font-weight: 600; }
.form-group { margin-bottom: 1.25rem; }
.form-control, .form-select { border-color: var(--pt-control-border); border-radius: 4px; min-height: 46px; color: var(--pt-ink); background-color: white; font-size: 1rem; max-width: 100%; }
.form-control:focus, .form-select:focus { border-color: var(--pt-primary); box-shadow: none; }
.form-control:disabled, .form-select:disabled { background-color: #edf2f0; color: var(--pt-muted); }
[aria-invalid="true"] { border: 2px solid #9d2828; }
.form-text { color: var(--pt-muted); }
.field-errors, .errorlist, .text-danger { color: #9d2828 !important; }
.errorlist { padding-left: 1.25rem; margin: .5rem 0 0; }
.error-summary:focus { outline: 3px solid var(--pt-focus); outline-offset: 3px; }
.error-summary a { color: inherit; font-weight: 600; }
.error-summary h2 { color: inherit; }
.alert { border: 0; border-left: 4px solid; border-radius: 0 5px 5px 0; padding: 1rem 1.2rem; overflow-wrap: anywhere; }
.alert-info { color: var(--pt-primary); background-color: var(--pt-active); border-color: var(--pt-primary); }
.alert-success { color: #205c45; background-color: #ecf4ef; border-color: #205c45; }
.alert-warning { color: #6c4a10; background-color: #fff4db; border-color: #6c4a10; }
.alert-danger { color: #9d2828; background-color: #fff1ef; border-color: #9d2828; }
.alert a { color: inherit; }
.cabinet-form { max-width: 850px; }
.cabinet-form fieldset + fieldset { border-top: 1px solid var(--pt-border); padding-top: 1.25rem; margin-top: .5rem; }
.cabinet-form legend { font-size: 1.125rem; font-weight: 650; margin-bottom: 1rem; }
.cabinet-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.25rem; }
.sepa-steps { display: flex; gap: .5rem 1.4rem; flex-wrap: wrap; padding: 0; margin: 0 0 1rem; list-style: none; font-size: .875rem; color: var(--pt-muted); }
.sepa-steps [aria-current="step"] { color: var(--pt-primary); font-weight: 700; border-bottom: 2px solid var(--pt-primary); }
.remittance-summary { border-bottom: 2px solid var(--pt-primary); padding: .25rem 0 1.25rem; margin-bottom: 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 2rem; }
.remittance-total .eyebrow { margin-bottom: .4rem; }
.total-amount { font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 0; letter-spacing: -.03em; }
.total-amount span { font-size: 1.5rem; font-weight: 450; }
.remittance-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.5rem; margin: 0; align-items: start; }
.remittance-facts dt { font-size: .875rem; color: var(--pt-muted); font-weight: 450; margin-bottom: .2rem; }
.remittance-facts dd { margin-bottom: 0; font-weight: 650; }
.remittance-creditor { grid-column: 1 / -1; overflow-wrap: anywhere; }
.confirmation-panel { border: 1px solid var(--pt-primary); }
.sepa-table { overflow-x: auto; overflow-y: hidden; }
.sepa-operations { min-width: 850px; }
.sepa-history-table { min-width: 790px; }
.cabinet-history-table { min-width: 650px; }
.table { --bs-table-color: var(--pt-ink); --bs-table-bg: white; --bs-table-border-color: var(--pt-border); font-size: .9375rem; }
.table > :not(caption) > * > * { padding: .85rem .8rem; }
.table thead th { background: #edf2f0; color: var(--pt-muted); font-size: .875rem; font-weight: 650; }
.table caption { color: var(--pt-muted); font-size: .875rem; }
.text-end, .total-amount { font-variant-numeric: tabular-nums; }
.table a { display: inline-block; padding: .25rem 0; }
.table-hint { color: var(--pt-muted); font-size: .875rem; margin-bottom: .6rem; }
.archive-reference { overflow-wrap: anywhere; max-width: 28ch; }
.archive-badge { color: #205c45; background: #ecf4ef; font-size: .8125rem; font-weight: 650; padding: .3rem .5rem; border-radius: 4px; display: inline-block; }
.document-page { min-width: 0; }
.document-menu { border: 1px solid var(--pt-border); border-radius: 6px; background: white; margin-bottom: 1.5rem; }
.document-menu summary { font-size: 1rem; font-weight: 650; padding: .8rem 1rem; cursor: pointer; color: var(--pt-primary); min-height: 44px; }
.document-menu > nav, .document-menu > div { padding: .25rem 1rem 1rem; }
.document-menu li { margin-bottom: .35rem; }
.document-menu a { display: inline-block; padding: .2rem 0; }
.document-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.admin-document { min-width: 0; overflow-wrap: anywhere; max-width: 78ch; }
.admin-document h2, .admin-document h3, .admin-document h4 { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.admin-document > h2:first-child { margin-top: 0; }
.document-page .table-responsive { overflow-x: auto; }
.document-page .table { table-layout: fixed; width: 100%; min-width: 0; }
.document-page th, .document-page td { overflow-wrap: anywhere; word-break: normal; }
.document-page .table th code, .document-page .table td code { white-space: normal; }
.admin-code { min-width: 0; max-width: 100%; }
.admin-code pre { background: #f7f9f8; color: var(--pt-ink); border: 1px solid var(--pt-control-border); padding: 1rem; overflow-x: auto; white-space: pre; font-size: .875rem; line-height: 1.65; border-radius: 4px; }
.admin-code pre code { color: inherit; overflow-wrap: normal; word-break: normal; }
.admin-actions { font-size: .875rem; }
.admin-actions a { display: inline-block; padding: .3rem 0; }
@media (max-width: 1199px) {
  .document-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 991px) {
  .portal-shell { display: flex; flex-direction: column; }
  .portal-sidebar { padding: .9rem 1.25rem .5rem; border-right: 0; border-bottom: 1px solid var(--pt-border); }
  .portal-brand { font-size: 1.45rem; }
  .portal-caption { margin: .25rem 0 .5rem; }
  .portal-menu > summary { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--pt-border); min-height: 44px; font-size: .9rem; font-weight: 600; color: var(--pt-primary); cursor: pointer; }
  .portal-menu > summary::-webkit-details-marker { display: none; }
  .portal-menu[open] > summary { margin-bottom: .5rem; }
  .portal-session { margin: .8rem 0 .5rem; }
  .portal-workspace { flex-grow: 1; }
  main { padding: 1.25rem 1.25rem 1.75rem; }
  .document-layout { display: block; }
  .admin-document { max-width: none; }
  .document-layout > aside { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
  .document-menu { margin-bottom: 1rem; }
  .document-layout > aside .document-menu { align-self: start; }
  .document-menu summary { padding: .7rem; }
  .portal-footer { padding: 1rem 1.25rem; }
}
@media (max-width: 575px) {
  .portal-public .portal-sidebar { padding: 1rem 1.25rem; }
  .portal-public main { padding: 1.5rem 1.25rem; }
  .public-process { grid-template-columns: 1fr; gap: 1rem; }
  .page-heading { padding-bottom: .9rem; margin-bottom: 1.1rem; }
  .card-body, .card-body.p-4 { padding: 1.1rem !important; }
  .tool-panel .card-body { display: block; }
  .tool-sign { margin-bottom: 1rem; }
  .action-row { align-items: stretch; }
  .action-row > .btn { width: 100%; }
  .sepa-steps { gap: .3rem .65rem; font-size: .8125rem; margin-bottom: .9rem; }
  .sepa-steps li { padding-bottom: .2rem; }
  .remittance-summary { grid-template-columns: minmax(0, 1fr); gap: .8rem; padding-bottom: 1rem; margin-bottom: 1rem; }
  .remittance-facts { gap: .8rem 1rem; }
  .remittance-creditor { font-size: .875rem; }
  .cabinet-fields { display: block; }
  .document-layout > aside { gap: .5rem; }
  .document-menu summary { font-size: .9rem; }
  .document-page .table > :not(caption) > * > * { padding: .65rem .4rem; font-size: .875rem; }
  .admin-actions { gap: .4rem 1rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .portal-sidebar, .portal-footer, .document-menu, .admin-guide aside, .admin-actions, .admin-copy { display: none !important; }
  .portal-shell, .portal-workspace, .document-layout { display: block; }
  body, main, .admin-code pre { background: white !important; color: black !important; }
  main { max-width: none; padding: 0 !important; }
  .admin-document { max-width: none; width: 100%; }
  .document-page code { color: black; }
  .admin-code pre { white-space: pre-wrap; overflow: visible; overflow-wrap: anywhere; font-size: 9pt; }
  .admin-code pre code { overflow-wrap: anywhere; }
  .document-page .table-responsive { overflow: visible; }
  .document-page h2, .document-page h3, .document-page h4 { break-after: avoid; }
  .document-page a { color: black; text-decoration: underline; }
}
