:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --muted: #777;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --accent: #00d4aa;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { width: 100%; height: 100%; }
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 70px;
}
header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin: 0;
}
header .meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  width: 100%;
  height: 100%;
}
aside {
  width: 220px;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  flex-grow: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: block;
}
.sidebar-search input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
}
.sidebar-search input:focus {
  border-color: var(--accent);
}
.sidebar-search input::placeholder {
  color: var(--muted);
}
#siteList {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
}
.site-item {
  padding: 11px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  display: block;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.site-item:hover {
  background: var(--surface2);
}
.site-item.active {
  background: var(--surface2);
  border-left-color: var(--accent);
  color: var(--accent);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.status-dot.ok { background: var(--green); }
.status-dot.degraded { background: var(--amber); }
.status-dot.warning { background: var(--amber); }
.status-dot.error { background: var(--red); }
main {
  flex: 1;
  flex-grow: 1;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 24px 28px;
  width: 100%;
}
.dashboard-header {
  margin-bottom: 28px;
}
.dashboard-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.region-tag {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}
.card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px 0;
  line-height: 1.4;
}
.stat-row {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  justify-content: center;
  align-items: flex-start;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.stat-val {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  display: block;
}
.stat-lbl {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  letter-spacing: 0.4px;
  text-transform: capitalize;
}
.stat-green { color: var(--green); }
.stat-red { color: var(--red); }
.stat-amber { color: var(--amber); }
.pbar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 10px 0;
  overflow: hidden;
}
.pbar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.loading {
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}
