:root {
  --bg: #0f1420;
  --panel: #161d2e;
  --panel-2: #1e2740;
  --border: #2a3350;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #4f7cff;
  --green: #2ecc71;
  --red: #e74c3c;
  --yellow: #f1c40f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.brand-logo { height: 63px; width: auto; display: block; }
.login-logo { display: block; max-width: 240px; width: 100%; height: auto; margin: 0 auto 20px; }
.topbar nav a { margin-left: 18px; color: var(--muted); font-size: 16px; }
.topbar nav a:hover { color: var(--text); }
.topbar .muted { font-size: 14px; }
.topbar .btn.small { font-size: 13px; padding: 6px 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px; border: none;
  background: var(--accent); color: white; cursor: pointer; font-size: 14px;
}
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--red); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; margin-bottom: 14px;
}
.stat-tiles { display: flex; gap: 12px; margin-bottom: 20px; }
.stat-tile {
  flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; text-decoration: none; display: block; transition: border-color .15s;
}
.stat-tile:hover { border-color: var(--accent); }
.stat-tile.active { border-color: var(--accent); }
.stat-tile-label {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.stat-tile-value { font-size: 32px; font-weight: 700; margin-top: 6px; color: var(--text); }
.stat-tile-value.up { color: var(--green); }
.stat-tile-value.down { color: var(--red); }
.stat-tile-value.pending { color: var(--muted); }
.monitor-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px 150px; align-items: center; gap: 16px;
  padding: 14px; border-bottom: 1px solid var(--border);
}
.monitor-row:last-child { border-bottom: none; }
.monitor-info { min-width: 0; }
.monitor-info .monitor-name, .monitor-info .monitor-meta {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.monitor-stats { text-align: right; min-width: 0; }
.monitor-chart { display: flex; justify-content: flex-end; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.status-up { background: var(--green); }
.status-down { background: var(--red); }
.status-pending { background: var(--yellow); }
.muted { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
form .field { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 14px;
}
textarea { font-family: monospace; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }
.info-row { display: flex; flex-wrap: wrap; gap: 10px 40px; }
.info-row > div { flex: 0 0 auto; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error-box { background: #3a1f24; border: 1px solid var(--red); color: #ffb4b4; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #14351f; color: var(--green); }
.badge.warn { background: #3a3315; color: var(--yellow); }
tr:target { background: var(--panel-2); outline: 1px solid var(--yellow); }
.badge.error { background: #3a1f24; color: var(--red); }
.codes-grid { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.codes-grid label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-bottom: 8px; color: var(--text); }
.meta-row, .header-row { display: flex; gap: 10px; margin-bottom: 8px; }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 360px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }

.rt-chart-wrap { position: relative; }
.rt-chart-sparkline { display: flex; align-items: center; justify-content: center; }
.rt-svg { display: block; }
.rt-grid-line { stroke: var(--border); stroke-width: 1; }
.rt-grid-label { fill: var(--muted); font-size: 10px; }
.rt-crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.rt-hover-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.rt-hover-target { cursor: crosshair; }
.rt-x-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.rt-tooltip {
  position: absolute; top: 6px; background: var(--panel-2); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 4px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 5;
}
.rt-stats { display: flex; gap: 24px; margin-top: 14px; }
.rt-stats > div { font-size: 14px; }
.rt-stat-min { color: var(--green); }
.rt-stat-max { color: var(--red); }
.rt-chart-notice {
  background: #3a3315; color: var(--yellow); border-radius: 6px;
  padding: 8px 12px; font-size: 13px; margin-top: 10px;
}
.chart-range-select { width: auto; }
