.notificationbtn {
  background: none;
  border: 0;
  cursor: pointer;
  align-items: center;
  display: flex;
  position: relative;
}

.notificationicon {
  width: calc(var(--button-height-s) * 1px) !important;
  height: calc(var(--button-height-s) * 1px) !important;
  color: var(--text-brandPrimary);
  font-size: calc(var(--button-height-s) * 1px) !important;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    border-radius: calc(var(--size-radius-s) * 1px) !important;
    background-color: var(--bg-subtle) !important;
    color: var(--action-primary-default) !important;
    transform: translateY(-1px);
  }

  &:disabled,
  &.disabled {
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent !important;
    color: var(--text-disabled) !important;
  }
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 50%;
  min-width: 18px;
  text-align: center;
}

/* Lightbox Overlay */
.notification-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Lightbox Panel */
.notification-lightbox {
  background: #fff;
  border-radius: 10px;
  width: 600px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.25s ease;
  overflow: hidden;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Header */
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 8px;
}

.lightbox-title {
  font-weight: 700;
  font-size: 16px;
  color: #111;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #555;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;

  &.read {
    background: #4f46e5;
  }

  &.unread {
    background: var(--action-primary-default);
  }
}

.action-link {
  font-size: 13px;
  color: #4f46e5;
  cursor: pointer;
  text-decoration: underline;

  &.danger {
    color: #dc2626;
  }

  &:hover {
    opacity: 0.8;
  }
}

.close-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #888;
  padding: 2px 6px;
  border-radius: 4px;

  &:hover {
    background: #f3f4f6;
    color: #111;
  }
}

/* Body */
.lightbox-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.notification-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #f1f1f1;
  // transition: background 0.15s;

  &:hover {
    background: #f9fafb;
  }

  &.unread {
    background: var(--bg-surface);
  }
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--action-primary-default);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.read-indicator {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  min-width: 16px;
  text-align: center;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  transition: all 0.15s;
  user-select: none;

  &:hover {
    color: #4f46e5;
    background: #ede9fe;
  }

  &.marking {
    color: #f59e0b;
    cursor: wait;
    animation: pulse 0.8s ease-in-out infinite;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.dismiss-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;

  &:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
  }
}

.loading,
.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* ✅ Pagination bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-label {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
}

.page-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #4f46e5;
  padding: 4px 7px;
  border-radius: 4px;
  transition: background 0.15s;
  line-height: 1;

  &:hover:not(:disabled) {
    background: #ede9fe;
  }

  &:disabled {
    color: #ccc;
    cursor: not-allowed;
  }
}

.notification-content {
  flex: 1;
  min-width: 0;

  .sender {
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
    color: #111;
    text-align: center;
  }

  .message {
    font-size: 13px;
    color: #444;
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
    text-align: left;
  }
}

.lightbox-footer {
  padding: 8px 18px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  color: #888;
  text-align: right;
}

.html-message {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  margin-top: 4px;
  display: block;

  // ✅ Fix the outer table to be fluid (was 620px fixed)
  ::ng-deep table.template_outer {
    width: 100% !important;
    background: #f2c77d !important; // ✅ golden background shows as left/right bars
    box-sizing: border-box !important;
    padding: 10px 0 !important;
  }

  // ✅ Inner white content box — NOT full width, so golden shows on sides
  ::ng-deep table.template_inner {
    width: 90% !important; // ✅ leave ~5% golden bar on each side
    margin: 0 auto !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  // ✅ Content area inside white box
  ::ng-deep table.template_content,
  ::ng-deep .template_content {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  // ✅ Dark footer bar
  ::ng-deep .template_bottom {
    width: 90% !important;
    margin: 0 auto !important;
    background-color: #666 !important;
    box-sizing: border-box !important;
    padding: 5px !important;
  }

  // ✅ DO NOT force all divs/tds to 100% — that kills the golden side columns
  ::ng-deep td {
    box-sizing: border-box !important;
  }

  // Text styles
  ::ng-deep .title {
    font: bold 17px arial;
    color: #222;
  }

  ::ng-deep .bold {
    font: bold 12px arial;
  }

  ::ng-deep .normal {
    font: normal 12px arial;
  }

  ::ng-deep .regards {
    font: bold 12px arial;
    color: #e4b022;
  }
}

::ng-deep .page-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--action-primary-default) !important;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  line-height: 1;
  font-weight: 600;

  &:hover:not(:disabled) {
    background: #ede9fe !important;
    color: #4f46e5 !important;
  }

  &:disabled {
    color: #c7c7c7 !important;
    cursor: not-allowed;
  }
}