/* Opentry — surcharges légères au-dessus de Paper Dashboard 2 Pro */

/* Anti-flash mode sombre + transition douce entre pages */
html {
  background-color: rgb(244, 243, 239);
}

html.dark-mode {
  background-color: #000008;
  color-scheme: dark;
}

html.dark-mode body {
  background-color: #000008;
}

/* Fondu uniquement à la sortie (clic lien), jamais au chargement */
html.page-transitions-enabled.page-leaving body:not(.login-page) #wrapper {
  opacity: 0;
  transition: opacity var(--page-transition-duration, 0ms) ease;
  pointer-events: none;
}

.ui-settings-page-transition-preview {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  padding: 12px;
}

.ui-settings-page-transition-preview__panel {
  width: 100%;
  height: 36px;
  border-radius: 4px;
  background: var(--ui-portal-theme-color, #005961);
  opacity: 1;
}

/* DataTables — colonnes date/heure au minimum de largeur */
table.dataTable thead th.dt-col-compact,
table.dataTable tbody td.dt-col-compact {
  width: 1%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* DataTables — masquer « Traitement en cours… » (flash à chaque rechargement AJAX) */
div.dataTables_wrapper div.dataTables_processing {
  display: none !important;
}

/* DataTables — pagination à gauche, recherche à droite (même ligne) */
div.dataTables_wrapper > .dataTables_length,
div.dataTables_wrapper > .dt-buttons {
  float: left;
  margin: 0 0.75rem 10px 0;
}

div.dataTables_wrapper > .dataTables_filter {
  float: right;
  clear: none !important;
  margin: 0 0 10px 0;
  text-align: right;
}

div.dataTables_wrapper > .dataTables_scroll,
div.dataTables_wrapper > table.dataTable {
  clear: both;
}

div.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

div.dataTables_wrapper .dataTables_search_wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}

div.dataTables_wrapper .dataTables_search_input {
  margin-left: 0 !important;
  min-width: 12rem;
}

div.dataTables_wrapper .dataTables_search_input.has-search-value {
  padding-right: 2rem;
}

div.dataTables_wrapper .dataTables_search_clear {
  display: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #718096;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

div.dataTables_wrapper .dataTables_search_clear.is-visible {
  display: inline-flex;
}

div.dataTables_wrapper .dataTables_search_clear.is-visible:hover,
div.dataTables_wrapper .dataTables_search_clear.is-visible:focus {
  color: #2d3748;
  outline: none;
}

/* Dual-listbox — croix pour vider le champ Filtrer */
.bootstrap-duallistbox-container .dataTables_search_wrap {
  display: block;
  position: relative;
  width: 100%;
}

.bootstrap-duallistbox-container .filter.dataTables_search_input {
  width: 100%;
  margin-bottom: var(--spacing-xs, 0.25rem);
}

.bootstrap-duallistbox-container .dataTables_search_input.has-search-value {
  padding-right: 2rem;
}

.bootstrap-duallistbox-container .dataTables_search_clear {
  display: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #718096;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bootstrap-duallistbox-container .dataTables_search_clear.is-visible {
  display: inline-flex;
}

.bootstrap-duallistbox-container .dataTables_search_clear.is-visible:hover,
.bootstrap-duallistbox-container .dataTables_search_clear.is-visible:focus {
  color: #2d3748;
  outline: none;
}

.bootstrap-duallistbox-container .clear1,
.bootstrap-duallistbox-container .clear2 {
  display: none !important;
}

/* Page Utilisateurs — croix pour vider la recherche (colonne gauche) */
.users-split-search-field .dataTables_search_wrap {
  display: block;
  position: relative;
  width: 100%;
}

.users-split-search-field .dataTables_search_input {
  width: 100%;
}

.users-split-search-field .dataTables_search_input.has-search-value {
  padding-right: 2rem;
}

.users-split-search-field .dataTables_search_clear {
  display: none;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #718096;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.users-split-search-field .dataTables_search_clear.is-visible {
  display: inline-flex;
}

.users-split-search-field .dataTables_search_clear.is-visible:hover,
.users-split-search-field .dataTables_search_clear.is-visible:focus {
  color: #2d3748;
  outline: none;
}

/* DataTables — icônes booléennes centrées */
table.dataTable thead th.dt-col-icon,
table.dataTable tbody td.dt-col-icon {
  text-align: center !important;
}

/* DataTables — IP ou nom de domaine (plus large qu'une adresse IPv4 seule) */
table.dataTable thead th.dt-col-host,
table.dataTable tbody td.dt-col-host {
  min-width: 11rem;
  width: 15em;
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.htmx-request#loader,
.htmx-request .loader {
  display: block !important;
}

.htmx-request#main-content {
  opacity: 0.55;
}

body.opentry-session-blocked #wrapper {
  pointer-events: none;
  user-select: none;
}

body.opentry-session-blocked::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(244, 243, 239, 0.55);
}

body.dark-mode.opentry-session-blocked::before {
  background: rgba(0, 0, 8, 0.45);
}

/* SweetAlert « Session expirée » doit rester au-dessus du voile session-blocked
   (9998) et de l’overlay idle (20000) — sinon le bouton « Se reconnecter »
   est assombri et non cliquable. */
body.opentry-session-blocked .swal2-container {
  z-index: 20100;
}

body.opentry-session-blocked .opentry-idle-overlay {
  display: none !important;
  pointer-events: none !important;
}

.opentry-idle-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.45);
}

.opentry-idle-overlay__dialog {
  width: min(100%, 420px);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
}

body.dark-mode .opentry-idle-overlay__dialog {
  background: #1a1a24;
  color: #f1f1f1;
}

.opentry-idle-overlay__icon {
  font-size: 2.5rem;
  color: #fbc658;
  margin-bottom: 0.75rem;
}

.opentry-idle-overlay__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.opentry-idle-overlay__hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #6c757d;
}

body.dark-mode .opentry-idle-overlay__hint {
  color: #adb5bd;
}

.opentry-idle-overlay .opentry-idle-timer {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* Opérateurs — afficher / masquer mot de passe */
.operators-page .password-input-group .form-control {
  border-right: 0;
}

.operators-page .password-input-group .btn-toggle-password {
  border-color: #ced4da;
  background-color: #fff;
  color: #6c757d;
  padding: 0 0.75rem;
  line-height: 1;
}

.operators-page .password-input-group .btn-toggle-password:hover,
.operators-page .password-input-group .btn-toggle-password:focus {
  background-color: #f8f9fa;
  color: #495057;
}

.operators-page .password-input-group:focus-within .form-control,
.operators-page .password-input-group:focus-within .btn-toggle-password {
  border-color: #80bdff;
}

/* Boutons Enregistrer / Annuler — libellés texte (Annuler à gauche, Enregistrer à droite) */
.card-form-actions-footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}

.card .card-footer.card-form-actions-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.container-fluid > .card-footer.card-form-actions-footer,
.access-rights-page-form-wrap .card-form-actions-footer,
.card-form-actions-footer:not(.card-footer) {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: transparent;
  border-top: none;
  padding: 0.75rem 0 0;
  margin: 0;
}

.card-form-actions-footer--inline {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.form-text-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  clear: both;
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.25rem 0;
  pointer-events: auto;
}

.card-form-actions-footer--inline .form-text-actions {
  width: auto;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-module-actions .form-text-actions,
.portal-page-theme.operators-page .operators-page-form-wrap .form-text-actions,
.devices-comm-view .devices-comm-actions .form-text-actions {
  width: 100%;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-text-actions .btn-form-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: none;
  margin: 0;
  padding: 0.45rem 1.15rem;
  border: none;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.form-text-actions .btn-form-text-action:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 89, 97, 0.2);
}

.form-text-actions .btn-form-cancel,
.form-text-actions .btn-form-reset {
  background-color: #66615b;
  color: #fff;
}

.form-text-actions .btn-form-cancel:hover,
.form-text-actions .btn-form-cancel:focus,
.form-text-actions .btn-form-reset:hover,
.form-text-actions .btn-form-reset:focus {
  background-color: #5a5550;
  color: #fff;
}

.form-text-actions .btn-form-save {
  background-color: #b8d4db;
  color: #1f2937;
}

.form-text-actions .btn-form-save:hover,
.form-text-actions .btn-form-save:focus {
  background-color: #a8c9d1;
  color: #111827;
}

.form-text-actions .btn-form-save:active,
.form-text-actions .btn-form-save:focus:active {
  background-color: #a8c9d1 !important;
  color: #111827 !important;
}

.form-text-actions .btn-form-save .fa-save {
  font-size: 0.85em;
}

.operators-page .form-actions-sep,
.settings-page .form-actions-sep,
.devices-page .form-actions-sep,
.users-page .users-form-actions-sep {
  clear: both;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.operators-page .form-icon-actions,
.settings-page .form-icon-actions,
.devices-page .form-icon-actions,
.users-page .form-icon-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  clear: both;
  position: relative;
  z-index: 3;
  padding: 0.25rem 0.5rem 0.5rem;
  pointer-events: auto;
}

.operators-page .form-icon-actions .btn-form-icon,
.settings-page .form-icon-actions .btn-form-icon,
.devices-page .form-icon-actions .btn-form-icon,
.users-page .form-icon-actions .btn-form-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.operators-page .form-icon-actions .btn-form-icon.text-success,
.operators-page .form-icon-actions .btn-form-icon.text-success i,
.settings-page .form-icon-actions .btn-form-icon.text-success,
.settings-page .form-icon-actions .btn-form-icon.text-success i,
.devices-page .form-icon-actions .btn-form-icon.text-success,
.devices-page .form-icon-actions .btn-form-icon.text-success i,
.users-page .form-icon-actions .btn-form-icon.text-success,
.users-page .form-icon-actions .btn-form-icon.text-success i {
  color: var(--color-success) !important;
}

.operators-page .form-icon-actions .btn-form-icon.text-danger,
.operators-page .form-icon-actions .btn-form-icon.text-danger i,
.settings-page .form-icon-actions .btn-form-icon.text-danger,
.settings-page .form-icon-actions .btn-form-icon.text-danger i,
.devices-page .form-icon-actions .btn-form-icon.text-danger,
.devices-page .form-icon-actions .btn-form-icon.text-danger i,
.users-page .form-icon-actions .btn-form-icon.text-danger,
.users-page .form-icon-actions .btn-form-icon.text-danger i {
  color: var(--color-danger) !important;
}

.settings-page .form-icon-actions .btn-form-icon.text-warning,
.settings-page .form-icon-actions .btn-form-icon.text-warning i,
.devices-page .form-icon-actions .btn-form-icon.text-warning,
.devices-page .form-icon-actions .btn-form-icon.text-warning i,
.users-page .form-icon-actions .btn-form-icon.text-warning,
.users-page .form-icon-actions .btn-form-icon.text-warning i {
  color: var(--color-warning) !important;
}

.operators-page .form-icon-actions .btn-form-icon i.fa-2x,
.settings-page .form-icon-actions .btn-form-icon i.fa-2x,
.devices-page .form-icon-actions .btn-form-icon i.fa-2x,
.users-page .form-icon-actions .btn-form-icon i.fa-2x {
  font-size: 2em;
  line-height: 1;
}

.operators-page .form-icon-actions .btn-form-icon:hover,
.operators-page .form-icon-actions .btn-form-icon:focus,
.operators-page .form-icon-actions .btn-form-icon:active,
.settings-page .form-icon-actions .btn-form-icon:hover,
.settings-page .form-icon-actions .btn-form-icon:focus,
.settings-page .form-icon-actions .btn-form-icon:active,
.devices-page .form-icon-actions .btn-form-icon:hover,
.devices-page .form-icon-actions .btn-form-icon:focus,
.devices-page .form-icon-actions .btn-form-icon:active {
  transform: none;
  box-shadow: none;
  float: none;
}

.settings-page .form-icon-actions .btn-form-icon.text-success:hover,
.settings-page .form-icon-actions .btn-form-icon.text-success:focus,
.settings-page .form-icon-actions .btn-form-icon.text-success:active,
.settings-page .form-icon-actions .btn-form-icon.text-warning:hover,
.settings-page .form-icon-actions .btn-form-icon.text-warning:focus,
.settings-page .form-icon-actions .btn-form-icon.text-warning:active,
.devices-page .form-icon-actions .btn-form-icon.text-success:hover,
.devices-page .form-icon-actions .btn-form-icon.text-success:focus,
.devices-page .form-icon-actions .btn-form-icon.text-success:active,
.devices-page .form-icon-actions .btn-form-icon.text-warning:hover,
.devices-page .form-icon-actions .btn-form-icon.text-warning:focus,
.devices-page .form-icon-actions .btn-form-icon.text-warning:active {
  color: inherit !important;
}

.settings-page .form-icon-actions .btn-form-icon.text-success:hover i,
.settings-page .form-icon-actions .btn-form-icon.text-success:focus i,
.settings-page .form-icon-actions .btn-form-icon.text-success:active i,
.devices-page .form-icon-actions .btn-form-icon.text-success:hover i,
.devices-page .form-icon-actions .btn-form-icon.text-success:focus i,
.devices-page .form-icon-actions .btn-form-icon.text-success:active i {
  color: var(--color-success) !important;
}

.settings-page .form-icon-actions .btn-form-icon.text-warning:hover i,
.settings-page .form-icon-actions .btn-form-icon.text-warning:focus i,
.settings-page .form-icon-actions .btn-form-icon.text-warning:active i,
.devices-page .form-icon-actions .btn-form-icon.text-warning:hover i,
.devices-page .form-icon-actions .btn-form-icon.text-warning:focus i,
.devices-page .form-icon-actions .btn-form-icon.text-warning:active i {
  color: var(--color-warning) !important;
}

.operators-page .perm-checkbox-store {
  display: none;
}

/* Permissions opérateurs — navigation verticale (173) + toggles */
.operators-page .perm-pills-layout {
  margin-left: 0;
  margin-right: 0;
}

.operators-page .perm-pills-nav-col {
  padding-right: 0.75rem;
}

.operators-page .perm-pills-nav {
  border-right: 1px solid var(--perm-section-border-soft, #c8deb3);
  padding-right: 0.5rem;
}

.operators-page .perm-pills-nav .nav-link {
  color: var(--perm-section-text, #3d5c22);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.25rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.operators-page .perm-pills-nav .nav-link:hover {
  background: var(--perm-section-row-bg, #f7fbf4);
  color: var(--perm-section-text, #3d5c22);
}

.operators-page .perm-pills-nav .nav-link.active {
  background: var(--perm-section-border, #77be32);
  color: #fff;
}

.operators-page .perm-pills-content-col {
  padding-left: 0.75rem;
}

.operators-page .perm-pills-pane.perm-filter-hidden {
  display: none !important;
}

.operators-page .perm-resource-block {
  --perm-section-header-bg: #e8f3e1;
  --perm-section-border: #77be32;
  --perm-section-border-soft: #c8deb3;
  --perm-section-text: #3d5c22;
  --perm-section-row-bg: #f7fbf4;
  --perm-section-row-line: #e3edd9;
  background: var(--perm-section-row-bg);
  border: 1px solid var(--perm-section-row-line);
  border-left: 3px solid var(--perm-section-border);
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}

.operators-page .perm-resource-block.perm-filter-hidden {
  display: none;
}

.operators-page .perm-resource-block--inactive {
  --perm-section-header-bg: #f0f0f0;
  --perm-section-border: #adb5bd;
  --perm-section-border-soft: #d6d8db;
  --perm-section-text: #6c757d;
  --perm-section-row-bg: #f8f9fa;
  --perm-section-row-line: #e9ecef;
  opacity: 0.72;
}

.operators-page .perm-resource-block--inactive .perm-module-inactive-hint {
  font-style: italic;
}

.operators-page .perm-resource-block--inactive .custom-control-label {
  color: #868e96;
}

.operators-page .perm-resource-title {
  font-weight: 700;
  color: var(--perm-section-text);
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

.operators-page .perm-resource-title .perm-menu-name::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
  background: var(--perm-section-dot, #77be32);
  box-shadow: 0 0 0 2px var(--perm-section-dot-ring, rgba(119, 190, 50, 0.22));
}

.operators-page .perm-toggle-item {
  margin-bottom: 0.35rem;
}

.operators-page .perm-toggle-item:last-child {
  margin-bottom: 0;
}

.operators-page .perm-toggle-switch.custom-switch {
  padding-left: 2.75rem;
  min-height: 1.6rem;
}

.operators-page .perm-toggle-switch .custom-control-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text, #3c4858);
  padding-top: 0.15rem;
}

.operators-page .perm-level-select {
  max-width: 100%;
  min-width: 12rem;
}

.operators-page .perm-level-hint {
  line-height: 1.45;
  font-size: var(--font-size-base, 0.875rem);
  color: var(--color-text, #3c4858);
  font-weight: 500;
}

.operators-page .perm-levels-filter {
  max-width: 14rem;
}

.operators-page .perm-ui-hint {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.operators-page .perm-levels-table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.operators-page .perm-levels-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  font-family: var(--ui-font-family, inherit);
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-black, #3c4858);
  background: #fff;
  border-color: #dee2e6;
  box-shadow: inset 0 -1px 0 #dee2e6;
  vertical-align: middle;
}

.operators-page .perm-levels-table .perm-section-row td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-top-width: 1px;
  border-bottom-width: 1px;
  cursor: pointer;
  user-select: none;
}

.operators-page .perm-levels-table .perm-section-row:hover td {
  filter: brightness(0.98);
}

.operators-page .perm-levels-table .perm-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.operators-page .perm-levels-table .perm-section-chevron {
  width: 0.7rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--perm-section-text);
}

.operators-page .perm-levels-table tr.perm-section-row.is-expanded .perm-section-chevron {
  transform: rotate(90deg);
}

.operators-page .perm-levels-table .perm-section-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--perm-section-text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--perm-section-border-soft);
}

.operators-page .perm-levels-table tr.perm-block.perm-section-panel-hidden,
.operators-page .perm-levels-table tr.perm-block.perm-filter-hidden,
.operators-page .perm-levels-table tr.perm-section-row.perm-filter-hidden {
  display: none;
}

.operators-page .perm-levels-toolbar-actions {
  gap: 0.5rem;
}

.operators-page .perm-levels-bulk-actions .btn {
  font-size: 0.8125rem;
}

.operators-page .perm-levels-accordion-actions .btn {
  white-space: nowrap;
}

.operators-page .perm-levels-table tbody > tr.perm-section-row:first-child td {
  border-top: none;
}

.operators-page .perm-levels-table .perm-section-label {
  font-family: var(--ui-font-family, inherit);
  font-size: var(--font-size-base, 0.875rem);
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.operators-page .perm-levels-table .perm-section-label strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--perm-section-text);
}

.operators-page .perm-levels-table .perm-section-label strong::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--perm-section-dot);
  box-shadow: 0 0 0 2px var(--perm-section-dot-ring);
}

.operators-page .perm-levels-table tr.perm-section-row td {
  background: var(--perm-section-header-bg);
  border-top-color: var(--perm-section-border-soft);
  border-bottom-color: var(--perm-section-border-soft);
}

.operators-page .perm-levels-table tr.perm-block td {
  background-color: var(--perm-section-row-bg);
  border-top-color: var(--perm-section-row-line);
}

.operators-page .perm-levels-table tr.perm-block td:first-child {
  box-shadow: inset 3px 0 0 var(--perm-section-border);
}

/* Thème unique pour toutes les sections (couleur Système) */
.operators-page .perm-levels-table tr.perm-section-row,
.operators-page .perm-levels-table tr.perm-block {
  --perm-section-header-bg: #e8f3e1;
  --perm-section-border: #77be32;
  --perm-section-border-soft: #c8deb3;
  --perm-section-text: #3d5c22;
  --perm-section-dot: #77be32;
  --perm-section-dot-ring: rgba(119, 190, 50, 0.22);
  --perm-section-row-bg: #f7fbf4;
  --perm-section-row-line: #e3edd9;
}

.operators-page .perm-levels-table .perm-block-label {
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.operators-page .perm-levels-table .perm-level-col,
.operators-page .perm-levels-table .perm-level-cell {
  width: 28%;
  min-width: 14rem;
  vertical-align: middle;
}

.operators-page .perm-levels-table .perm-detail-cell {
  vertical-align: middle;
  min-width: 14rem;
  background-color: #fff !important;
}

.operators-page .perm-levels-table tr.perm-block .perm-detail-cell .perm-level-hint {
  color: #2f3b4a;
}

.operators-page .perm-levels-table .perm-block {
  flex-basis: auto !important;
}

.operators-page .operator-rights-schema-btn {
  white-space: nowrap;
}

.operators-page .operator-perm-canvas,
.opentry-paper-notice-modal .operator-perm-canvas {
  background: #f8f9fb;
  background-image: radial-gradient(circle, #d8dde6 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 1rem;
  text-align: left;
}

.operators-page .operator-perm-canvas-header,
.opentry-paper-notice-modal .operator-perm-canvas-header {
  display: none;
}

.operators-page .operator-perm-canvas-body,
.opentry-paper-notice-modal .operator-perm-canvas-body {
  --perm-row-height: 72px;
  --perm-spine-x: 0;
  --perm-hline-width: 22px;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.operators-page .operator-perm-canvas-source-col,
.opentry-paper-notice-modal .operator-perm-canvas-source-col {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.operators-page .operator-perm-canvas-source-col::after,
.opentry-paper-notice-modal .operator-perm-canvas-source-col::after {
  content: "";
  position: absolute;
  left: calc(100% - 2px);
  top: 50%;
  width: 20px;
  height: 2px;
  background: #51bcda;
  transform: translateY(-50%);
}

.operators-page .operator-perm-canvas-source,
.opentry-paper-notice-modal .operator-perm-canvas-source {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  color: #66615b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.operators-page .operator-perm-canvas-tree,
.opentry-paper-notice-modal .operator-perm-canvas-tree {
  flex: 1;
  min-width: 0;
  position: relative;
  padding-left: 2px;
}

.operators-page .operator-perm-canvas-tree::before,
.opentry-paper-notice-modal .operator-perm-canvas-tree::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--perm-row-height) / 2);
  bottom: calc(var(--perm-row-height) / 2);
  width: 2px;
  background: #51bcda;
}

.operators-page .operator-perm-canvas-row,
.opentry-paper-notice-modal .operator-perm-canvas-row {
  display: flex;
  align-items: center;
  min-height: var(--perm-row-height);
  padding-left: calc(var(--perm-hline-width) + 2px);
  position: relative;
}

.operators-page .operator-perm-canvas-row::before,
.opentry-paper-notice-modal .operator-perm-canvas-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--perm-hline-width);
  height: 2px;
  background: #51bcda;
  transform: translateY(-50%);
}

.operators-page .operator-perm-canvas-row-cards,
.opentry-paper-notice-modal .operator-perm-canvas-row-cards {
  display: grid;
  grid-template-columns: repeat(var(--perm-cols, 3), minmax(210px, 1fr));
  column-gap: 0.65rem;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.operators-page .operator-perm-canvas-branch,
.opentry-paper-notice-modal .operator-perm-canvas-branch {
  min-width: 0;
}

.operators-page .operator-perm-canvas-shield,
.opentry-paper-notice-modal .operator-perm-canvas-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  margin-right: 0.35rem;
  color: #51bcda;
  flex: 0 0 24px;
}

.operators-page .operator-perm-canvas-card,
.opentry-paper-notice-modal .operator-perm-canvas-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.operators-page .operator-perm-canvas-card-icon,
.opentry-paper-notice-modal .operator-perm-canvas-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f4f3ef;
  color: #66615b;
  flex: 0 0 32px;
}

.operators-page .operator-perm-canvas-card-text,
.opentry-paper-notice-modal .operator-perm-canvas-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.operators-page .operator-perm-canvas-card-label,
.opentry-paper-notice-modal .operator-perm-canvas-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #66615b;
  line-height: 1.25;
  white-space: normal;
}

.operators-page .operator-perm-canvas-card-via,
.opentry-paper-notice-modal .operator-perm-canvas-card-via {
  font-size: 0.78rem;
  color: #9a9a9a;
}


.opentry-paper-notice-modal--operator-perm .modal-dialog,
.opentry-paper-notice-modal--operator-perm .modal-dialog.modal-notice {
  width: auto;
  max-width: min(96vw, 1180px);
  margin-left: auto;
  margin-right: auto;
}

.opentry-paper-notice-modal--operator-perm .modal-body,
.opentry-paper-notice-modal--operator-perm .modal-body.operator-perm-modal {
  max-height: none;
  overflow: visible;
  overflow-x: visible;
}

.opentry-paper-notice-modal--operator-perm .operator-perm-canvas-row-cards {
  width: max-content;
  max-width: none;
  grid-template-columns: repeat(var(--perm-cols, 3), max-content);
  column-gap: 0.65rem;
}

.opentry-paper-notice-modal--operator-perm .operator-perm-canvas-card {
  width: max-content;
  max-width: 280px;
}

.opentry-paper-notice-modal .operator-perm-canvas {
  max-height: none;
  overflow: visible;
}

.opentry-paper-notice-modal--operator-perm .modal-body.is-scrollable {
  overflow: auto;
}

.opentry-paper-notice-modal--operator-perm .modal-body.is-scrollable .operator-perm-canvas {
  max-height: none;
  overflow: visible;
}

/* Dashboard — bloc santé ancré en bas, juste au-dessus du copyright */
body.dashboard-page .main-panel,
#main-content:has(.opentry-dashboard) {
  display: flex;
  flex-direction: column;
}

body.dashboard-page .main-panel {
  min-height: 100vh;
}

body.dashboard-page .main-panel > .content,
#main-content:has(.opentry-dashboard) {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  min-height: calc(100vh - 160px) !important;
  padding-bottom: 0.75rem !important;
}

body.dashboard-page #main-content .opentry-dashboard,
#main-content:has(.opentry-dashboard) .opentry-dashboard {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  width: 100%;
}

.opentry-dashboard__grid {
  flex: 1 1 auto;
  min-height: 420px;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

.opentry-dashboard__hidden-widgets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0 10px 0.65rem;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(60, 72, 88, 0.08);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60, 72, 88, 0.06);
}

.opentry-dashboard__hidden-widgets-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: #3c4858;
  margin-right: 0.35rem;
}

.opentry-dashboard__hidden-widgets-bar .dashboard-widget-show-btn {
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.2rem 0.55rem;
}

.opentry-dashboard__hidden-widgets-stash {
  display: none !important;
}

.opentry-dashboard__grid.is-grid-ready {
  opacity: 1;
  pointer-events: auto;
}

.opentry-dashboard__health {
  flex: 0 0 auto;
  margin-top: auto !important;
  width: 100%;
  padding-top: 1rem;
}

/* Dashboard — santé système */
.opentry-system-health {
  width: 100%;
}

.opentry-health-bento {
  background: #fff;
  border: 1px solid rgba(60, 72, 88, 0.08);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60, 72, 88, 0.06);
  padding: 1rem 1.15rem;
}

.opentry-health-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(60, 72, 88, 0.08);
}

.opentry-health-card-header .card-category {
  font-size: var(--ui-font-size-base, 12px);
  font-weight: 600;
  color: #3c4858;
}

.opentry-health-card-header-actions {
  flex: 0 0 auto;
  line-height: 1;
}

.opentry-health-card-header .btn-health-collapse {
  padding: 0 !important;
  min-width: 2rem;
  line-height: 1;
}

.opentry-health-card-header .btn-health-collapse i.fa {
  font-size: 1.75rem !important;
  color: #3c4858 !important;
  line-height: 1;
  vertical-align: middle;
}

.opentry-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.opentry-health-card {
  background: #f8fafb;
  border: 1px solid rgba(60, 72, 88, 0.07);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  min-width: 0;
}

.opentry-health-card-head .badge,
.opentry-health-footer .badge {
    font-size: 11px;
    font-weight: 700;
    padding: 0.35em 0.6em;
    text-transform: none;
    letter-spacing: 0;
}

.opentry-health-card-head .badge-success,
.opentry-health-footer .badge-success {
    background-color: var(--color-success-dark) !important;
    color: var(--color-white) !important;
}

.opentry-health-card-head .badge-warning,
.opentry-health-footer .badge-warning {
    background-color: var(--color-warning) !important;
    color: var(--color-white) !important;
}

.opentry-health-card-head .badge-danger,
.opentry-health-footer .badge-danger {
    background-color: var(--color-danger) !important;
    color: var(--color-white) !important;
}

.opentry-health-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: var(--ui-font-size-base, 12px);
  font-weight: 600;
  color: #3c4858;
}

.opentry-health-card-meta {
  font-size: 0.78rem;
  font-weight: 400;
  color: #8a8a8a;
}

.opentry-health-card-value {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 400;
  color: #2c2c2c;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.opentry-health-card-detail {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: #8a8a8a;
  line-height: 1.3;
}

.opentry-health-progress {
  height: 8px;
  border-radius: 999px;
  background: #e8eef0;
  overflow: hidden;
}

.opentry-health-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--color-success);
  transition: width 0.35s ease, background 0.25s ease;
}

.opentry-health-progress > i.is-warning { background: #fbc658; }
.opentry-health-progress > i.is-danger { background: #ef8157; }

.opentry-health-temps {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.opentry-health-temp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(107, 208, 152, 0.1);
  font-size: 0.78rem;
}

.opentry-health-temp span {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  font-size: 0.68rem;
}

.opentry-health-temp.is-warning { background: rgba(251, 198, 88, 0.15); }
.opentry-health-temp.is-danger { background: rgba(239, 129, 87, 0.15); }

.opentry-health-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(60, 72, 88, 0.08);
  font-size: 0.78rem;
  color: #8a8a8a;
}

/* Dashboard GridStack */
#dashboardGrid.grid-stack {
  background: transparent;
  min-height: 280px;
  width: 100%;
}

#dashboardGrid .grid-stack-item-content,
#dashboardGrid .grid-stack-item {
  transition: none !important;
}

#dashboardGrid .grid-stack-item-content {
  overflow: visible;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60, 72, 88, 0.06);
  background: transparent;
}

#dashboardGrid .grid-stack-item {
  touch-action: none;
}

#dashboardGrid .ui-resizable-handle,
#dashboardGrid .grid-stack-item > .ui-resizable-se {
  z-index: 20;
}

.opentry-dashboard-widget {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.opentry-dashboard-widget__drag {
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(60, 72, 88, 0.08);
  position: relative;
  z-index: 6;
  pointer-events: auto;
  touch-action: none;
}

.opentry-dashboard-widget__drag:active {
  cursor: grabbing;
}

.opentry-dashboard-widget__hero.users-welcome-hero {
  padding: 0.5rem 0.75rem;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: nowrap;
}

.opentry-dashboard-widget__hero h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.1rem !important;
  line-height: 1.2;
}

.opentry-dashboard-widget__hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.opentry-dashboard-widget__hero-text p {
  line-height: 1.2;
  font-size: 0.78rem;
}

.opentry-dashboard-widget__hero-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 0.35rem;
}

.dashboard-widget-search-shell.dataTables_wrapper {
  width: auto !important;
  flex: 0 0 auto;
  padding: 0;
}

.opentry-dashboard-widget__hero-actions .dashboard-widget-search-shell > .dataTables_filter,
.opentry-dashboard-widget__search.dataTables_filter {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  text-align: right;
  white-space: nowrap;
}

.opentry-dashboard-widget .users-welcome-hero-icon {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  border-radius: 10px;
}

@media (max-width: 575px) {
  .opentry-dashboard-widget__hero.users-welcome-hero {
    flex-wrap: wrap;
  }

  .opentry-dashboard-widget__hero-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    margin-top: 0.35rem;
  }
}

.opentry-dashboard-widget__body {
  min-height: 0;
  overflow: hidden;
  padding: 0.35rem 0.75rem 0.5rem;
}

.dashboard-widget-table-wrap {
  height: 100%;
  min-height: 120px;
  overflow: auto;
}

.dashboard-widget-table-wrap .dataTables_wrapper,
.dashboard-widget-table-wrap table {
  margin-bottom: 0;
}

.dashboard-widget-table-wrap .dashboard-widget-table thead th,
.dashboard-widget-table-wrap table.dataTable thead th {
  font-size: var(--dashboard-table-header-font-size, 12px) !important;
  font-weight: var(--dashboard-table-header-font-weight, 600) !important;
  line-height: 1.2 !important;
  padding: 0.3rem 0.45rem !important;
  letter-spacing: 0;
  white-space: nowrap;
  border-bottom: 1px solid rgba(60, 72, 88, 0.14) !important;
}

.dashboard-widget-table-wrap .dashboard-widget-table tbody td,
.dashboard-widget-table-wrap table.dataTable tbody td {
  font-size: var(--dashboard-table-body-font-size, 14px);
  font-weight: var(--dashboard-table-body-font-weight, 400);
  padding: 0.35rem 0.45rem !important;
  line-height: 1.25;
  vertical-align: middle;
}

.dashboard-widget-table-wrap thead th.small,
.dashboard-widget-table-wrap thead th.text-muted {
  font-size: var(--dashboard-table-header-font-size, 12px) !important;
  font-weight: var(--dashboard-table-header-font-weight, 600) !important;
  color: inherit !important;
}

.dashboard-users-doors,
.dashboard-users-doors-preview {
  display: inline-block;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.dashboard-users-doors-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  min-width: 0;
}

.dashboard-users-doors-btn {
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-users-doors-dialog-list li {
  margin-bottom: 0.25rem;
}

.opentry-dashboard-widget [class$="-page-table-wrap"] .dataTables_wrapper {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.dashboard-users-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.dashboard-users-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.dashboard-users-row-text {
  min-width: 0;
}

.dashboard-users-row-text strong {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}

.dashboard-users-door {
  line-height: 1.2;
  margin-top: 0.1rem;
}

#dashboardGrid .dashboard-widget-table td {
  vertical-align: middle;
}

.opentry-dashboard-widget__footer {
  border-top: 1px solid rgba(60, 72, 88, 0.08);
  padding: 0.55rem 1rem 0.7rem;
  font-size: 0.85rem;
}

/* Dashboard — cartes stats : même typo que santé système */
#dashboardGrid .card-stats .card-body .numbers,
.opentry-dashboard-widget .card-body .numbers {
  font-size: var(--ui-font-size-base, 12px) !important;
  line-height: 1.3;
}

#dashboardGrid .card-stats .card-body .numbers .card-category,
.opentry-dashboard-widget .card-header .card-category {
  color: #3c4858;
  font-size: var(--ui-font-size-base, 12px);
  font-weight: 600;
  line-height: 1.3;
}

#dashboardGrid .card-stats .card-body .numbers .card-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  color: #2c2c2c;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#dashboardGrid .card-stats .card-text,
.opentry-dashboard-widget .card-text {
  font-size: 0.85rem;
  color: #8a8a8a;
}

#dashboardGrid .card-stats .card-footer .stats,
.opentry-dashboard-widget__footer .stats,
.opentry-dashboard-widget__footer a {
  font-size: 0.85rem;
  color: #8a8a8a;
}

@media (max-width: 991px) {
  .opentry-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .opentry-health-grid {
    grid-template-columns: 1fr;
  }
}

/* Clic souris : ne pas conserver le style focus après activation (clavier : :focus-visible inchangé) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input[type="button"]:focus:not(:focus-visible),
input[type="submit"]:focus:not(:focus-visible),
input[type="reset"]:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

.btn.btn-link:focus:not(:focus-visible),
.navbar .navbar-nav > a.btn.btn-link:focus:not(:focus-visible),
.fc-button.btn-link:focus:not(:focus-visible) {
  background-color: transparent !important;
  color: #66615B !important;
  text-decoration: none !important;
}

.btn.btn-link.text-danger:focus:not(:focus-visible),
.btn-danger.btn-link:focus:not(:focus-visible) {
  color: #dc3545 !important;
}

a:not(.btn):focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
