﻿.monitor .library-head {
  margin-bottom: 24px;
  align-items: flex-end;
}
#snapshot,
.monitor-heading > span,
.queue-head > span {
  color: var(--muted);
  font-size: 12px;
}
.monitor-heading,
.queue-head,
.worker-head,
.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.monitor-heading {
  margin: 0 0 10px;
}
.monitor h2,
.queue-head h2,
.dialog-bar h2 {
  margin: 0;
  font-size: 17px;
}
.workers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.worker-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 6px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
}
.worker-card:hover,
.worker-card[aria-pressed="true"] {
  background: #f3f6fd;
  border-color: #7b95c3;
}
.worker-card[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px #7b95c3;
}
.worker-head {
  width: 100%;
  margin-bottom: 3px;
}
.worker-head strong {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 15px;
}
.worker-health,
.task-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 650;
}
.worker-health:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.free,
.task-state.completed {
  background: #e5f3eb;
  color: #2a6548;
}
.busy,
.task-state.running {
  background: #e9effc;
  color: #355796;
}
.off,
.task-state.queued,
.task-state.cancelled {
  background: #edf0f4;
  color: #596578;
}
.task-state.needs_login,
.task-state.partial,
.task-state.paused {
  background: #fdf0dc;
  color: #865424;
}
.task-state.failed {
  color: #9d3936;
  background: #f8e7e6;
}
.worker-run {
  font-size: 13px;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.heartbeat,
.sessions small,
.queue-table small,
.detail-meta {
  font-size: 12px;
  color: var(--muted);
}
.heartbeat {
  font-variant-numeric: tabular-nums;
}
.sessions {
  border-top: 1px solid #e6eaf0;
  padding-top: 8px;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: #44546a;
}
.sessions .login-issue {
  color: #9b5c24;
  font-weight: 650;
}
.queue-head {
  padding: 16px 20px 0;
}
.monitor .list-tools {
  padding-top: 12px;
}
#scope {
  background: #eff4fc;
  padding: 8px 20px;
  color: #455875;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#scope button,
.task-open {
  border: 0;
  background: none;
  color: #2e5187;
  cursor: pointer;
}
#scope button {
  text-decoration: underline;
  font: inherit;
}
.queue-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
  font-size: 13px;
}
.queue-table th,
.queue-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e6ec;
  vertical-align: middle;
}
.queue-table th:first-child,
.queue-table td:first-child {
  padding-left: 20px;
}
.queue-table th {
  font-size: 12px;
  font-weight: 600;
  color: #59677b;
  background: #f7f8fa;
}
.queue-table th:nth-child(1) {
  width: 31%;
}
.queue-table th:nth-child(2) {
  width: 11%;
}
.queue-table th:nth-child(3) {
  width: 15%;
}
.queue-table th:nth-child(4) {
  width: 17%;
}
.queue-table small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.task-open {
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  line-height: 1.5;
  padding: 0;
}
.task-open:hover {
  text-decoration: underline;
}
.job-progress {
  font-family: "IBM Plex Mono", Consolas, monospace;
}
.job-progress progress {
  height: 5px;
  width: min(92px, 100%);
  display: block;
  margin-top: 5px;
  appearance: none;
  accent-color: #5275ab;
}
progress::-webkit-progress-bar {
  background: #e5eaf2;
  border-radius: 4px;
}
progress::-webkit-progress-value {
  background: #557db6;
  border-radius: 4px;
}
#task-dialog {
  width: min(570px, 94vw);
  max-height: 86vh;
  overflow: auto;
}
#task-dialog .dialog-bar {
  position: sticky;
  top: 0;
  background: #f0f3fa;
}
#task-detail {
  padding: 18px 22px 20px;
}
.detail-title h3 {
  font-size: 18px;
  margin: 0;
}
.detail-meta {
  margin: 3px 0 10px;
}
.task-note {
  background: #f2f5f9;
  padding: 7px 10px;
  font-size: 13px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0;
}
.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid #edf0f4;
  padding-bottom: 4px;
  font-size: 12px;
}
.facts dt,
.task-parent {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 600;
}
#task-detail h4 {
  font-size: 14px;
  margin: 16px 0 8px;
}
.task-events {
  list-style: none;
  padding: 0;
  margin: 0;
}
.task-events li {
  display: flex;
  gap: 12px;
  font-size: 12px;
  line-height: 1.7;
  margin: 3px 0;
}
.task-events time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.task-parent {
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.task-parent a {
  color: var(--blue);
}
@media (max-width: 920px) {
  .worker-card {
    padding: 11px;
  }
  .workers {
    gap: 7px;
  }
  .monitor .library-head {
    align-items: flex-start;
  }
  .queue-table th,
  .queue-table td {
    padding: 9px 6px;
  }
  .sessions {
    gap: 4px;
  }
}
@media (max-width: 720px) {
  .monitor .library-head {
    display: block;
  }
  .monitor .library-head p {
    margin-bottom: 5px;
  }
  .workers {
    grid-template-columns: 1fr;
  }
  .worker-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 7px;
  }
  .worker-head,
  .worker-run {
    grid-column: 1/-1;
  }
  .heartbeat {
    grid-row: 3;
    grid-column: 1/-1;
  }
  .sessions {
    grid-column: 1/-1;
    margin-top: 3px;
    padding-top: 4px;
    gap: 8px;
  }
  .queue-head {
    padding: 13px 12px 0;
    flex-wrap: wrap;
  }
  .monitor .list-tools {
    padding: 10px;
  }
  .monitor .list-tools select {
    max-width: 155px;
  }
  .queue-table,
  .queue-table tbody {
    display: block;
  }
  .queue-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
  .queue-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .queue-table td,
  .queue-table td:first-child {
    display: block;
    border: 0;
    padding: 0;
  }
  .job-name {
    grid-column: 1;
  }
  .job-state {
    grid-column: 2;
    text-align: right !important;
  }
  .job-progress {
    grid-column: 1;
    grid-row: 2;
  }
  .job-worker {
    grid-column: 2;
    grid-row: 2;
  }
  .job-action {
    grid-column: 1/-1;
    color: var(--muted);
  }
  .job-action small {
    display: inline;
    margin-left: 8px;
  }
  #task-detail {
    padding: 12px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}
