/* Staff notifications and site requests. This file intentionally styles only
   the new inbox controls; the existing workspace keeps its original theme. */

#shell .staff-notification-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 12px;
  color: #f5f5f2;
  background: #1b1a1a;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

#shell .staff-notification-trigger:hover {
  border-color: rgba(247, 207, 0, .45);
  color: #f7cf00;
  background: #242321;
}

#shell .staff-notification-trigger:focus-visible,
#shell .site-task-card:focus-visible,
#shell .staff-inbox-dialog :where(button, input, textarea, select):focus-visible {
  outline: 2px solid #f7cf00;
  outline-offset: 2px;
}

#shell .staff-notification-trigger svg {
  width: 20px;
  height: 20px;
}

#shell .staff-notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #0a0a0b;
  border-radius: 999px;
  color: #1a1400;
  background: #f7cf00;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

#shell .staff-notification-count[hidden],
#shell .staff-inbox-dialog [hidden] {
  display: none !important;
}

/* Site requests use the same layout and dimensions as ordinary task cards. */
#shell .site-task-card {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

#shell .site-task-card .task-card-top > :first-child,
#shell .site-task-card .task-title {
  min-width: 0;
}

#shell .site-task-card .task-title,
#shell .site-task-card .task-meta {
  overflow-wrap: anywhere;
}

#shell .site-task-card--waiting {
  border: 1px solid rgba(247, 207, 0, .58);
  background: linear-gradient(145deg, rgba(247, 207, 0, .095), rgba(247, 207, 0, .025) 58%), #1b1a1a;
  box-shadow: 0 0 0 1px rgba(247, 207, 0, .06), 0 10px 30px -18px rgba(247, 207, 0, .62);
}

#shell .site-task-card--waiting:hover {
  border-color: rgba(247, 207, 0, .76);
  background: linear-gradient(145deg, rgba(247, 207, 0, .13), rgba(247, 207, 0, .035) 58%), #1d1d1b;
}

#shell .staff-site-error {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 92, 92, .25);
  border-radius: 11px;
  color: #ff8681;
  background: rgba(255, 92, 92, .09);
  font-size: 11px;
  line-height: 1.45;
}

/* Native dialogs used by the notification drawer and request details. */
#shell .staff-inbox-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  color: #f5f5f2;
  background: #151514;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .72);
  transform: translate(-50%, -50%);
}

#shell .staff-inbox-dialog:not([open]) {
  display: none !important;
}

#shell .staff-inbox-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(5px);
}

#shell .staff-inbox-dialog-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  background: #111110;
}

#shell .staff-inbox-dialog-head h2,
#shell .staff-task-heading h3 {
  margin: 0;
  color: #f5f5f2;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -.02em;
}

#shell .staff-inbox-dialog-head h2 {
  font-size: 17px;
  line-height: 1.25;
}

#shell .staff-inbox-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0 0 3px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  color: #eeeae4;
  background: #232321;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#shell .staff-inbox-close:hover {
  border-color: rgba(247, 207, 0, .42);
  color: #f7cf00;
}

#shell .staff-inbox-dialog-body {
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0d0d0d;
  scrollbar-color: #393733 transparent;
}

#shell .staff-notification-drawer {
  inset: 72px 16px auto auto;
  width: min(390px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 88px));
  transform: none;
}

#shell .staff-notification-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #9b9690;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

#shell .staff-inbox-text-button,
#shell .staff-inbox-icon-button,
#shell .staff-notification-open {
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

#shell .staff-inbox-text-button {
  padding: 5px 7px;
  color: #f7cf00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

#shell .staff-inbox-text-button:hover {
  color: #ffe86a;
  text-decoration: underline;
}

#shell .staff-inbox-button:disabled,
#shell .staff-inbox-text-button:disabled,
#shell .staff-inbox-icon-button:disabled {
  opacity: .48;
  cursor: default;
}

#shell .staff-notification-error,
#shell .staff-task-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 92, 92, .32);
  border-radius: 11px;
  color: #ff8681;
  background: rgba(255, 92, 92, .11);
  font-size: 12px;
  line-height: 1.45;
}

#shell .staff-notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#shell .staff-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(247, 207, 0, .3);
  border-radius: 13px;
  color: #f5f5f2;
  background: rgba(247, 207, 0, .08);
}

#shell .staff-notification-item.is-read {
  border-color: rgba(255, 255, 255, .075);
  background: #181817;
}

#shell .staff-notification-open {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 0;
  color: #f5f5f2;
  text-align: left;
}

#shell .staff-notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #f7cf00;
  box-shadow: 0 0 12px rgba(247, 207, 0, .45);
}

#shell .staff-notification-item.is-read .staff-notification-dot {
  background: #69655f;
  box-shadow: none;
}

#shell .staff-notification-open strong,
#shell .staff-notification-body,
#shell .staff-notification-open time {
  display: block;
}

#shell .staff-notification-open strong {
  color: #f5f5f2;
  font-size: 12px;
  line-height: 1.35;
}

#shell .staff-notification-body {
  margin-top: 4px;
  color: #b5b0aa;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#shell .staff-notification-open time {
  margin-top: 6px;
  color: #77726c;
  font-size: 9px;
}

#shell .staff-notification-actions {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

#shell .staff-inbox-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  color: #ff7772;
}

#shell .staff-inbox-icon-button:hover {
  background: rgba(255, 92, 92, .12);
}

#shell .staff-inbox-icon-button svg {
  width: 17px;
  height: 17px;
}

#shell .staff-notification-foot {
  margin: 12px 2px 0;
  color: #77726c;
  font-size: 10px;
  line-height: 1.45;
}

#shell .staff-inbox-dialog .site-request-empty {
  margin: 0;
  padding: 24px 14px;
  border: 1px dashed rgba(255, 255, 255, .11);
  border-radius: 12px;
  color: #918c85;
  background: #151514;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Request details */
#shell .staff-task-heading {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 15px;
  background: #181817;
}

#shell .staff-inbox-dialog .site-inbox-kicker {
  color: #f7cf00;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
}

#shell .staff-task-heading h3 {
  max-width: calc(100% - 130px);
  margin-top: 6px;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#shell .staff-inbox-dialog .site-request-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(247, 207, 0, .34);
  border-radius: 999px;
  color: #f7cf00;
  background: rgba(247, 207, 0, .11);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

#shell .staff-task-heading .site-request-status {
  position: absolute;
  top: 15px;
  right: 15px;
}

#shell .staff-inbox-dialog .site-request-meta {
  margin: 10px 0 0;
  color: #9b9690;
  font-size: 11px;
  line-height: 1.45;
}

#shell .staff-task-updated {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(247, 207, 0, .35);
  border-radius: 11px;
  color: #ead75c;
  background: rgba(247, 207, 0, .08);
  font-size: 12px;
}

#shell .staff-task-summary,
#shell .staff-task-contact,
#shell .staff-task-result,
#shell .staff-task-help,
#shell .staff-task-form,
#shell .staff-task-facts {
  margin: 12px 0 0;
}

#shell .staff-task-summary,
#shell .staff-task-contact,
#shell .staff-task-result,
#shell .staff-task-help {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 12px;
  color: #e7e3dd;
  background: #181817;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#shell .staff-task-contact strong,
#shell .staff-task-result strong {
  display: block;
  margin-bottom: 5px;
  color: #a9a49e;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

#shell .staff-task-contact p,
#shell .staff-task-result p {
  margin: 4px 0 0;
}

#shell .staff-task-result {
  border-color: rgba(51, 209, 122, .25);
  background: rgba(51, 209, 122, .08);
}

#shell .staff-task-help {
  color: #a9a49e;
  background: #151514;
}

#shell .staff-task-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 13px;
  background: rgba(255, 255, 255, .075);
}

#shell .staff-task-facts div {
  min-width: 0;
  padding: 11px 12px;
  background: #181817;
}

#shell .staff-task-facts dt {
  color: #8c8781;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#shell .staff-task-facts dd {
  margin: 5px 0 0;
  color: #eeeae4;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#shell .staff-task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 14px;
  background: #181817;
}

#shell .staff-task-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #a9a49e;
  font-size: 11px;
  font-weight: 800;
}

#shell .staff-task-form :where(input[type="number"], textarea, select) {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  color: #f5f5f2;
  background: #111110;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  resize: vertical;
}

#shell .staff-task-form textarea {
  min-height: 94px;
}

#shell .staff-task-form .staff-task-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  color: #e7e3dd;
  font-size: 12px;
  line-height: 1.45;
}

#shell .staff-task-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  accent-color: #f7cf00;
}

#shell .staff-task-alternative {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 11px;
  background: #111110;
}

#shell .staff-task-alternative summary {
  color: #a9a49e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

#shell .staff-task-alternative[open] summary {
  margin-bottom: 11px;
  color: #f5f5f2;
}

#shell .staff-task-reference {
  margin: 14px 2px 0;
  color: #69655f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  overflow-wrap: anywhere;
}

#shell .staff-inbox-button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  color: #eeeae4;
  background: #232321;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

#shell .staff-inbox-button:hover {
  border-color: rgba(247, 207, 0, .28);
  background: #2a2926;
}

#shell .staff-inbox-button.primary {
  border-color: transparent;
  color: #1a1400;
  background: linear-gradient(105deg, #ffdf45, #f7cf00);
}

#shell .staff-inbox-button.primary:hover {
  filter: brightness(1.05);
}

#shell .staff-inbox-dialog .site-request-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

#shell .staff-inbox-dialog .site-request-overdue {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 8px;
  color: #ff8681;
  background: rgba(255, 92, 92, .12);
  font-size: 10px;
  font-weight: 800;
}

@media (min-width: 900px) {
  .desktop-site #shell .staff-notification-trigger {
    position: fixed;
    z-index: 116;
    top: 20px;
    right: 28px;
    margin: 0;
  }

  .desktop-site #shell .staff-notification-drawer {
    inset: 72px 22px auto auto;
  }
}

@media (max-width: 899px) {
  #shell .staff-notification-trigger {
    position: relative;
    top: auto;
    right: auto;
    margin-left: auto;
  }

  #shell .staff-notification-drawer {
    inset: calc(68px + env(safe-area-inset-top)) 10px auto auto;
    width: min(390px, calc(100vw - 20px));
    max-height: calc(100dvh - 80px - env(safe-area-inset-top));
    border-radius: 17px;
  }

  #shell .staff-inbox-dialog:not(.staff-notification-drawer) {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  #shell .staff-inbox-dialog-head {
    min-height: 60px;
    padding: 10px 13px;
  }

  #shell .staff-inbox-dialog-body {
    padding: 13px;
  }

  #shell .staff-notification-item {
    grid-template-columns: minmax(0, 1fr);
  }

  #shell .staff-notification-actions {
    justify-content: flex-end;
  }

  #shell .staff-task-heading h3 {
    max-width: none;
    font-size: 18px;
  }

  #shell .staff-task-heading .site-request-status {
    position: static;
    margin-top: 10px;
  }

  #shell .staff-task-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  #shell .staff-inbox-dialog .site-request-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #shell .staff-inbox-dialog .site-request-actions .staff-inbox-button {
    width: 100%;
    min-height: 46px;
  }
}
