/* Live Teacher Dashboard action notifications. */

.nn-teacher-hero__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.nn-dashboard-notifications {
  position: relative;
  z-index: 30;
}

.nn-dashboard-notifications__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #dce3e9;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.nn-dashboard-notifications__trigger:hover,
.nn-dashboard-notifications__trigger:focus-visible,
.nn-dashboard-notifications.is-open .nn-dashboard-notifications__trigger {
  border-color: #9dcfd2;
  background: #f7fbfb;
  color: #087780;
}

.nn-dashboard-notifications__trigger:focus-visible {
  outline: 2px solid rgba(15, 159, 168, 0.2);
  outline-offset: 2px;
}

.nn-dashboard-notifications__trigger i {
  font-size: 0.98rem;
}

.nn-dashboard-notifications__badge {
  position: absolute;
  top: -6px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.nn-dashboard-notifications__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(410px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid #dce3e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
}

.nn-dashboard-notifications__panel[hidden] {
  display: none;
}

.nn-dashboard-notifications__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8edf1;
}

.nn-dashboard-notifications__head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 800;
}

.nn-dashboard-notifications__head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 1.2rem;
}

.nn-dashboard-notifications__body {
  max-height: min(552px, calc(100vh - 188px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nn-dashboard-notifications__empty {
  margin: 0;
  padding: 24px 18px;
  color: #64748b;
  font-size: 0.84rem;
  text-align: center;
}

.nn-dashboard-notification-group {
  border-bottom: 1px solid #e8edf1;
}

.nn-dashboard-notification-group:last-child {
  border-bottom: 0;
}

.nn-dashboard-notification-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #f8fafc;
}

.nn-dashboard-notification-group > header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.nn-dashboard-notification-group > header i {
  width: 15px;
  color: #7c8795;
  text-align: center;
}

.nn-dashboard-notification-group > header strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.67rem;
  font-weight: 850;
}

.nn-dashboard-notification-group--incomplete_notes > header i {
  color: #a16207;
}

.nn-dashboard-notification-group--consecutive_absences > header i,
.nn-dashboard-notification-group--overdue_invoices > header i {
  color: #b42318;
}

.nn-dashboard-notification-group__items {
  display: grid;
}

.nn-dashboard-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f3;
}

.nn-dashboard-notification-item:last-child {
  border-bottom: 0;
}

.nn-dashboard-notification-item strong,
.nn-dashboard-notification-item p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nn-dashboard-notification-item strong {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 750;
}

.nn-dashboard-notification-item p {
  grid-column: 1;
  margin: 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.4;
}

.nn-dashboard-notification-item a {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.nn-dashboard-notification-item a:hover,
.nn-dashboard-notification-item a:focus-visible {
  border-color: #8bc9cd;
  background: #f2fafa;
  color: #075f66;
}

@media (max-width: 767px) {
  .nn-teacher-hero {
    position: relative;
    padding-right: 0;
  }

  .nn-teacher-hero__actions {
    position: fixed;
    z-index: 1050;
    top: 11px;
    right: 64px;
  }

  .nn-dashboard-notifications__trigger {
    width: 44px;
    height: 44px;
    border-color: var(--nn-sidebar-border);
    background: transparent;
    color: var(--nn-sidebar-text);
  }

  .nn-dashboard-notifications__trigger:hover,
  .nn-dashboard-notifications__trigger:focus-visible,
  .nn-dashboard-notifications.is-open .nn-dashboard-notifications__trigger {
    border-color: var(--nn-color-accent);
    background: var(--nn-sidebar-hover-bg);
    color: var(--nn-color-accent);
  }

  .nn-dashboard-notifications__trigger:focus-visible {
    outline: 2px solid var(--nn-color-accent);
    outline-offset: 2px;
  }

  .nn-dashboard-notifications__badge {
    border-color: var(--nn-sidebar-bg);
  }

  .nn-dashboard-notifications__panel {
    position: fixed;
    inset: calc(var(--nn-topbar-height) + 4px) 12px auto;
    width: auto;
    max-height: calc(100dvh - 88px);
    border-radius: 9px;
  }

  .nn-dashboard-notifications__body {
    max-height: calc(100dvh - 146px);
  }
}

@media (max-width: 420px) {
  .nn-dashboard-notification-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .nn-dashboard-notification-item p,
  .nn-dashboard-notification-item a {
    grid-column: 1;
    grid-row: auto;
  }

  .nn-dashboard-notification-item a {
    justify-self: start;
    margin-top: 4px;
  }
}
