:root {
  --readability-black: #111827;
  --readability-text: #1f2937;
  --readability-secondary: #374151;
  --readability-muted: #4b5563;
}

body {
  color: var(--readability-text);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-body,
.portal-page,
.admin-content,
.card,
.modal-content,
.dropdown-menu {
  color: var(--readability-text);
}

:where(.page-body, .portal-page, .admin-content, .card, .modal-content) p,
:where(.page-body, .portal-page, .admin-content, .card, .modal-content) li,
:where(.page-body, .portal-page, .admin-content, .card, .modal-content) td,
:where(.page-body, .portal-page, .admin-content, .card, .modal-content) label {
  color: var(--readability-text);
  font-weight: 600;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
strong, b, th,
.fw-bold, .f-w-700, .f-w-800 {
  color: var(--readability-black);
  font-weight: 800;
}

small,
.small,
.text-muted,
.text-secondary,
.form-text,
.help-block,
.portal-muted,
.portal-card__title p,
.portal-kpi__copy span,
.regions-premium-link__copy small,
.regions-premium-map-title p,
.regions-premium-panel__head p {
  color: var(--readability-muted) !important;
  font-weight: 650 !important;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
}

/* Taille minimale commune pour les explications et informations secondaires. */
.portal-hero p,
.portal-card__title p,
.portal-kpi__copy span,
.portal-map-note,
.portal-toolbar__count,
.portal-region-summary span,
.regions-map-intro p,
.regions-map-list-heading,
.regions-map-panel__footer,
.regions-map-note,
.stats-classic-page p,
.project-detail-page p,
.admin-content .breadcrumb,
.admin-content .dataTables_wrapper,
.admin-content .form-label,
.admin-topbar__identity small,
.admin-account__copy small,
.admin-sidebar__brand span,
.admin-sidebar__section,
.admin-sidebar__account small,
.footer,
.footer p {
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
}

.admin-sidebar .sidebar-submenu a,
.admin-account__menu a,
.admin-content .btn,
.admin-content .alert {
  font-size: 0.82rem !important;
}

.login-main .theme-form > p,
.login-main .theme-form > .text-muted,
.intro > p,
.otp-help,
.legal {
  color: var(--readability-muted) !important;
  font-size: 0.9rem !important;
  font-weight: 650 !important;
  line-height: 1.55 !important;
}

.form-control,
.form-select,
input,
select,
textarea {
  color: var(--readability-black) !important;
  font-weight: 650 !important;
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
  color: #596273 !important;
  font-weight: 600 !important;
  opacity: 1;
}

.table,
.table td,
.table th {
  color: var(--readability-text);
}

.table td { font-weight: 600; }
.table th { font-weight: 800; }

.user-sidebar__link,
.pbi-sidebar__link,
.admin-sidebar .sidebar-link h6,
.admin-sidebar .sidebar-submenu a {
  font-weight: 800 !important;
}

.footer,
.footer p,
.footer-copyright,
.footer-copyright p {
  color: var(--readability-secondary) !important;
  font-weight: 650 !important;
}

/* Conserver un contraste blanc sur les surfaces colorées. */
.text-white,
.text-white *,
.btn-primary,
.btn-primary *,
.btn-danger,
.btn-danger *,
.bg-primary,
.bg-primary *,
.portal-hero,
.portal-hero *,
.regions-premium-hero,
.regions-premium-hero *,
.regions-premium-link.is-active,
.regions-premium-link.is-active *,
.admin-sidebar .sidebar-link.active,
.admin-sidebar .sidebar-link.active *,
.admin-sidebar .sidebar-list.active > .sidebar-link,
.admin-sidebar .sidebar-list.active > .sidebar-link * {
  color: #ffffff !important;
}

.regions-premium-link.is-active .regions-premium-link__icon,
.regions-premium-link.is-active .regions-premium-link__arrow,
.admin-sidebar .sidebar-link.active .admin-nav-icon,
.admin-sidebar .sidebar-list.active > .sidebar-link .admin-nav-icon {
  color: #f39159 !important;
}

/* Alignement commun des conteneurs d'icônes de l'application. */
:where(span, div, a, button)[class$="__icon"],
:where(span, div, a, button)[class*="__icon "],
:where(span, div, a, button)[class$="-icon"],
:where(span, div, a, button)[class*="-icon "] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
}

:where(span, div, a, button)[class$="__icon"] > :where(i, svg),
:where(span, div, a, button)[class*="__icon "] > :where(i, svg),
:where(span, div, a, button)[class$="-icon"] > :where(i, svg),
:where(span, div, a, button)[class*="-icon "] > :where(i, svg) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: auto !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}
