/* Cloche + centre de notifications */

.notif-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(155, 140, 248, 0.08);
  border: 1px solid rgba(155, 140, 248, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s ease;
  color: rgba(200, 190, 255, 0.92);
  flex-shrink: 0;
  padding: 0;
}

.notif-bell:hover {
  background: rgba(155, 140, 248, 0.16);
  border-color: rgba(155, 140, 248, 0.4);
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 6px 18px rgba(155, 140, 248, 0.2);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #9b8cf8, #6b8cff);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 2px solid #0c0c16;
  opacity: 0;
  transform: scale(0);
  transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(155, 140, 248, 0.55);
  pointer-events: none;
}

.notif-badge.visible {
  opacity: 1;
  transform: scale(1);
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
}

.notif-inbox {
  position: fixed;
  top: 76px;
  right: 1.75rem;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(580px, calc(100vh - 96px));
  background: linear-gradient(180deg, rgba(18, 16, 36, 0.98) 0%, rgba(8, 8, 18, 0.99) 100%);
  border: 1px solid rgba(155, 140, 248, 0.22);
  border-radius: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(155, 140, 248, 0.08);
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  pointer-events: none;
  transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.notif-inbox.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.notif-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.notif-inbox-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.notif-mark-all {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 7px;
  transition: 0.18s;
}

.notif-mark-all:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 8px;
  scrollbar-width: thin;
}

.notif-empty {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.notif-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(155, 140, 248, 0.08);
  border: 1px solid rgba(155, 140, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: rgba(180, 168, 255, 0.55);
}

.notif-empty-title {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.notif-empty-sub {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11.5px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 3px;
}

.notif-item:hover {
  background: rgba(155, 140, 248, 0.06);
  border-color: rgba(155, 140, 248, 0.12);
}

.notif-item.unread {
  background: linear-gradient(90deg, rgba(155, 140, 248, 0.12) 0%, rgba(107, 140, 255, 0.04) 100%);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, #b8aaf9, #6b8cff);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(155, 140, 248, 0.45);
}

.notif-dot {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-dot svg {
  width: 18px;
  height: 18px;
}

.notif-dot-announce,
.notif-dot-info,
.notif-dot-system,
.notif-dot-if {
  background: rgba(155, 140, 248, 0.14);
  color: #c4b8ff;
  border: 1px solid rgba(155, 140, 248, 0.28);
}

.notif-dot-ticket {
  background: rgba(107, 140, 255, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(107, 140, 255, 0.3);
}

.notif-dot-report,
.notif-dot-warning {
  background: rgba(155, 140, 248, 0.12);
  color: #b8aaf9;
  border: 1px solid rgba(155, 140, 248, 0.25);
}

.notif-dot-success {
  background: rgba(107, 140, 255, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(107, 140, 255, 0.25);
}

.notif-body-title {
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3px;
  line-height: 1.35;
}

.notif-body-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-body-time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-body-time svg {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}

.notif-item-delete {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 6px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .notif-item-delete {
    opacity: 0;
    background: transparent;
    border-color: transparent;
  }

  .notif-item:hover .notif-item-delete {
    opacity: 1;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.notif-item-delete svg {
  width: 16px;
  height: 16px;
}

.notif-item-delete:hover {
  color: #ff6b84;
  border-color: rgba(255, 80, 104, 0.35);
  background: rgba(255, 80, 104, 0.08);
}

/* Toasts annonces */
.if-toast-stack {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 2rem));
}

.if-toast {
  background: linear-gradient(160deg, rgba(22, 20, 40, 0.98), rgba(10, 10, 20, 0.99));
  border: 1px solid rgba(155, 140, 248, 0.22);
  border-radius: 14px;
  padding: 14px 44px 14px 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 28px rgba(155, 140, 248, 0.08);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  position: relative;
  cursor: default;
  overflow: hidden;
}

.if-toast--clickable {
  cursor: pointer;
}

.if-toast--in {
  transform: translateX(0);
}

.if-toast--out {
  transform: translateX(120%);
  opacity: 0;
}

.if-toast--announce,
.if-toast--info,
.if-toast--system {
  border-left: 3px solid #9b8cf8;
}

.if-toast--ticket {
  border-left: 3px solid #6b8cff;
}

.if-toast--report,
.if-toast--warning {
  border-left: 3px solid #b8aaf9;
}

.if-toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(155, 140, 248, 0.14);
  color: #c4b8ff;
  border: 1px solid rgba(155, 140, 248, 0.28);
}

.if-toast--ticket .if-toast-icon {
  background: rgba(107, 140, 255, 0.14);
  color: #93c5fd;
  border-color: rgba(107, 140, 255, 0.3);
}

.if-toast-icon svg {
  width: 18px;
  height: 18px;
}

.if-toast-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 4px;
}

.if-toast-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.if-toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(155, 140, 248, 0.08);
  border: 1px solid rgba(155, 140, 248, 0.2);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.if-toast-close:hover {
  background: rgba(155, 140, 248, 0.18);
  color: #fff;
}

.if-toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(155, 140, 248, 0.12);
}

.if-toast-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #9b8cf8, #6b8cff);
  animation: ifToastProgress var(--toast-dur, 4500ms) linear forwards;
}

@keyframes ifToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ─── Modale annonce — thème violet / bleu / blanc ─── */
.if-announce-modal {
  z-index: 100000100 !important;
}

.if-announce-modal .legal-box,
.if-announce-box {
  max-width: 560px;
  width: min(560px, calc(100vw - 2rem));
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(155, 140, 248, 0.28);
  background: linear-gradient(165deg, rgba(22, 20, 40, 0.98) 0%, rgba(10, 10, 20, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 64px rgba(155, 140, 248, 0.12);
}

.if-announce-banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(155, 140, 248, 0.15);
  cursor: zoom-in;
}

/* Lightbox image + zoom (annonces / tickets) */
.if-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 20px;
  overscroll-behavior: contain;
}
.if-image-lightbox.open { display: flex; }
.if-image-lightbox-stage {
  position: relative;
  width: min(96vw, 1200px);
  height: min(86vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}
.if-image-lightbox.is-zoomed .if-image-lightbox-stage { cursor: grab; }
.if-image-lightbox.is-zoomed .if-image-lightbox-stage:active { cursor: grabbing; }
.if-image-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transition: transform 0.05s linear;
  user-select: none;
  -webkit-user-drag: none;
}
.if-image-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}
.if-image-lightbox-close svg {
  width: 18px;
  height: 18px;
}
.if-image-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.if-image-lightbox-tools {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.if-image-lightbox-tools button {
  min-width: 42px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.if-image-lightbox-tools button:hover { background: rgba(255, 255, 255, 0.22); }
.if-image-lightbox-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .if-image-lightbox-hint { display: none; }
  .if-image-lightbox-stage {
    width: 100%;
    height: 78vh;
  }
}

.if-announce-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px 14px;
}

.if-announce-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(155, 140, 248, 0.15);
  color: #b8aaf9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(155, 140, 248, 0.28);
}

.if-announce-icon svg {
  width: 20px;
  height: 20px;
}

.if-announce-meta {
  flex: 1;
  min-width: 0;
}

.if-announce-priority {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.if-announce-priority--normal {
  background: rgba(155, 140, 248, 0.16);
  color: #c4b8ff;
}
.if-announce-priority--important {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}
.if-announce-priority--urgent {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}
.if-announce-priority--maintenance {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.if-announce-priority--update {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}

.if-announce-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.if-announce-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
}

.if-announce-x {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(155, 140, 248, 0.22);
  background: rgba(155, 140, 248, 0.08);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.if-announce-x:hover {
  background: rgba(155, 140, 248, 0.18);
  color: #fff;
  border-color: rgba(155, 140, 248, 0.4);
}

.if-announce-x svg {
  width: 16px;
  height: 16px;
}

.if-announce-body {
  padding: 0 22px 18px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.65;
  font-size: 14px;
  max-height: 42vh;
  overflow-y: auto;
}

.if-announce-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 10px 0;
  display: block;
  border: 1px solid rgba(155, 140, 248, 0.15);
}

.if-announce-body a,
.if-announce-link {
  color: #c4b8ff;
  text-decoration: none;
  font-weight: 600;
  pointer-events: auto;
  cursor: pointer;
}

.if-announce-body a:hover,
.if-announce-link:hover {
  color: #fff;
  text-decoration: underline;
}

.if-announce-foot {
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(155, 140, 248, 0.12);
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(180deg, transparent, rgba(155, 140, 248, 0.04));
}

.if-announce-close-btn {
  padding: 12px 24px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #9b8cf8, #7c6cf0);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(155, 140, 248, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.if-announce-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(155, 140, 248, 0.45);
}

@media (max-width: 900px) {
  .notif-inbox {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .if-toast-stack {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}
