.monitoring-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0.25rem 1rem;
}

.monitoring-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.monitoring-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #5c4318;
}

.monitoring-subtitle {
  margin: 0.35rem 0 0;
  color: #6b7280;
  max-width: 60ch;
}

.monitoring-toolbar {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.monitoring-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 190px;
}

.monitoring-toolbar-field-compact {
  min-width: 160px;
}

.monitoring-toolbar-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #5b4b32;
}

.monitoring-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 0.92rem;
}

.monitoring-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.monitoring-metric-card {
  overflow: hidden;
}

.monitoring-metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.monitoring-metric-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
}

.monitoring-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.monitoring-metric-subtitle {
  font-size: 0.85rem;
  color: #64748b;
}

.monitoring-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.monitoring-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.monitoring-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 12px 40px rgb(120 89 28 / 8%);
}

.monitoring-clients-panel {
  min-width: 0;
}

.monitoring-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.monitoring-panel-header-stacked {
  align-items: end;
  flex-wrap: wrap;
}

.monitoring-panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.monitoring-panel-header span {
  color: #6b7280;
  font-size: 0.9rem;
}

.monitoring-detail-card .e-card-content {
  padding-top: 0;
}

.monitoring-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.monitoring-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.55rem;
}

.monitoring-detail-row span {
  color: #64748b;
  font-size: 0.9rem;
}

.monitoring-detail-row strong {
  text-align: right;
  color: #111827;
}

.monitoring-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.monitoring-screenshot {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  min-height: 180px;
  object-fit: cover;
}

.monitoring-screenshot-meta {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.monitoring-shot-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.monitoring-shot-type-periodic {
  background: #e2e8f0;
  color: #334155;
}

.monitoring-shot-type-event {
  background: #ffedd5;
  color: #9a3412;
}

.monitoring-shot-type-active {
  box-shadow: 0 0 0 2px #fdba74;
}

.monitoring-error-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff1f2, #fee2e2);
  border: 1px solid #fecdd3;
}

.monitoring-error-time {
  color: #9f1239;
  font-size: 0.85rem;
  font-weight: 600;
}

.monitoring-error-message {
  color: #4c0519;
  font-weight: 600;
}

.monitoring-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.85rem;
}

.monitoring-log-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.55rem;
}

.monitoring-log-detail-row span {
  color: #64748b;
  font-size: 0.9rem;
}

.monitoring-log-detail-row strong {
  text-align: right;
  color: #111827;
}

.monitoring-log-context {
  margin: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.84rem;
  color: #0f172a;
}

.monitoring-log-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.9rem 1rem 0.55rem;
}

.monitoring-log-dialog-body {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.monitoring-log-dialog-actions {
  margin-top: 0.5rem;
  padding: 0 1rem 0.9rem;
  display: flex;
  justify-content: flex-end;
}

.monitoring-log-context-title {
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.monitoring-log-dialog-content .monitoring-log-detail-row {
  padding: 0.1rem 0 0.75rem;
}

.monitoring-log-dialog-content .monitoring-log-context {
  padding: 0.95rem;
  border-radius: 12px;
}

.monitoring-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (width <= 1200px) {
  .monitoring-main-grid,
  .monitoring-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (width <= 720px) {
  .monitoring-page {
    padding: 0.25rem 0 0.75rem;
  }

  .monitoring-title {
    font-size: 1.5rem;
  }

  .monitoring-header-row,
  .monitoring-panel-header,
  .monitoring-detail-row,
  .monitoring-log-detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .monitoring-detail-row strong,
  .monitoring-log-detail-row strong {
    text-align: left;
  }

  .monitoring-toolbar,
  .monitoring-toolbar-field,
  .monitoring-toolbar-field-compact {
    width: 100%;
  }

  .monitoring-log-dialog-content {
    padding: 0.4rem 0.2rem 0.1rem;
    gap: 0.75rem;
  }

  .monitoring-log-dialog-body {
    min-height: 300px;
  }

  .monitoring-log-dialog-actions {
    padding: 0 0.2rem 0.4rem;
  }
}