/* Top AppBar, SwarmMonitor metrics bar, StateButtons, and Footer */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
}

.navbar {
  background: var(--navbar-bg);
  color: var(--navbar-fg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 40;
}

.container-xl {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navbar-fg);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-link:hover {
  text-decoration: none;
  opacity: 0.94;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-subtitle {
  font-size: 10px;
  opacity: 0.85;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.swarm-monitor {
  display: flex;
  align-items: center;
  gap: 14px;
}

.monitor-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 56px;
}

.monitor-item.centered {
  align-items: center;
}

.monitor-label {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.88;
}

.monitor-value {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.monitor-host {
  text-transform: none;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.28);
  margin: 4px 0;
}

.state-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-success {
  background: var(--color-success);
  color: #062b16;
}
.btn-success:hover:not(:disabled) {
  background: var(--color-success-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-secondary-hover);
}

.btn-error {
  background: var(--color-error);
  color: #fff;
}
.btn-error:hover:not(:disabled) {
  background: var(--color-error-hover);
}

.btn-warning {
  background: var(--color-warning);
  color: #fff;
}
.btn-warning:hover:not(:disabled) {
  background: var(--color-warning-hover);
}

.btn-history {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
}
.btn-history:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
  text-transform: none;
  font-weight: 500;
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  width: 100%;
  margin-top: auto;
  background: var(--bg-page);
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  min-height: var(--footer-height);
  padding-top: 10px;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.app-footer a {
  color: var(--text-secondary);
  font-weight: 500;
}

.app-footer a:hover {
  color: var(--color-primary);
}

.footer-dot {
  opacity: 0.55;
}

.footer-version {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 11px;
}

@media (max-width: 1024px) {
  .navbar-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .navbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }
  .monitor-host {
    max-width: 180px;
  }
}
