.monitor-overview {
  display: grid;
  grid-template-columns: 1.3fr repeat(5, 1fr);
  gap: 9px;
  margin-bottom: 16px;
}
.overview-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid #8c98a6;
  background: #f8fafb;
}
.overview-card span,
.overview-card strong {
  display: block;
}
.overview-card span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.overview-card strong {
  margin-top: 7px;
  color: var(--blue);
  font-size: 17px;
}
.overview-card.healthy {
  border-top-color: var(--success);
}
.overview-card.working {
  border-top-color: #2d79aa;
}
.overview-card.warning,
.overview-card.planned,
.overview-card.waiting {
  border-top-color: var(--gold);
}
.overview-card.critical {
  border-top-color: #a33b3b;
  background: #fff8f7;
}
.monitor-alerts {
  margin-bottom: 16px;
}
.monitor-ok,
.alert-banner {
  border-radius: 4px;
  padding: 12px 14px;
}
.monitor-ok {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #205e44;
  background: #eef8f3;
  font-size: 12px;
}
.monitor-ok span,
.live-indicator i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f9b6c;
  box-shadow: 0 0 0 4px rgba(47, 155, 108, 0.13);
}
.alert-banner {
  display: grid;
  gap: 6px;
  color: #7e2729;
  background: #fff0ef;
  border-left: 4px solid #a33b3b;
}
.monitor-alert {
  font-size: 12px;
}
.agent-list {
  grid-template-columns: 1fr;
}
.agent-card {
  display: block;
  padding: 0;
  overflow: hidden;
  border-left-width: 5px;
}
.agent-card.monitor-stopped {
  border-left-color: #a33b3b;
}
.agent-card.monitor-working {
  border-left-color: #2d79aa;
}
.agent-card.monitor-review,
.agent-card.monitor-warning,
.agent-card.monitor-planned {
  border-left-color: var(--gold);
}
.agent-identity {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.agent-identity img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.agent-identity strong,
.agent-identity small {
  display: block;
}
.agent-identity strong {
  color: var(--blue);
  font:
    500 23px Georgia,
    serif;
}
.agent-identity p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.agent-state {
  display: flex;
  align-items: center;
  gap: 7px;
}
.agent-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.monitor-working .agent-state i,
.monitor-working .live-indicator i {
  animation: status-pulse 1.5s infinite;
}
.monitor-planned .agent-state i {
  background: var(--gold);
}
.agent-operation {
  padding: 16px 18px;
}
.operation-reason {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.health-grid > div {
  padding: 10px;
  border: 1px solid var(--line);
  background: white;
}
.health-grid span,
.health-grid strong {
  display: block;
}
.health-grid span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}
.health-grid strong {
  margin-top: 5px;
  color: var(--blue);
  font-size: 14px;
}
.run-timeline {
  margin-top: 14px;
}
.run-timeline > div:first-child,
.timeline-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.timeline-track {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  margin: 8px 0 4px;
}
.timeline-track i {
  height: 14px;
  border-radius: 2px;
  background: #e3e8ed;
}
.timeline-track .success {
  background: #46a878;
}
.timeline-track .failed,
.timeline-track .mixed {
  background: #bd4c50;
}
.timeline-track .running {
  background: #2d79aa;
  animation: status-pulse 1.5s infinite;
}
.agent-output,
.agent-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
}
.agent-output span {
  font-size: 11px;
}
.agent-output b {
  color: var(--blue);
}
.agent-controls {
  align-items: flex-start;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.agent-controls details {
  flex: 1;
  min-width: 300px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
}
.agent-config-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}
@keyframes office-work {
  from {
    width: 35%;
  }
  to {
    width: 95%;
  }
}
@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(45, 121, 170, 0.4);
  }
  50% {
    opacity: 0.65;
    box-shadow: 0 0 0 5px rgba(45, 121, 170, 0);
  }
}

@media (max-width: 1000px) {
  .monitor-overview {
    grid-template-columns: repeat(3, 1fr);
  }
  .office-layout {
    grid-template-columns: 1fr;
  }
  .health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .agent-config-form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .monitor-overview {
    grid-template-columns: 1fr 1fr;
  }
  .office-worker {
    grid-template-columns: 90px 1fr;
  }
  .agent-identity {
    grid-template-columns: 56px 1fr;
  }
  .agent-identity img {
    width: 56px;
    height: 56px;
  }
  .agent-state {
    grid-column: 1 / -1;
  }
  .agent-config-form,
  .member-form {
    grid-template-columns: 1fr;
  }
}
