:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #f6f8fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid #c9d2df;
  background: #ffffff;
  color: #172033;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  border-color: #6f7f95;
}

button.danger {
  border-color: #dc9c9c;
  color: #a12929;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input {
  min-width: 180px;
  border: 1px solid #c9d2df;
  border-radius: 6px;
  padding: 8px 10px;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #5d6a7c;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.infra,
.card {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.05);
}

.infra {
  padding: 14px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  padding: 16px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card h2 {
  margin: 0 0 5px;
  font-size: 18px;
  letter-spacing: 0;
}

.domain {
  color: #2f6fbd;
  text-decoration: none;
  word-break: break-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.ok,
.state.active {
  background: #e8f6ee;
  color: #167447;
}

.badge.warn,
.state.activating,
.state.deactivating {
  background: #fff5dd;
  color: #8a5b00;
}

.badge.down,
.badge.error,
.state.failed,
.state.inactive,
.state.missing {
  background: #fdecec;
  color: #ad2929;
}

.meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #5d6a7c;
}

.services {
  display: grid;
  gap: 10px;
}

.service {
  border-top: 1px solid #edf1f5;
  padding-top: 10px;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-name {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.service-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.actions button {
  padding: 6px 9px;
  font-size: 13px;
}

.empty {
  color: #79869a;
  font-size: 13px;
  border-top: 1px solid #edf1f5;
  padding-top: 10px;
}

#logsDialog {
  width: min(900px, calc(100vw - 36px));
  border: 1px solid #ccd5e1;
  border-radius: 8px;
  padding: 0;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

#logsOutput {
  margin: 0;
  padding: 14px;
  max-height: 65vh;
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }
}
