/* Préférences app + classes globales sur #app-container (apparence) */

#app-container {
  --app-badge-bg: #dc2626;
}

/* Pastille cloche (accueil, feuille de temps) : ancrage + pastille lisible dès qu’il y a un nombre */
#app-container .dashboard-mini-icon--badge .dashboard-mini-icon-inner,
#app-container .feuille-temps-header-notifications-btn .dashboard-mini-icon-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#app-container .dashboard-nav-badge:empty,
#app-container .dashboard-nav-badge[hidden] {
  display: none !important;
}

/* data-inbox-count = pastille valide (évite conflits :not(:empty) / navigateur) */
#app-container .dashboard-nav-badge[data-inbox-count] {
  position: absolute;
  /* Coin intérieur : évite d’être rogné par #dashboard-screen { overflow: hidden } */
  top: 0;
  right: 0;
  min-width: 16px;
  min-height: 16px;
  height: auto;
  padding: 0 4px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--app-badge-bg, #dc2626);
  border-radius: 999px;
  border: 2px solid #fff;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 20;
  pointer-events: none;
  overflow: visible;
  visibility: visible;
  opacity: 1;
}

/* Fonds d’écran (tableau de bord et zone principale) */
#app-container.app-bg-cream #dashboard-screen {
  background: linear-gradient(180deg, #fffdf8 0%, #f5ebe0 55%, #efe4d8 100%);
}
#app-container.app-bg-slate #dashboard-screen {
  background: linear-gradient(180deg, #f8fafc 0%, #e8eef5 50%, #dce4ee 100%);
}

/* Icônes du menu (grille + barre du bas) */
#app-container.app-icons-large .dashboard-nav-icon svg,
#app-container.app-icons-large .dashboard-card-icon img {
  transform: scale(1.1);
  transform-origin: center;
}
#app-container.app-icons-compact .dashboard-nav-icon svg,
#app-container.app-icons-compact .dashboard-card-icon img {
  transform: scale(0.9);
  transform-origin: center;
}

/* Page Paramètres : flux sous l’en-tête, zone scrollable */
.notifications-prefs-screen.formulaire-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.notifications-prefs-screen .notifications-prefs-header {
  flex-shrink: 0;
  z-index: 2;
}

/* Le header .formulaire-header est position:fixed → padding-top pour le contenu. */
.notifications-prefs-screen .notifications-prefs-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 60px);
  padding-bottom: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.app-ios .notifications-prefs-screen .notifications-prefs-main {
  padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
}

/* Même principe que .feuille-temps-has-bottom-nav : contenu scrollable au-dessus de la barre fixe */
.notifications-prefs-has-bottom-nav {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.notifications-prefs-has-bottom-nav .notifications-prefs-main {
  flex: 1;
  min-height: 0;
}

.notifications-prefs-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.75rem 0.85rem;
  padding-bottom: calc(56px + max(0.85rem, env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
}

.app-android .notifications-prefs-has-bottom-nav .notifications-prefs-panels {
  padding-bottom: calc(56px + max(0.85rem, env(safe-area-inset-bottom, 0px))) !important;
}

.app-ios .notifications-prefs-has-bottom-nav .notifications-prefs-panels {
  padding-bottom: calc(56px + max(0.85rem, env(safe-area-inset-bottom, 0px))) !important;
}

.notifications-prefs-panel {
  outline: none;
}

.notifications-prefs-panel[hidden] {
  display: none !important;
}

.notifications-prefs-section {
  margin: 0;
}

.notifications-prefs-h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
  margin: 1rem 0 0.35rem;
}

.notifications-prefs-push-block {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.notifications-prefs-push-block .notifications-prefs-h3 {
  margin-top: 0;
}

.notifications-prefs-android-spam-block {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.92);
}

.notifications-prefs-android-spam-steps {
  margin: 8px 0 10px;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #334155;
}

.notifications-prefs-android-spam-steps li + li {
  margin-top: 6px;
}

.notifications-prefs-android-spam-block .notifications-prefs-btn-secondary {
  width: 100%;
  margin-top: 10px;
}

.notifications-prefs-android-spam-status:not(:empty) {
  margin-top: 10px;
}

.app-theme-night .notifications-prefs-android-spam-block {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
}

.app-theme-night .notifications-prefs-android-spam-steps {
  color: #cbd5e1;
}

.notifications-prefs-push-status:not(:empty) {
  margin-top: 0.5rem;
}

.app-theme-night .notifications-prefs-h2,
.app-theme-night .notifications-prefs-h3 {
  color: rgba(255, 255, 255, 0.92);
}

.notifications-prefs-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.2rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #c9a227;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

.notifications-prefs-link-row:active {
  background: rgba(201, 162, 39, 0.08);
}

.notifications-prefs-link-row .notifications-prefs-chevron {
  color: #9ca3af;
  font-size: 1.1rem;
  font-weight: 400;
}

.notifications-prefs-field {
  margin-top: 0.65rem;
}

.notifications-prefs-field--tight {
  margin-top: 0.4rem;
}

.notifications-prefs-field label.notifications-prefs-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.35rem;
}

.notifications-prefs-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
}

.notifications-prefs-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.notifications-prefs-color-input {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

.prefs-badge-preset-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.prefs-badge-preset-btn:active {
  transform: scale(0.94);
}

/* Thème nuit : barre du bas Paramètres (classes feuille-temps-bottom-nav) */
.app-theme-night .notifications-prefs-screen .notifications-prefs-bottom-nav {
  background: rgba(26, 21, 16, 0.9);
  border-top-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.35);
}

.app-theme-night .notifications-prefs-screen .notifications-prefs-bottom-nav .feuille-temps-nav-tab {
  color: rgba(255, 255, 255, 0.62);
}

.app-theme-night .notifications-prefs-screen .notifications-prefs-bottom-nav .feuille-temps-nav-tab.active {
  color: #e8c49a;
  font-weight: 600;
}

.app-theme-night .notifications-prefs-screen .notifications-prefs-bottom-nav .feuille-temps-nav-tab.active .feuille-temps-nav-icon svg {
  color: #e8c49a;
  stroke: currentColor;
}

.app-theme-night .notifications-prefs-select {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.app-theme-night .notifications-prefs-field-label {
  color: rgba(255, 255, 255, 0.7);
}

.app-theme-night .notifications-prefs-section {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.app-theme-night .notifications-prefs-link-row {
  color: #e8c49a;
}

.app-theme-night .notifications-prefs-btn-secondary {
  border-color: rgba(232, 196, 154, 0.5);
  color: #e8c49a;
}

.app-theme-night .notifications-prefs-desc--compact {
  color: rgba(255, 255, 255, 0.62);
}

/* Profil intégré (Paramètres) */
.notifications-prefs-profile-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.notifications-prefs-profile-photo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.notifications-prefs-profile-avatar-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

/* Comme la zone « Photo » sur la page Utilisateur (gestion) : .gestion-avatar-initial */
.notifications-prefs-profile-avatar-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(59, 130, 246, 0.25);
  border: 2px solid rgba(59, 130, 246, 0.35);
}

.notifications-prefs-profile-initial {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: #93c5fc;
  user-select: none;
}

.notifications-prefs-profile-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.notifications-prefs-profile-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.notifications-prefs-profile-photo-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c9a227;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notifications-prefs-profile-photo-link--danger {
  color: #b91c1c;
}

.notifications-prefs-profile-fonction-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.notifications-prefs-profile-fonction-label {
  font-weight: 600;
  color: #4b5563;
}

.notifications-prefs-profile-fonction-value {
  font-weight: 500;
  color: #374151;
}

.notifications-prefs-profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.notifications-prefs-profile-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
}

.notifications-prefs-profile-submit {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: #c9a227;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.notifications-prefs-profile-submit:active {
  opacity: 0.92;
}

.notifications-prefs-btn-danger {
  border: 2px solid #991b1b;
  background: #b91c1c;
  color: #fff;
}

.notifications-prefs-btn-danger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.prefs-admin-sessions-global-wrap {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(254, 226, 226, 0.35);
}

.app-theme-night .prefs-admin-sessions-global-wrap {
  border-color: rgba(252, 165, 165, 0.45);
  background: rgba(127, 29, 29, 0.35);
}

.app-theme-night .notifications-prefs-btn-danger {
  background: #dc2626;
  border-color: #fecaca;
  color: #fff;
}

.notifications-prefs-profile-msg {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.notifications-prefs-profile-msg[data-type='success'] {
  color: #047857;
}

.notifications-prefs-profile-msg[data-type='info'] {
  color: #4b5563;
}

.notifications-prefs-profile-msg--error,
.notifications-prefs-profile-msg[data-type='error'] {
  color: #b91c1c;
}

.notifications-prefs-appearance-save {
  margin-top: 0.65rem;
}

.notifications-prefs-badges-annonces-title {
  margin-top: 0.85rem;
  font-weight: 700;
  color: #374151;
}

.app-theme-night .notifications-prefs-profile-avatar-frame {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.45);
}

.app-theme-night .notifications-prefs-profile-initial {
  color: #93c5fc;
}

.app-theme-night .notifications-prefs-profile-photo-link {
  color: #e8c49a;
}

.app-theme-night .notifications-prefs-profile-photo-link--danger {
  color: #fca5a5;
}

.app-theme-night .notifications-prefs-profile-fonction-row,
.app-theme-night .notifications-prefs-profile-fonction-label {
  color: rgba(255, 255, 255, 0.65);
}

.app-theme-night .notifications-prefs-profile-fonction-value {
  color: rgba(255, 255, 255, 0.88);
}

.app-theme-night .notifications-prefs-profile-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.app-theme-night .notifications-prefs-profile-submit {
  background: #e8c49a;
  color: #1a1510;
}

.app-theme-night .notifications-prefs-profile-msg[data-type='success'] {
  color: #6ee7b7;
}

.app-theme-night .notifications-prefs-profile-msg[data-type='info'] {
  color: rgba(255, 255, 255, 0.7);
}

.app-theme-night .notifications-prefs-badges-annonces-title {
  color: rgba(255, 255, 255, 0.88);
}

.notifications-prefs-h4 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
  font-weight: 700;
  color: #1f2937;
}
.notifications-prefs-admin-version-wrap {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.prefs-admin-version-msg {
  margin-top: 0.5rem;
}
.notifications-prefs-changelog-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.notifications-prefs-changelog-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.notifications-prefs-changelog-input {
  flex: 1;
  min-width: 0;
}
.notifications-prefs-changelog-remove {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
}
.notifications-prefs-changelog-add {
  margin-bottom: 12px;
}
.notifications-prefs-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.notifications-prefs-textarea[readonly] {
  background: #f9fafb;
  color: #374151;
}
.notifications-prefs-local-update-log {
  margin-bottom: 1rem;
}

.app-theme-night .notifications-prefs-h4 {
  color: rgba(255, 255, 255, 0.9);
}
.app-theme-night .notifications-prefs-admin-version-wrap {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
.app-theme-night .notifications-prefs-textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
}
.app-theme-night .notifications-prefs-textarea[readonly] {
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
}
.app-theme-night .notifications-prefs-changelog-remove {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.88);
}

/* Fond d’écran personnel : masquer le calque body::before + fonds .screen pour voir la photo */
html.app-user-custom-bg body::before {
  opacity: 0 !important;
}
html.app-user-custom-bg #app-container .screen {
  background-color: transparent !important;
  background-image: none !important;
}

.notifications-prefs-app-bg-row {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.notifications-prefs-app-bg-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notifications-prefs-app-bg-choose {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.12);
  color: #9a7b18;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notifications-prefs-app-bg-choose:active {
  opacity: 0.92;
}

.notifications-prefs-app-bg-remove {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notifications-prefs-app-bg-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #6b7280;
}

.notifications-prefs-app-bg-status {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.notifications-prefs-app-bg-status[data-type='success'] {
  color: #047857;
}

.notifications-prefs-app-bg-status[data-type='error'] {
  color: #b91c1c;
}

.notifications-prefs-app-bg-status[data-type='info'] {
  color: #6b7280;
}

.app-theme-night .notifications-prefs-app-bg-choose {
  border-color: rgba(232, 196, 154, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #e8c49a;
}

.app-theme-night .notifications-prefs-app-bg-hint,
.app-theme-night .notifications-prefs-app-bg-status[data-type='info'] {
  color: rgba(255, 255, 255, 0.55);
}

.app-theme-night .notifications-prefs-app-bg-status[data-type='success'] {
  color: #6ee7b7;
}

.app-theme-night .notifications-prefs-app-bg-status[data-type='error'] {
  color: #fca5a5;
}

/* ── Fond photo : texte adapté à la luminosité de l’image (classes posées par app-appearance.js) ── */
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark {
  --text: rgba(255, 255, 255, 0.94);
  --text-muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.22);
  --bg-card: rgba(255, 255, 255, 0.12);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-light {
  --text: #1a1a1a;
  --text-muted: rgba(26, 26, 26, 0.62);
  --border: rgba(0, 0, 0, 0.12);
  --bg-card: rgba(255, 255, 255, 0.92);
}

/* Dashboard : libellés souvent en #1a1a1a sans var(--text) */
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-greeting,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-greeting .dashboard-greeting-name,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-brand-row,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-card-label,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-copyright {
  color: rgba(255, 255, 255, 0.94);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-greeting-btn {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-greeting-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.94);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-card:hover,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-card:focus {
  background: rgba(255, 255, 255, 0.18);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top #feuille-temps-card,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top .dashboard-utilisateur-top {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top #feuille-temps-card:hover,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top #feuille-temps-card:focus,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top .dashboard-utilisateur-top:hover,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-top .dashboard-utilisateur-top:focus {
  background: rgba(255, 255, 255, 0.18);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav--admin .dashboard-card:not(.dashboard-card-wide),
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-grid-pages .dashboard-card:not(.dashboard-card-wide),
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-grid-source .dashboard-card:not(.dashboard-card-wide) {
  background: none;
  border: none;
  box-shadow: none;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-item:not(.dashboard-nav-item-logout),
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-icon,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-icon svg {
  color: rgba(255, 255, 255, 0.92);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-item:hover,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-item:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-bar-bg {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-nav-bar-bg .dashboard-nav-label {
  color: rgba(255, 255, 255, 0.92);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-mini-icon {
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 0;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-mini-icon:hover {
  background: transparent;
  color: #fff;
}

/* En-tête accueil : rester en bleu sur fond personnalisé sombre (lisible sur photo) */
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon {
  color: #7dd3fc;
}
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon:hover,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon:focus-visible {
  color: #bae6fd;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-switch {
  background: rgba(0, 0, 0, 0.28);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-switch-btn {
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-switch-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-switch-btn.active {
  background: rgba(201, 162, 39, 0.45);
  color: #fff;
  box-shadow: none;
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .dashboard-screen .dashboard-header {
  background: rgba(26, 21, 16, 0.45);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .formulaire-header,
#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .formulaire-title {
  color: rgba(255, 255, 255, 0.94);
}

#app-container.app-user-custom-bg.app-user-custom-bg--l-dark .formulaire-back {
  color: rgba(255, 255, 255, 0.88);
}

/* Image claire + thème nuit : rétablir un texte foncé lisible sur la photo */
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-greeting,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-greeting .dashboard-greeting-name,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-brand-row,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-card-label,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-copyright,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .formulaire-title {
  color: #1a1a1a;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-item:not(.dashboard-nav-item-logout),
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-icon,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-icon svg {
  color: #1a1a1a;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-bar-bg {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.08);
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-nav-bar-bg .dashboard-nav-label {
  color: #1a1a1a;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-mini-icon {
  color: #1a1a1a;
  background: transparent;
  border: 0;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon {
  color: #1d4ed8;
}
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon:hover,
#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light
  #dashboard-screen
  .dashboard-header-mini-icons
  .dashboard-mini-icon:focus-visible {
  color: #1e3a8a;
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-switch-btn {
  color: rgba(0, 0, 0, 0.65);
}

#app-container.app-theme-night.app-user-custom-bg.app-user-custom-bg--l-light .dashboard-switch-btn.active {
  background: #fff;
  color: #1a1a1a;
}

/* Confirmation vidage cache : dans la page, sans popup navigateur */
.prefs-cache-confirm-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(180, 130, 20, 0.35);
}

.prefs-cache-confirm-panel[hidden] {
  display: none !important;
}

.prefs-cache-confirm-panel__msg {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #44403c;
}

.prefs-cache-confirm-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.app-theme-night .prefs-cache-confirm-panel {
  background: linear-gradient(145deg, #422006 0%, #451a03 100%);
  border-color: rgba(251, 191, 36, 0.35);
}

.app-theme-night .prefs-cache-confirm-panel__msg {
  color: #fcd34d;
}

/* Paramètres → Appareils */
.prefs-device-id-hint {
  margin-top: 8px;
  opacity: 0.92;
}

.prefs-device-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.prefs-device-empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #64748b;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
}

.prefs-device-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.9);
}

.prefs-device-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  box-sizing: border-box;
}

.prefs-device-dot--ok {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.28);
}

.prefs-device-dot--stale {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.28);
}

.prefs-device-row-main {
  flex: 1;
  min-width: 0;
}

.prefs-device-row-title {
  font-weight: 650;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.35;
}

.prefs-device-row-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #64748b;
}

.prefs-device-this-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.22);
  color: #92400e;
}

.app-theme-night .prefs-device-empty {
  color: rgba(255, 255, 255, 0.65);
  border-color: rgba(255, 255, 255, 0.2);
}

.app-theme-night .prefs-device-row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
}

.app-theme-night .prefs-device-row-title {
  color: rgba(255, 255, 255, 0.94);
}

.app-theme-night .prefs-device-row-meta {
  color: rgba(226, 232, 240, 0.72);
}

.app-theme-night .prefs-device-this-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.prefs-device-session-ended {
  display: inline-block;
  margin-right: 4px;
  font-weight: 800;
  color: #b91c1c;
  font-size: 1.1rem;
  line-height: 1;
  vertical-align: middle;
}

.prefs-device-row--session-ended {
  opacity: 0.88;
  border-style: dashed;
}

.app-theme-night .prefs-device-session-ended {
  color: #fca5a5;
}

.app-theme-night .prefs-device-row--session-ended {
  opacity: 0.92;
}

/* Paramètres → Appareils — vue admin (accordéon par employé) */
.prefs-devices-admin-accordion-root {
  margin: 12px 0 16px;
}

.prefs-devices-admin-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prefs-devices-admin-acc-item {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.92);
  overflow: hidden;
}

.prefs-devices-admin-acc-item[open] {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.prefs-devices-admin-acc-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #0f172a;
}

.prefs-devices-admin-acc-summary::-webkit-details-marker {
  display: none;
}

.prefs-devices-admin-acc-name {
  font-weight: 700;
}

.prefs-devices-admin-acc-email {
  font-size: 0.82rem;
  color: #64748b;
  flex: 1 1 100%;
}

.prefs-devices-admin-acc-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b45309;
}

.prefs-device-list--nested {
  margin: 0;
  padding: 4px 10px 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.prefs-device-list--nested .prefs-device-row {
  margin-bottom: 8px;
}

.prefs-device-list--nested .prefs-device-row:last-child {
  margin-bottom: 0;
}

.app-theme-night .prefs-devices-admin-acc-item {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
}

.app-theme-night .prefs-devices-admin-acc-summary {
  color: rgba(255, 255, 255, 0.92);
}

.app-theme-night .prefs-devices-admin-acc-email {
  color: rgba(226, 232, 240, 0.72);
}

.app-theme-night .prefs-devices-admin-acc-count {
  color: #fcd34d;
}

/* Icônes tableau de bord (Paramètres → Mise à jour, admin) */
.prefs-dashboard-icons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.prefs-dashboard-icons-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.prefs-dashboard-icons-item:active {
  transform: scale(0.98);
}
.prefs-dashboard-icons-thumb {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prefs-dashboard-icons-thumb img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.prefs-dashboard-icons-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: #334155;
}
.prefs-dashboard-icons-reset {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
.notifications-prefs-admin-icons-wrap {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
