.agent-heading {
  align-items: center;
}

.header-create-action {
  position: relative;
}

.header-add-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 156px;
  padding: 5px;
  border: 1px solid #30383e;
  border-radius: 8px;
  background: #11161a;
  box-shadow: 0 14px 36px #0009;
}

.header-add-menu button {
  border: 0;
  border-radius: 5px;
  background: none;
  color: #d7dde1;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.header-add-menu button:hover,
.header-add-menu button:focus-visible {
  background: #20272c;
  outline: none;
}

.agent-readonly {
  color: #626d75;
  font-size: 10px;
}

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

.agent-list {
  display: grid;
  gap: 18px;
}

.retired-agents {
  margin-top: 28px;
}

.retired-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 12px;
}

.retired-heading h3 {
  margin: 3px 0 0;
  font-size: 15px;
}

.retired-heading > p {
  max-width: 400px;
  margin: 0;
  color: #7d878e;
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.agent-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.agent-card.retired {
  border-color: #3b352b;
  opacity: .82;
}

.agent-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
}

.agent-card-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.agent-card-head div > span {
  color: #68737c;
  font-size: 10px;
}

.badge.warning {
  background: #3b301d;
  color: var(--amber);
}

.status-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 8px #f4bd5b55;
}

.agent-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.agent-meta span {
  color: #5f6971;
  font-size: 8px;
  letter-spacing: .7px;
}

.agent-meta strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #b9c1c7;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-observations {
  padding: 7px 20px 12px;
}

.agent-actions {
  padding: 0 20px 15px;
  text-align: right;
}

.agent-actions button {
  border: 1px solid #2b3339;
  border-radius: 5px;
  padding: 5px 8px;
  background: #171c20;
  color: #929ca5;
  cursor: pointer;
}

.agent-actions .danger-button {
  margin-left: 7px;
  border-color: #663e3e;
  color: #e19a9a;
}

.retired-contact {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  color: #879198;
  font-size: 10px;
}

.retired-contact strong {
  color: #b7c0c5;
  font-size: 10px;
}

.retired-contact.warning {
  background: #392a1b;
}

.retired-contact.warning strong {
  color: var(--amber);
}

.agent-inventory {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}

.agent-inventory p {
  margin: 0 0 8px;
  color: #66717a;
  font-size: 8px;
  letter-spacing: .7px;
}

.agent-inventory > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.agent-inventory span {
  min-width: 0;
  overflow: hidden;
  color: #aeb7bd;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-inventory strong {
  display: block;
  color: #66717a;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.collector-toolbar,
.collector-toolbar > div:last-child,
.collector-editor-head {
  display: flex;
  align-items: center;
}

.collector-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.collector-toolbar p {
  margin: 0 0 3px;
  color: #66717a;
  font-size: 8px;
  letter-spacing: .7px;
}

.collector-toolbar strong {
  color: #c5ccd1;
  font-size: 12px;
}

.collector-toolbar > div:last-child {
  gap: 7px;
}

.collector-toolbar select {
  max-width: 150px;
}

.collector-list {
  display: grid;
  gap: 10px;
}

.collector-editor {
  border: 1px solid #2a3238;
  border-radius: 7px;
  padding: 12px;
  background: #12171b;
}

.collector-editor-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.collector-editor-head strong {
  color: #d7dde0;
  font-size: 12px;
}

.collector-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.collector-common {
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)) auto;
  margin-bottom: 9px;
}

.collector-editor label {
  color: #89939b;
  font-size: 9px;
}

.collector-editor input,
.collector-editor textarea,
.collector-toolbar select,
#agentConfigInput {
  width: 100%;
  border: 1px solid #2a3238;
  border-radius: 6px;
  padding: 9px 10px;
  background: #12171b;
  color: #dce1e4;
}

.collector-editor textarea,
#agentConfigInput {
  resize: vertical;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

#agentConfigInput {
  min-height: 260px;
}

.collector-editor .check-label {
  align-self: end;
  padding-bottom: 9px;
}

.collector-editor .check-label input {
  width: auto;
}

.collector-wide {
  grid-column: 1 / -1;
}

.collector-help {
  margin: 2px 0 0;
}

.danger-button {
  color: #e58686;
}

.agent-observation {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #20262b;
}

.agent-observation:last-child {
  border-bottom: 0;
}

.agent-observation .status-dot {
  margin: 0;
}

.overview-agent-checks {
  display: grid;
  gap: 0;
  margin: 14px 20px 27px;
  border-top: 1px solid #20262b;
}

.overview-agent-check {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  border-bottom: 1px solid #20262b;
  color: #66717a;
  font-size: 9px;
}

.overview-agent-check .status-dot {
  margin: 0;
}

.overview-agent-check strong {
  overflow: hidden;
  color: #c5ccd1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-agent-check span {
  color: #84909a;
}

.agent-observation strong,
.agent-observation small {
  display: block;
}

.agent-observation strong {
  color: #c5ccd1;
  font-size: 10px;
}

.agent-observation small,
.agent-observation > span,
.empty-observation {
  color: #66717a;
  font-size: 9px;
}

.empty-observation {
  display: block;
  padding: 16px 0 10px;
  text-align: center;
}

.organization-locations {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.organization-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  color: #c5ccd1;
  font-size: 12px;
}

.organization-location + .organization-location {
  border-top: 1px solid var(--line);
}

.organization-empty {
  margin: 14px 20px;
}

.agent-actions button:disabled,
.row-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 1000px) {
  .agent-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-action-label {
    display: none;
  }

  .agent-readonly {
    display: none;
  }

  .agent-meta {
    grid-template-columns: 1fr 1fr;
  }

  .collector-toolbar,
  .collector-toolbar > div:last-child {
    align-items: stretch;
    flex-direction: column;
  }

  .collector-fields,
  .collector-common {
    grid-template-columns: 1fr;
  }
}
