/* Notification feature styles. Global alert surfaces and shared delivery-status badges stay in src/styles.css. */

.notification-button {
  position: relative;
  min-height: 42px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #ffffff;
  color: #17212f;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  text-align: left;
}


.notification-button span {
  color: #607083;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}


.notification-button strong {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #edf3ff;
  color: #43546a;
  font-size: 13px;
}


.notification-button.has-unread {
  border-color: var(--frost-blue);
}


.notification-button.has-unread strong {
  background: var(--frost-blue);
  color: #ffffff;
}


.notification-summary .stat {
  border-top: 4px solid var(--frost-blue);
}


.notification-summary .stat.warn {
  border-top-color: var(--frost-warning);
}


.notification-summary .stat.good {
  border-top-color: var(--frost-success);
}


.notification-summary .stat.bad {
  border-top-color: var(--frost-danger);
}


.notification-settings-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #ffffff;
}


.notification-settings-form {
  grid-template-columns: 1fr;
}


.notification-routing-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbff;
}


.notification-routing-fieldset legend,
.email-template-details summary strong {
  color: #34465a;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}


.email-template-details {
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #f7fbff;
}


.email-template-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  cursor: pointer;
}


.email-template-details summary span {
  color: #607083;
  font-size: 12px;
  text-align: right;
}


.email-template-details > p {
  margin: 0;
  padding: 0 12px 10px;
  color: #607083;
  font-size: 12px;
}


.email-template-grid {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}


.notification-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}


.notification-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #ffffff;
}


.notification-panel .section-title button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #214ee5;
  color: #ffffff;
  font-weight: 900;
  padding: 0 12px;
}


.notification-panel .section-title button:disabled {
  background: #cfdae6;
  color: #607083;
}


.notification-list,
.notifications-page {
  display: grid;
  gap: 12px;
}


.system-active-panel > .notification-settings-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
}


.notification-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}


.notification-channels em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #214ee5;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}


.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #cfdae6;
  border-left: 5px solid #b9c7d0;
  border-radius: 8px;
  background: #f7fbff;
}


.notification-card.unread {
  border-left-color: #214ee5;
  background: #f3f9fc;
}


.notification-card span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  border-radius: 999px;
  background: #e7efff;
  color: #1f3f8f;
  font-size: 10px;
  font-weight: 950;
  padding: 4px 8px;
  text-transform: uppercase;
}


.notification-card strong {
  display: block;
  color: #17212f;
}


.notification-card p {
  margin: 4px 0;
  color: #44596b;
  line-height: 1.4;
}


.notification-card small {
  color: #607083;
}


.notification-actions {
  display: grid;
  gap: 8px;
  min-width: 118px;
}


.delivery-table {
  display: grid;
  gap: 8px;
}


.delivery-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}


.delivery-filters label {
  display: grid;
  gap: 5px;
  color: #607083;
  font-size: 0.78rem;
  font-weight: 800;
}


.delivery-filters select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd7df;
  border-radius: 8px;
  background: #ffffff;
  color: #17212f;
  padding: 0 10px;
}


.test-notification-form textarea {
  min-height: 88px;
}


.email-template-editor {
  display: grid;
  grid-template-columns: 160px minmax(180px, 0.8fr) minmax(260px, 1.4fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e7eef5;
  border-radius: 8px;
  background: #ffffff;
}


.email-template-editor strong {
  display: block;
  color: #17212f;
  font-size: 0.9rem;
}


.email-template-editor small {
  display: block;
  margin-top: 3px;
  color: #607083;
  font-size: 11px;
  font-weight: 850;
}


.email-template-editor textarea {
  min-height: 86px;
}


.delivery-row {
  display: grid;
  grid-template-columns: 100px 80px minmax(120px, 0.8fr) minmax(150px, 1fr) minmax(220px, 1.5fr) 120px 132px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #ffffff;
  color: #34465a;
  font-size: 0.88rem;
}


.delivery-record {
  display: grid;
  gap: 8px;
}


.delivery-row.header {
  background: #f3f7fb;
  color: #607083;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}


.delivery-row small {
  display: block;
  margin-top: 3px;
  color: #607083;
}


.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


.delivery-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: #214ee5;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0 9px;
}


.delivery-actions button[data-delivery-action="sendEmail"] {
  background: #1f3f8f;
}


.delivery-actions .secondary {
  background: #cfdae6;
  color: #17212f;
}


.email-delivery-preview {
  margin-left: 12px;
  padding: 10px 12px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #f7fbff;
}


.email-delivery-preview summary {
  cursor: pointer;
  color: #1f3f8f;
  font-size: 0.82rem;
  font-weight: 900;
}


.email-preview-grid {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0;
}


.email-preview-grid span {
  color: #607083;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}


.email-preview-grid strong {
  color: #17212f;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}


.email-delivery-preview pre {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  color: #34465a;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
}


.notification-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #214ee5;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 10px;
}


.notification-actions .secondary {
  background: #cfdae6;
  color: #17212f;
}


@media (max-width: 680px) {

  .notification-button {
    width: 100%;
  }


  .topbar > .notification-button {
    display: none !important;
  }

.notification-card,
.notification-summary,
.delivery-filters,
.delivery-row,
.email-preview-grid,
.email-template-editor,
.notification-routing-fieldset {
    grid-template-columns: 1fr;
  }

.email-template-details summary,
.notification-routing-fieldset {
    grid-template-columns: 1fr;
  }


  .notification-actions {
    min-width: 0;
  }
}

.email-template-details summary {
  background: linear-gradient(135deg, var(--frost-command), var(--frost-command-2));
  border-color: #284256;
  border-top: 1px solid #284256;
  color: #ffffff;
}

.email-template-details summary span,
.email-template-details summary strong {
  color: #ffffff;
}


.notification-summary .stat,
.notification-summary .stat.warn,
.notification-summary .stat.good,
.notification-summary .stat.bad {
  border-top: 1px solid #284256 !important;
}


.notification-summary .stat.active {
  border-top-color: var(--frost-blue) !important;
}

.notification-button.has-unread strong {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong));
  color: #ffffff;
}

.notification-button,
.notification-settings-panel {
  border-color: var(--brand-border);
  background: color-mix(in srgb, var(--brand-surface) 94%, var(--brand-panel));
  box-shadow: 0 18px 42px rgba(var(--brand-command-rgb), 0.07);
}


.notification-button span {
  color: var(--brand-muted);
}

.notification-button strong {
  border: 1px solid color-mix(in srgb, var(--brand-on-primary) 44%, var(--brand-primary-strong));
  background: color-mix(in srgb, var(--brand-primary-strong) 82%, var(--brand-primary));
  color: var(--brand-on-primary-strong);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--brand-on-primary) 14%, transparent),
    0 5px 12px rgba(var(--brand-command-rgb), 0.16);
}


.notification-button.has-unread {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.16);
}

.email-template-details summary {
  background:
    linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.18), transparent 52%),
    linear-gradient(135deg, var(--brand-command), var(--brand-command-2));
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--brand-command-2));
  box-shadow: 0 14px 34px rgba(var(--brand-command-rgb), 0.16);
}

.notification-card {
  border-color: var(--brand-border);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(var(--brand-command-rgb), 0.06);
}


.employees-page .notification-settings-panel {
  border-color: var(--brand-border);
  background:
    linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.06), transparent 48%),
    #ffffff;
  box-shadow: 0 18px 42px rgba(var(--brand-command-rgb), 0.07);
}


/* Notification defaults spacing cleanup */
.notification-settings-panel {
  gap: 14px;
}


.notification-settings-form {
  gap: 14px;
}


.notification-routing-fieldset {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  align-items: start;
  gap: 16px;
  border-color: var(--brand-border);
  background:
    linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.06), transparent 48%),
    var(--brand-panel);
  padding: 18px;
}


.notification-routing-fieldset legend {
  padding: 0 6px;
  color: var(--brand-primary);
}


.notification-routing-fieldset > label {
  min-height: 54px;
}


.notification-routing-fieldset > label:first-of-type,
.notification-routing-fieldset > .preference-fieldset {
  grid-column: 1 / -1;
}


.notification-routing-fieldset > div,
.notification-routing-fieldset > .preference-fieldset {
  display: grid;
  gap: 10px;
}


.notification-routing-fieldset > div > span {
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}


.notification-routing-fieldset > div > label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 900;
}


.notification-routing-fieldset > .preference-fieldset {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #ffffff;
}


.notification-routing-fieldset > .preference-fieldset legend {
  padding: 0 6px;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}


.notification-routing-fieldset > .preference-fieldset label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: var(--brand-panel);
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 900;
}


.notification-routing-fieldset input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand-primary);
}


.email-template-details {
  border-color: var(--brand-border);
  background: #ffffff;
  overflow: hidden;
}


.email-template-details summary {
  min-height: 60px;
  grid-template-columns: 1fr;
  justify-items: start;
  gap: 4px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.18), transparent 52%),
    linear-gradient(135deg, var(--brand-command), var(--brand-command-2));
}


.email-template-details summary strong,
.email-template-details summary span {
  color: #ffffff;
}


.email-template-details summary span {
  text-align: left;
}


.email-template-details > p {
  padding: 12px 14px 4px;
}


.email-template-grid {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px;
}


.email-template-editor {
  grid-template-columns: minmax(160px, 0.32fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border-color: var(--brand-border);
  background:
    linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.05), transparent),
    #ffffff;
}


.email-template-editor > div {
  padding-right: 12px;
  border-right: 1px solid var(--brand-border);
  border-bottom: 0;
  align-self: stretch;
}


.email-template-editor label {
  grid-column: 2;
  min-width: 0;
}


.email-template-editor textarea {
  min-height: 170px;
}


.email-template-editor input,
.email-template-editor textarea {
  width: 100%;
}


@media (max-width: 760px) {
  .notification-routing-fieldset,
.notification-routing-fieldset > .preference-fieldset,
.email-template-editor {
    grid-template-columns: 1fr;
  }


  .email-template-grid {
    grid-template-columns: 1fr;
  }


  .email-template-editor > div {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--brand-border);
  }


  .email-template-editor label {
    grid-column: auto;
  }
}

.notification-summary .stat,
.email-template-details summary {
  background: var(--brand-command-gradient) !important;
  border-color: var(--brand-command-border) !important;
  border-top-color: var(--brand-command-border) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 34px rgba(var(--brand-command-rgb), 0.15) !important;
}


.notification-summary .stat.active {
  background: var(--brand-command-active-gradient) !important;
  border-color: var(--brand-primary) !important;
  border-top-color: var(--brand-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 34px rgba(var(--brand-primary-rgb), 0.24) !important;
}

.email-template-details summary span,
.email-template-details summary strong {
  color: #ffffff !important;
}

.employees-page .notification-settings-panel,
.notification-settings-panel {
  border-color: var(--brand-border) !important;
  background: #ffffff !important;
  box-shadow: 0 18px 42px rgba(var(--brand-command-rgb), 0.07) !important;
}


.notification-card,
.notification-card.unread {
  border: 1px solid var(--brand-border) !important;
  border-left: 5px solid var(--brand-primary) !important;
  background: #ffffff !important;
  color: var(--brand-text) !important;
  box-shadow: 0 10px 24px rgba(var(--brand-command-rgb), 0.06) !important;
}


.notification-card {
  border-left-color: color-mix(in srgb, var(--brand-command) 56%, var(--brand-border)) !important;
}


.system-status-page .notification-channels em,
.notification-card span {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--brand-border)) !important;
  background: #ffffff !important;
  color: var(--brand-primary) !important;
}

.notification-routing-fieldset,
.email-template-details {
  border-color: var(--brand-border) !important;
  background: color-mix(in srgb, var(--brand-primary) 3%, #ffffff) !important;
}


.notification-card strong {
  color: var(--brand-text) !important;
}


.notification-card p,
.notification-card small {
  color: var(--brand-muted) !important;
}


.notification-actions button {
  border-color: var(--brand-primary) !important;
  background: var(--brand-primary) !important;
  color: #ffffff !important;
}


.notification-actions .danger {
  border-color: #ce2029 !important;
  background: #ce2029 !important;
  color: #ffffff !important;
}


.notification-actions .secondary {
  border-color: color-mix(in srgb, var(--brand-command) 42%, var(--brand-border)) !important;
  background: color-mix(in srgb, var(--brand-command) 88%, #ffffff) !important;
  color: #ffffff !important;
}

.notification-card span {
  min-height: 26px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--brand-border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--brand-primary) 10%, #ffffff) !important;
  color: var(--brand-primary-strong) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  padding: 0 9px !important;
  white-space: nowrap !important;
}


.notification-card {
  border-color: var(--brand-border) !important;
  background: var(--brand-surface) !important;
  color: var(--brand-text) !important;
  box-shadow: var(--theme-card-shadow) !important;
}


.notification-card:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 42%, var(--brand-border)) !important;
  box-shadow: var(--theme-card-shadow-strong) !important;
}

.notification-card span {
  border-color: var(--brand-border) !important;
  background: color-mix(in srgb, var(--brand-command) 6%, #ffffff) !important;
  color: var(--brand-text) !important;
}

.workspace .email-template-details > summary {
  border-color: var(--brand-primary) !important;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)) !important;
  color: var(--brand-on-primary) !important;
  box-shadow: 0 14px 30px rgba(var(--brand-primary-rgb), 0.2) !important;
}


.workspace .email-template-details[open] > summary {
  border-color: var(--brand-command-border) !important;
  background: var(--brand-command-gradient) !important;
  color: var(--brand-on-command) !important;
  box-shadow: 0 16px 34px rgba(var(--brand-command-rgb), 0.2) !important;
}


.workspace .email-template-details > summary * {
  color: inherit !important;
}

.workspace .email-delivery-preview > summary {
  border-color: var(--brand-primary) !important;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)) !important;
  color: var(--brand-on-primary) !important;
  box-shadow: 0 14px 30px rgba(var(--brand-primary-rgb), 0.2) !important;
}


.workspace .email-delivery-preview[open] > summary {
  border-color: var(--brand-command-border) !important;
  background: var(--brand-command-gradient) !important;
  color: var(--brand-on-command) !important;
  box-shadow: 0 16px 34px rgba(var(--brand-command-rgb), 0.2) !important;
}


.workspace .email-delivery-preview > summary * {
  color: inherit !important;
}


@media (max-width: 700px) {

  #root .workspace .topbar.my-day-topbar > .notification-button {
    display: none !important;
  }
}


@media (max-width: 680px) {

  #root .workspace .topbar .notification-button {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }


  #root .workspace .topbar .notification-button {
    min-height: 42px !important;
    display: grid !important;
    place-items: center !important;
    text-align: center !important;
  }


  #root .workspace .topbar > .notification-button {
    display: none !important;
    min-height: 0 !important;
  }
}
