.notification-settings-page {
  padding: 0 0 40px;
}

/* ── Header ── */
.notification-settings-page .page-header-wrapper {
  background-color: var(--background-color-main-light);
  border: 1px solid var(--border-light-mode);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  margin: 0 0 1.5rem 0;
  padding: 30px 20px;
}

.notification-settings-page .page-header-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notification-settings-page .page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.notification-settings-page .page-subtitle {
  font-size: 0.95rem;
  color: var(--text-thowine-light);
  margin: 0.25rem 0 0 0;
}

html.dark-theme .notification-settings-page .page-header-wrapper {
  background-color: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
}

/* ── Seções ── */
.ns-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin: 0 0 1.5rem 0;
  overflow: hidden;
}

.ns-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-wrap: wrap;
}

.ns-section-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ns-section-icon {
  font-size: 18px;
  color: #f97316;
  margin-top: 2px;
  flex-shrink: 0;
}

.ns-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 3px;
}

.ns-section-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Busca ── */
.ns-search-wrap {
  min-width: 220px;
  flex-shrink: 0;
  position: relative;
}

.ns-search-wrap::before {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
  pointer-events: none;
}

.notification-settings-page .form-input-buscas {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.notification-settings-page .form-input-buscas:focus {
  border-color: #f97316;
}

/* ── Loading ── */
.ns-loading {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* ── Grid de eventos da org ── */
.ns-org-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: #e5e7eb;
  border-top: none;
}

.ns-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  transition: background 0.15s;
}

.ns-event-row:hover {
  background: #fafafa;
}

.ns-event-label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.ns-event-label span {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-top: 2px;
}

/* ── Toggle switch ── */
.ns-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.ns-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ns-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background 0.2s;
}

.ns-toggle-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ns-toggle input:checked + .ns-toggle-slider {
  background: #f97316;
}

.ns-toggle input:checked + .ns-toggle-slider:before {
  transform: translateX(18px);
}

/* ── Wrapper do scroll customizado ── */
.ns-scroll-wrapper {
  position: relative;
  display: flex;
}

/* ── Lista de usuários (accordion) ── */
.ns-users-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.ns-users-list.ns-force-scroll {
  max-height: calc(10 * 59px);
  overflow-y: scroll;
  scrollbar-width: none;
}

.ns-users-list.ns-force-scroll::-webkit-scrollbar {
  display: none;
}

/* ── Scrollbar customizada ── */
.ns-custom-scrollbar-track {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #f3f4f6;
  border-radius: 99px;
  display: none;
  z-index: 1;
}

.ns-custom-scrollbar-thumb {
  position: absolute;
  width: 6px;
  background: var(--primary-color, #f97316);
  border-radius: 99px;
  cursor: pointer;
  min-height: 30px;
  transition: opacity 0.2s;
}

.ns-custom-scrollbar-thumb:hover {
  opacity: 0.75;
}

.ns-user-item {
  border-bottom: 1px solid #e5e7eb;
}

.ns-user-item:last-child {
  border-bottom: none;
}

.ns-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.ns-user-header:hover {
  background: #f9fafb;
}

.ns-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f97316;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ns-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ns-user-info {
  flex: 1;
  min-width: 0;
}

.ns-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-user-email {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-user-chevron {
  font-size: 12px;
  color: #9ca3af;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ns-user-item.open .ns-user-chevron {
  transform: rotate(180deg);
}

.ns-user-badge {
  font-size: 11px;
  background: #fef3c7;
  color: #d97706;
  border-radius: 99px;
  padding: 2px 8px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Painel de eventos do usuário (accordion body) ── */
.ns-user-events {
  display: none;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.ns-user-item.open .ns-user-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: #e5e7eb;
}

.ns-user-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 10px 28px;
  background: #f9fafb;
}

.ns-user-event-row.ns-event-disabled {
  opacity: 0.45;
}

.ns-user-event-label {
  font-size: 12px;
  color: #374151;
}

/* ── Contador de usuários ── */
.ns-user-count {
  font-size: 12px;
  color: #9ca3af;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  padding-left: 4px;
}

/* ── Estado vazio ── */
.ns-empty {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* ── Responsivo ── */
@media (max-width: 640px) {
  .ns-section {
    margin: 16px 12px;
  }
  .ns-section-header {
    flex-direction: column;
  }
  .ns-search-wrap {
    width: 100%;
  }
  .ns-org-settings-grid {
    grid-template-columns: 1fr;
  }
}

html.dark-theme .ns-event-row {
  background-color: var(--background-main-dark-mode);
}

html.dark-theme .ns-user-header {
  background-color: var(--background-main-dark-mode);
}

html.dark-theme .ns-section-header {
  background-color: var(--background-dark-mode-menu-lateral);
}

html.dark-theme .ns-section-title {
  color: var(--text-thowine-dark);
}

html.dark-theme .ns-event-label {
  color: var(--text-thowine-dark);
}

html.dark-theme .ns-user-event-row {
  background-color: var(--background-dark-mode-menu-lateral);
}

html.dark-theme .ns-section {
  border: 1px solid var(--border-dark-mode);
}
