.settings-nav__item:not(:disabled) { cursor: pointer; }

.bg-agents-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
}

.bg-agents-toolbar__actions {
  display: flex;
  gap: 8px;
}

.btn--danger {
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn--danger:hover {
  background: #b71c1c;
}

.bg-agents-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.bg-agents-status {
  min-height: 18px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.bg-agents-status[data-kind="error"] { color: #b42318; }

.bg-agents-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.bg-agents-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 13px;
}

.bg-agents-table th,
.bg-agents-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.bg-agents-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
}

.bg-agents-table td strong,
.bg-agents-table td span {
  display: block;
}

.bg-agents-table td span {
  max-width: 220px;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bg-agent-status {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.bg-agent-status--running { color: #047857; }
.bg-agent-status--errored { color: #b42318; }

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

.bg-agents-actions button,
.bg-agent-form button,
.bg-agents-toolbar button {
  min-height: 30px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  padding: 5px 9px;
  cursor: pointer;
  font-size: 12px;
}

.bg-agents-actions button:hover,
.bg-agent-form button:hover,
.bg-agents-toolbar button:hover {
  background: var(--bg-hover);
}

.bg-agents-toolbar button.btn--danger {
  border-color: #d32f2f;
  background: #d32f2f;
  color: #fff;
}

.bg-agents-toolbar button.btn--danger:hover {
  background: #b71c1c;
}

.bg-agents-actions button.btn--danger,
.bg-agent-note__actions button.btn--danger,
.watcher-notification-detail__actions button.btn--danger {
  border-color: #d32f2f;
  background: #d32f2f;
  color: #fff;
}

.bg-agents-actions button.btn--danger:hover,
.bg-agent-note__actions button.btn--danger:hover,
.watcher-notification-detail__actions button.btn--danger:hover {
  background: #b71c1c;
}

.bg-agent-form {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.bg-agent-form h4 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
}

.bg-agent-form label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.bg-agent-form input,
.bg-agent-form select,
.bg-agent-form textarea {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  padding: 8px 10px;
  font: inherit;
}

.bg-agent-form textarea { resize: vertical; }

.bg-agent-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bg-agent-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.bg-agent-notifications {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.bg-agent-note {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.bg-agent-note strong { display: block; }
.bg-agent-note span { color: var(--text-muted); font-size: 12px; }
.bg-agent-note p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.bg-agent-note.is-focused { border-color: var(--primary); }
.bg-agent-note__actions { display: flex; gap: 8px; margin-top: 8px; }
.bg-agent-note__actions button {
  min-height: 28px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  padding: 4px 9px;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 760px) {
  .bg-agent-form__grid { grid-template-columns: 1fr; }
  .bg-agents-toolbar { align-items: stretch; flex-direction: column; }
}

.watcher-notifications {
  position: relative;
}

.watcher-notifications__trigger {
  position: relative;
}

.watcher-notifications__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border: 2px solid var(--bg-elevated);
  border-radius: 999px;
  background: #d32f2f;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 11px;
  text-align: center;
}

.watcher-notifications__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 24px));
  max-height: min(460px, calc(100vh - 96px));
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.watcher-notifications__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 9px;
  border-bottom: 1px solid var(--border-subtle);
}

.watcher-notifications__header strong {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.watcher-notifications__header span {
  color: var(--text-muted);
  font-size: 12px;
}

.watcher-notifications__header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

.watcher-notifications__header button:hover,
.watcher-notifications__header button:focus-visible {
  color: var(--text-strong);
  outline: none;
}

.watcher-notifications__header button:disabled {
  cursor: default;
  opacity: 0.45;
}

.watcher-notifications__list {
  display: grid;
  max-height: 390px;
  overflow-y: auto;
}

.watcher-notifications__row {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  text-align: left;
}

.watcher-notifications__row:hover,
.watcher-notifications__row:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.watcher-notifications__row.is-unread {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.watcher-notifications__row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.watcher-notifications__row-top strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watcher-notifications__row-top span,
.watcher-notifications__meta {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
}

.watcher-notifications__message {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.watcher-notifications__empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.watcher-notification-toasts {
  position: absolute;
  top: calc(100% + 8px);
  right: 18px;
  z-index: 25;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
}

.watcher-notification-toast {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
}

.watcher-notification-toast:hover,
.watcher-notification-toast:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.watcher-notification-toast__eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-transform: uppercase;
}

.watcher-notification-toast strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watcher-notification-toast span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 760px) {
  .watcher-notifications__panel {
    position: fixed;
    top: 58px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .watcher-notification-toasts {
    top: 58px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .watcher-notification-detail__panel {
    width: 100%;
  }
}


.watcher-notification-detail {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.18);
}

.watcher-notification-detail[hidden] { display: none; }

.watcher-notification-detail__panel {
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(420px, 100vw);
  height: 100%;
  padding: 18px;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.16);
}

.watcher-notification-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watcher-notification-detail__header span,
.watcher-notification-detail__meta {
  color: var(--text-muted);
  font-size: 12px;
}

.watcher-notification-detail__header button,
.watcher-notification-detail__actions button {
  min-height: 30px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

.watcher-notification-detail__header button:hover,
.watcher-notification-detail__actions button:hover {
  background: var(--bg-hover);
}

.watcher-notification-detail__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.watcher-notification-detail h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 24px;
}

.watcher-notification-detail p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.watcher-notification-detail__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
