:root {
  --bg: #0f1419;
  --panel: #171d26;
  --panel-alt: #1e2530;
  --border: #2a3341;
  --text: #e6ebf1;
  --text-dim: #8a96a8;
  --accent: #4a90e2;
  --accent-dim: #1c2f4a;
  --up: #3ecf8e;
  --down: #ff5470;
  --unknown: #6b7688;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0 20px 20px;
  letter-spacing: -0.02em;
}
.sidebar .brand span { color: var(--accent); }

.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
  color: var(--text);
  background: var(--panel-alt);
  border-left-color: var(--accent);
  text-decoration: none;
}

.main { flex: 1; padding: 32px 40px; max-width: 1200px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
}
.topbar h1 { font-size: 1.4rem; margin: 0; font-weight: 600; }
.topbar .user-chip {
  font-size: 0.85rem; color: var(--text-dim);
}

.cards { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  min-width: 150px;
}
.card .value { font-size: 1.8rem; font-weight: 700; }
.card .label { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.card.up .value { color: var(--up); }
.card.down .value { color: var(--down); }
a.card { display: block; text-decoration: none; transition: border-color 0.15s; }
a.card:hover { border-color: var(--accent); text-decoration: none; }

table {
  width: 100%; border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel-alt); }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px;
}
.status-dot.up { background: var(--up); }
.status-dot.down { background: var(--down); }
.status-dot.desconhecido { background: var(--unknown); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #0a1420;
  padding: 9px 18px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.small { padding: 5px 12px; font-size: 0.8rem; }

.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.section-header h2 { font-size: 1.05rem; margin: 0; font-weight: 600; }

form.stacked label {
  display: block; font-size: 0.85rem; color: var(--text-dim); margin: 14px 0 5px;
}
form.stacked input, form.stacked select, form.stacked textarea {
  width: 100%; padding: 9px 12px;
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 0.9rem;
}
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus {
  outline: none; border-color: var(--accent);
}

.flash { padding: 10px 16px; border-radius: 7px; margin-bottom: 16px; font-size: 0.88rem; }
.flash.success { background: #123527; color: var(--up); border: 1px solid #1e5a3f; }
.flash.error { background: #3a1420; color: var(--down); border: 1px solid #5c1f30; }
.flash.info { background: #1a2635; color: #7fb3e8; border: 1px solid #2a4260; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; width: 340px;
}
.login-box h1 { text-align: center; margin-bottom: 24px; font-size: 1.3rem; }

.empty-state { color: var(--text-dim); padding: 24px; text-align: center; font-size: 0.9rem; }

.badge { font-size: 0.75rem; padding: 3px 8px; border-radius: 5px; background: var(--panel-alt); color: var(--text-dim); }
