/*
 * Notifications : cloche de l'en-tete, page Notifications, ecran Integrations.
 * Jetons de couleur de gestion.css (theme clair et sombre) ; aucun style en ligne.
 */

/* ------------------------------------------------------------------ */
/*  Cloche                                                             */
/* ------------------------------------------------------------------ */

.cloche { position: relative; flex: none; }

.cloche-bouton {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--texte-2); cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cloche-bouton:hover, .cloche-bouton[aria-expanded='true'] { background: var(--surface); border-color: var(--bordure); color: var(--texte); }
.cloche-bouton:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cloche-bouton.a-non-lues { color: var(--texte); }

.cloche-compteur {
  position: absolute; top: 0; right: -2px; min-width: 21px; height: 21px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--fond);
  background: var(--argile-plein); color: #fff; font: 800 12.5px/1 var(--police); font-variant-numeric: tabular-nums;
}
.cloche-compteur[hidden] { display: none; }

.cloche-panneau {
  position: absolute; top: calc(100% + 8px); right: -8px; z-index: 60;
  width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 90px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-2);
}
.cloche-panneau[hidden] { display: none; }

.cloche-panneau-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--bordure); }
.cloche-panneau-titre { margin: 0; font: 750 16px/1.2 var(--police-titre); outline: none; }
.cloche-tout-lu { border: 0; background: none; cursor: pointer; padding: 4px 0; font-size: 13px; }
.cloche-tout-lu[hidden] { display: none; }

.cloche-liste { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; overscroll-behavior: contain; }
.cloche-vide { display: flex; align-items: center; gap: 8px; padding: 18px 16px; color: var(--texte-3); font-size: 14px; }

.notif-app {
  display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; width: 100%; padding: 10px 14px;
  border: 0; background: none; text-align: left; color: var(--texte); text-decoration: none; cursor: pointer; font: inherit;
}
.notif-app:hover { background: var(--surface-2); }
.notif-app:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.notif-app-point { width: 8px; height: 8px; margin-top: 6px; border-radius: 999px; background: transparent; }
.est-non-lue > .notif-app-point, .est-non-lue .notif-app-point { background: var(--safran-plein); }
.notif-app-textes { display: grid; gap: 2px; min-width: 0; }
.notif-app-titre { font-weight: 650; font-size: 14px; line-height: 1.3; }
.notif-app:not(.est-non-lue) .notif-app-titre { font-weight: 550; color: var(--texte-2); }
.notif-app-texte { font-size: 13px; line-height: 1.35; color: var(--texte-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-app-date { font-size: 12px; color: var(--texte-3); }

.cloche-invitation { display: grid; gap: 8px; margin: 4px 12px 8px; padding: 10px 12px; border-radius: 10px; background: var(--atlas-fond); color: var(--atlas-texte); font-size: 13px; }
.cloche-invitation[hidden] { display: none; }
.cloche-invitation p { margin: 0; }
.cloche-invitation .btn { justify-self: start; }

.cloche-panneau-pied { border-top: 1px solid var(--bordure); padding: 10px 14px; }
.cloche-tout-voir { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--lien); text-decoration: none; }
.cloche-tout-voir:hover { text-decoration: underline; }

@media (max-width: 640px) {
  /* Cible tactile : 44 px au moins sous le pouce (U-40). */
  .cloche-bouton { width: 44px; height: 44px; }
  .cloche-panneau { position: fixed; top: calc(var(--entete-hauteur) + 4px); left: 12px; right: 12px; width: auto; max-height: calc(100vh - var(--entete-hauteur) - 16px); }
}

/* ------------------------------------------------------------------ */
/*  Page Notifications                                                 */
/* ------------------------------------------------------------------ */

.grille-notifications { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grille-notifications { grid-template-columns: minmax(0, 1fr); } }

.notifs-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.notifs-resume { margin: 0; }
.notifs-filtre { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); }
.notifs-filtre-bouton { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--texte-2); font: 650 14px var(--police); cursor: pointer; }
.notifs-filtre-bouton[aria-pressed='true'] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.notifs-filtre-bouton:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.notifs-liste { list-style: none; margin: 0; padding: 0; }
.notifs-liste > li + li { border-top: 1px solid var(--bordure); }
.notifs-element { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 2px; }
.notifs-textes { min-width: 0; }
.notifs-titre { font-weight: 700; color: var(--texte); text-decoration: none; overflow-wrap: anywhere; }
a.notifs-titre:hover { text-decoration: underline; }
.notifs-element:not(.est-non-lue) .notifs-titre { font-weight: 550; color: var(--texte-2); }
.notifs-texte { margin: 3px 0 0; font-size: 14px; color: var(--texte-2); overflow-wrap: anywhere; }
.notifs-date { margin: 4px 0 0; font-size: 12.5px; color: var(--texte-3); }
.notifs-etat { color: var(--accent-texte); font-weight: 650; }
.notifs-vide { display: flex; align-items: center; gap: 8px; padding: 22px 4px; color: var(--texte-3); }
.notifs-boite .pagination { margin-top: 8px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.notifs-boite .pagination:empty { display: none; }

.notifs-appareil { display: grid; gap: 12px; }
.notifs-appareil-etat { display: flex; flex-wrap: wrap; gap: 6px; }
.notifs-aide { margin: 0; font-size: 13.5px; color: var(--texte-2); line-height: 1.5; }
.notifs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notifs-iphone { border: 1px solid var(--bordure); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.notifs-iphone summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; font-size: 14px; }
.notifs-iphone ol { margin: 8px 0 6px; padding-left: 20px; font-size: 13.5px; line-height: 1.5; color: var(--texte-2); }
.notifs-iphone p { margin-top: 6px; }

.notifs-table th[scope='row'] { text-align: left; font-weight: 600; white-space: normal; min-width: 150px; }
.notifs-table th.notifs-canal, .notifs-table td.notifs-canal { padding-left: 8px; padding-right: 8px; }
.notifs-type { display: block; }
.notifs-groupe { display: block; font-size: 12px; color: var(--texte-3); font-weight: 500; }
.notifs-canal { text-align: center; width: 1%; white-space: nowrap; }
.notifs-canal .interrupteur { justify-content: center; }
.notifs-preferences { display: grid; gap: 10px; }
.notifs-preferences .form-actions { margin-top: 4px; }

@media (max-width: 640px) {
  .notifs-table thead { display: none; }
  .notifs-table, .notifs-table tbody, .notifs-table tr { display: block; width: 100%; }
  .notifs-table tr { padding: 10px 0; border-bottom: 1px solid var(--bordure); }
  .notifs-table th[scope='row'] { display: block; padding: 0 0 6px; border: 0; }
  .notifs-table td.notifs-canal { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 4px 0; border: 0; text-align: left; }
  .notifs-table td.notifs-canal::before { content: attr(data-libelle); font-size: 13.5px; color: var(--texte-2); }
  .notifs-element { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; }
}

/* ------------------------------------------------------------------ */
/*  Integrations                                                       */
/* ------------------------------------------------------------------ */

.integ-corps { display: grid; gap: 14px; min-width: 0; }
.integ-essai { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.integ-essai .champ { flex: 1 1 260px; min-width: 0; }
.integ-compteurs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 8px; }
.integ-compteurs p { margin: 0; color: var(--texte-2); font-size: 14px; }
.integ-compteurs strong { color: var(--texte); font-variant-numeric: tabular-nums; }
.integ-compteur-echec strong { color: var(--argile-texte); }
.integ-erreur { font-size: 13px; color: var(--argile-texte); overflow-wrap: anywhere; }
.integ-cle-ligne { display: flex; align-items: center; gap: 6px; min-width: 0; }
.integ-cle { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.integ-prerequis, .integ-signalements { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.page-integrations .definitions { grid-template-columns: minmax(0, 1fr); }
