.status-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  position: relative; /* allow loader overlay to cover the page content */
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.status-title {
  font-size: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.status-subtitle {
  font-size: 0.95rem;
}

.status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-btn {
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  background: #475569;
  color: white;
  font-size: 0.95rem;
}

.status-btn.secondary {
  background: #64748b;
}

.status-btn.primary {
  background: #2563eb;
}

.status-btn.disabled,
.status-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-section {
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin: 14px 0;
}

.dark-mode .status-section {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
}

.status-section-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.status-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 720px) {
  .status-table {
    gap: 12px;
  }
}

.status-row {
  display: grid;
  grid-template-columns: 200px 90px 1fr;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  transition: background-color 0.2s;
}

.status-row:last-child {
  border-bottom: none;
}

.status-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 720px) {
  .status-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name badge"
      "details details";
    gap: 6px 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.1);
  }

  .status-name {
    grid-area: name;
    font-size: 1rem;
    font-weight: 600;
  }

  .status-badge-wrapper {
    grid-area: badge;
    justify-self: end;
  }

  .status-details {
    grid-area: details;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.4;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
  }

  .status-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .status-title {
    justify-content: flex-start;
  }

  .status-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .status-btn {
    text-align: center;
    justify-content: center;
    padding: 12px;
  }

  /* Make the primary button span full width if it's the only one or last one */
  .status-btn.primary:last-child:nth-child(odd) {
     grid-column: span 2;
  }
}

.status-name {
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  width: fit-content;
}

.status-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.dark-mode .status-badge.ok {
  color: #34d399;
}

.status-badge.bad {
  background: rgba(239, 68, 68, 0.12);
  color: #7f1d1d;
  border: 1px solid rgba(239, 68, 68, 0.30);
}

.dark-mode .status-badge.bad {
  color: #fca5a5;
}

.status-details {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
}
