:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #18201d;
  background: #f7f8f8;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid #dfe4e2;
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px;
  color: #18201d;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #16734b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

nav { display: grid; gap: 4px; margin-top: 28px; }
.nav-item {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #56625e;
  text-align: left;
}
.nav-item:hover { background: #f1f4f3; color: #18201d; }
.nav-item.active { background: #eaf4ef; color: #11623f; font-weight: 600; }

.local-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  padding: 13px 10px 2px;
  border-top: 1px solid #e5e9e7;
}
.local-status div { display: grid; gap: 3px; min-width: 0; }
.local-status strong { font-size: 12px; font-weight: 600; }
.local-status span:last-child { color: #76817d; font-size: 11px; }
.status-dot { flex: none; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #a9b1ae; }
.status-dot.ready { background: #16734b; box-shadow: 0 0 0 3px #dcefe6; }

main { width: 100%; max-width: 1440px; padding: 30px 34px 54px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.kicker { margin: 0 0 5px; color: #6d7874; font-size: 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 26px; font-weight: 650; }
h2 { margin-bottom: 4px; font-size: 16px; font-weight: 650; }
.section-heading p { margin-bottom: 0; color: #74807b; font-size: 12px; }

.actions { display: flex; gap: 8px; }
.actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #cfd6d3;
  border-radius: 5px;
  background: #ffffff;
  color: #26302c;
}
.actions button:hover { border-color: #9fa9a5; background: #f4f6f5; }
.actions button.primary { border-color: #16734b; background: #16734b; color: #ffffff; }
.actions button.primary:hover { background: #105e3c; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics article {
  display: grid;
  min-height: 116px;
  padding: 16px;
  border: 1px solid #dde3e0;
  border-radius: 6px;
  background: #ffffff;
}
.metrics span { color: #64706b; font-size: 12px; }
.metrics strong { align-self: end; font-size: 25px; font-weight: 650; }
.metrics small { margin-top: 3px; color: #87908d; font-size: 11px; }

.content-section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 11px; }
.badge.neutral { background: #ecefed; color: #66716d; }
.badge.healthy { background: #dff1e8; color: #12623f; }
.badge.failed { background: #fae7e5; color: #963b34; }

.table-wrap { overflow: auto; border-top: 1px solid #dce2df; background: #ffffff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { height: 44px; padding: 0 12px; border-bottom: 1px solid #e6eae8; text-align: left; white-space: nowrap; }
th { color: #6b7672; background: #f4f6f5; font-weight: 600; }
td { color: #2c3632; }
td.empty { height: 92px; color: #87908d; text-align: center; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid #d7ddda;
  border-radius: 5px;
  background: #ffffff;
  color: #28322e;
  box-shadow: 0 8px 26px rgb(23 35 30 / 12%);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; display: block; height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #dfe4e2; }
  .brand { display: inline-flex; }
  nav { display: flex; margin-top: 10px; overflow-x: auto; }
  .nav-item { flex: none; }
  .local-status { position: absolute; top: 15px; right: 14px; width: auto; margin: 0; padding: 0; border: 0; }
  main { padding: 24px 18px 44px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .local-status div { display: none; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; }
  .actions button { flex: 1; min-width: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { min-height: 96px; }
}
