/* This stylesheet is loaded only by portail.html. */
.admin-appearance-options { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.admin-appearance-options button { background:transparent; color:var(--portal-color-text); border:1px solid var(--portal-color-border); border-radius:8px; min-height:42px; padding:8px 18px; font:inherit; cursor:pointer; }
.admin-appearance-options button[aria-pressed="true"] { color:var(--portal-color-accent-strong); border-color:var(--portal-color-accent); background:var(--portal-color-field-background); box-shadow:inset 0 0 0 1px var(--portal-color-accent); }
.admin-appearance-options button:focus-visible { outline:2px solid var(--portal-color-accent); outline-offset:3px; }
.admin-appearance-card p { color:var(--portal-color-muted); font-size:.85rem; }
.admin-portal-page .admin-portal-nav-parent > span:last-child { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex:0 0 18px; }
.admin-portal-chevron { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
#adminAccountView .admin-account-edit-card > summary::after { content:""; width:16px; height:16px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
#adminAccountView .admin-account-edit-card[open] > summary::after { transform:rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .admin-portal-page .admin-portal-nav-parent > span:last-child, #adminAccountView .admin-account-edit-card > summary::after { transition:none; } }

html[data-portal-theme="dark"] { color-scheme:dark; background:#101a22; }
html[data-portal-theme="dark"] .admin-portal-page {
  --portal-color-background:#101a22;
  --portal-color-surface:#192630;
  --portal-color-surface-raised:#20323e;
  --portal-color-text:#e1ebef;
  --portal-color-brand:#edf5f7;
  --portal-color-heading:#edf5f7;
  --portal-color-muted:#a8bbc5;
  --portal-color-accent:#65cbd9;
  --portal-color-accent-strong:#8bdeea;
  --portal-color-border:#3b515f;
  --portal-color-header-border:#304551;
  --portal-color-border-soft:#304551;
  --portal-color-field-border:#48616f;
  --portal-color-hover-border:#65cbd9;
  --portal-color-field-background:#13212b;
  --portal-focus-ring:rgba(101,203,217,.3);
  --ink:#e1ebef; --muted:#a8bbc5; --line:#3b515f;
  background:var(--portal-color-background) !important;
  color:var(--portal-color-text) !important;
}
/* Shared surfaces, including modules opened within the portal. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-portal-topbar,.admin-portal-sidebar,dialog,
  [class$="-card"],[class*="-card "],[class$="-panel"],[class*="-panel "],
  [class$="-popover"],[class$="-menu"],[class$="-dialog"],
  .admin-portal-overview-card,.admin-portal-workspace-head,
  .admin-portal-nav-submenu,.admin-account-identity,
  table,thead,tbody,tfoot,tr,th,td,fieldset
) { background-color:var(--portal-color-surface) !important; color:var(--portal-color-text) !important; border-color:var(--portal-color-border-soft) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(h1,h2,h3,h4,strong,label,legend,summary) { color:var(--portal-color-heading) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(p,small,[class$="-description"],[class$="-subtitle"],[class$="-meta"],[class$="-hint"]) { color:var(--portal-color-muted) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(a,.admin-portal-nav-icon) { color:var(--portal-color-accent) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(input,select,textarea,button,.ghost-button) { background:var(--portal-color-field-background) !important; color:var(--portal-color-text) !important; border-color:var(--portal-color-field-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(input,textarea)::placeholder { color:#91a8b5; opacity:1; }
html[data-portal-theme="dark"] .admin-portal-page :is(button[type="submit"],.admin-primary-button) { background:#126f80 !important; color:#fff !important; border-color:#42a9bb !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(button,a):hover { border-color:var(--portal-color-hover-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([aria-current="page"],[aria-pressed="true"],.admin-portal-nav a.active) { background:#203e4a !important; color:#9ae5ee !important; border-color:#65cbd9 !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(th,.admin-portal-overview-card-footer,.admin-overview-direct-link,.admin-overview-space-tools,[class$="-table-head"]) { background:#20323e !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="error"],[data-tone="danger"],.error) { color:#ffb4b4 !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="warning"],.warning) { color:#f5d58c !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="success"],[data-tone="ok"],.success) { color:#98dfbb !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(input,select,textarea,button,a):focus-visible { outline:2px solid #65cbd9; outline-offset:2px; }
html[data-portal-theme="dark"] .admin-portal-page :disabled { opacity:.55; }
html[data-portal-theme="dark"] .admin-portal-page dialog::backdrop { background:rgba(0,0,0,.65); }
html[data-portal-theme="dark"] .admin-portal-federal-logo { background:#fff; border-radius:6px; padding:4px; }

/* Component surfaces: keep the light palette out of portal modules. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-portal-engagements-view,.admin-portal-access-view,.admin-portal-dtn-view,
  .admin-dtn-grid,.admin-dtn-qualifiers,
  [role="table"],
  [role="row"],
  .admin-access-table,.admin-access-row,
  .admin-access-row-summary,
  .admin-engagements-competition,
  .admin-engagements-club-swimmers-directory-table
) { background:var(--portal-color-surface) !important; color:var(--portal-color-text) !important; border-color:var(--portal-color-border-soft) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-portal-scope-context,
  .admin-account-scope-sentence,
  .admin-account-notification-setting,
  .admin-account-scope-list > div,
  .admin-account-capabilities span,.admin-engagements-competition-entry-badge,
  .admin-access-status.inactive,
  .admin-engagements-calendar-filters,
  .admin-engagements-national-filters,
  .admin-engagements-calendar-loading,
  .admin-engagements-empty,
  .admin-engagements-open-water-empty,
  .admin-engagements-club-swimmers-directory-sex-filter,
  .admin-engagements-club-swimmers-sex-filter,
  .admin-engagements-club-swimmers-section-empty,
  .admin-engagements-club-swimmer-events-empty,
  .admin-engagements-create-header,
  .admin-engagements-invited-regions-summary,
  .admin-dtn-toolbar,
  .admin-dtn-inline-loading,
  .admin-dtn-summary-loading,
  .admin-dtn-summary-empty,
  .admin-dtn-empty,
  .admin-record-module-status,
  .admin-access-filters,
  .admin-access-empty,
  .admin-access-row-expanded,
  .admin-national-audit-filters,
  .admin-national-requests-empty
) { background:var(--portal-color-surface-raised) !important; color:var(--portal-color-text) !important; border-color:var(--portal-color-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-engagements-club-swimmers-directory-head,
  .admin-engagements-club-swimmers-directory-activity-separator,
  .admin-engagements-event-row-head,
  .admin-engagements-club-recap-row-head,
  .admin-engagements-mail-jobs-row-head,
  .admin-engagements-statistics-gender-heading,
  .admin-engagements-statistics-row-head,
  [role="columnheader"]
) { background:var(--portal-color-surface-raised) !important; color:var(--portal-color-heading) !important; border-color:var(--portal-color-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-account-capabilities-details,
  .admin-account-notification-setting,
  .admin-access-row,
  .admin-engagements-competition
) { border-color:var(--portal-color-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-simple-card-head > div > span,
  .admin-access-row-expanded-data span,
  .admin-engagements-club-swimmers-directory-row > span
) { color:var(--portal-color-muted) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-portal-scope-context button { background:transparent !important; color:inherit !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-account-scope-sentence { border-left-color:var(--portal-color-accent) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-portal-nav button,
  .admin-portal-nav-icon,
  .admin-portal-chevron
) { background:transparent !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-portal-nav a:hover,
  .admin-portal-nav button:hover,
  .admin-access-row-summary:hover,
  .admin-engagements-competition:hover
) { background:var(--portal-color-surface-raised) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-portal-nav :is(a.active,[aria-current="page"]) { background:#203e4a !important; color:#9ae5ee !important; }

/* Tint icon containers, never the SVG itself. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-simple-card-icon,
  .admin-overview-card-icon
) { background:#203e4a !important; color:#9edbe5 !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-simple-card-icon.tone-email,
  .admin-overview-card-icon.tone-dtn
) { background:#20364e !important; color:#a5ceff !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-simple-card-icon.tone-security,
  .admin-overview-card-icon.tone-access
) { background:#342c49 !important; color:#d0bdff !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-simple-card-icon.tone-request,
  .admin-overview-card-icon.tone-engagements
) { background:#263d37 !important; color:#a9dfc9 !important; }

/* Preserve the gender cues in data tables with subdued dark backgrounds. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-engagements-club-swimmers-directory-row[data-sex="F"],
  .admin-engagements-statistics-individual-row[data-sex="F"],
  .admin-engagements-club-entry-row[data-sex="F"],
  .admin-engagements-club-swimmer-row[data-sex="F"],
  .admin-dtn-listing-table tbody tr[data-sex="F"] > td
) { background:#322938 !important; color:var(--portal-color-text) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-engagements-club-swimmers-directory-row[data-sex="M"],
  .admin-engagements-statistics-individual-row[data-sex="M"],
  .admin-engagements-club-entry-row[data-sex="M"],
  .admin-engagements-club-swimmer-row[data-sex="M"],
  .admin-dtn-listing-table tbody tr[data-sex="M"] > td
) { background:#203347 !important; color:var(--portal-color-text) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-engagements-club-entry-last-name,
  .admin-engagements-club-entry-actions
) { background:inherit !important; color:inherit !important; }

/* Semantic states remain distinguishable in both themes. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  [data-tone="error"],
  [data-tone="danger"],
  .danger-button,
  .admin-engagements-entry-status[data-entry-status="closed"]
) { background:#432a31 !important; color:#ffb4b4 !important; border-color:currentColor !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="error"],[data-tone="danger"],.danger-button,.admin-engagements-entry-status[data-entry-status="closed"]) :is(strong,small,p) { color:inherit !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  [data-tone="warning"],
  .admin-engagements-edit-state[data-state="dirty"],
  .admin-engagements-edit-state[data-state="deletion-pending"]
) { background:#403723 !important; color:#f5d58c !important; border-color:currentColor !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="warning"],.admin-engagements-edit-state[data-state="dirty"],.admin-engagements-edit-state[data-state="deletion-pending"]) :is(strong,small,p) { color:inherit !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-access-status.active,
  [data-tone="success"],
  [data-tone="ok"],
  .admin-engagements-entry-status[data-entry-status="open"]
) { background:#203e33 !important; color:#98dfbb !important; border-color:currentColor !important; }
html[data-portal-theme="dark"] .admin-portal-page :is([data-tone="success"],[data-tone="ok"],.admin-engagements-entry-status[data-entry-status="open"]) :is(strong,small,p) { color:inherit !important; }

/* Details confirmed in the connected calendar and club directory. */
html[data-portal-theme="dark"] .admin-portal-page :is(.admin-engagements-competition-scope > span,.admin-engagements-competitions-table-head) { background:var(--portal-color-surface-raised) !important; color:var(--portal-color-text) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(.admin-portal-scope-context span,.admin-engagements-club-swimmers-directory-activity-separator span) { color:var(--portal-color-muted) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-engagements-club-swimmer-license-value { color:var(--portal-color-text) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(.admin-engagements-competition-date,.admin-engagements-club-swimmer-license-status) { color:var(--portal-color-accent) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-engagements-club-swimmer-license-status:is([aria-label*="contrôler" i],[aria-label*="vérifier" i],[aria-label*="Rejetée" i],[aria-label*="Conflit" i],[aria-label*="invalide" i]) { color:#f5d58c !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(.admin-engagements-competition-group > h4,.admin-engagements-form-section-grid > label) { border-color:var(--portal-color-border) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-engagements-club-swimmers-directory-name-button { background:transparent !important; }

/* Background images paint above background-color: replace the complete light
   gradient on space headers and the national priority card in dark mode. */
html[data-portal-theme="dark"] .admin-portal-page :is(
  .admin-overview-head,.admin-tool-workspace-head,
  .admin-records-workspace-head,.admin-module-workspace-head
) { background:var(--portal-color-surface) !important; border-color:var(--portal-color-border-soft) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-national-home-card-primary { background:var(--portal-color-surface-raised) !important; }
html[data-portal-theme="dark"] .admin-portal-page .admin-overview-head > span { color:var(--portal-color-accent) !important; }
html[data-portal-theme="dark"] .admin-portal-page :is(.admin-overview-card-label,.admin-national-home-group-head > span) { color:var(--portal-color-muted) !important; }
@media (max-width:760px) {
  html[data-portal-theme="dark"] .admin-portal-page :is(
    .admin-overview-head,.admin-tool-workspace-head,
    .admin-records-workspace-head,.admin-module-workspace-head
  ) { background:transparent !important; }
}

@media print {
  html[data-portal-theme="dark"] { color-scheme:light; }
  html[data-portal-theme="dark"] .admin-portal-page,
  html[data-portal-theme="dark"] .admin-portal-page * { background:white !important; color:black !important; box-shadow:none !important; }
}
