:root {
  --bg: #0e1116;
  --bg-soft: #161b22;
  --bg-card: #171d26;
  --line: #262d38;
  --text: #e6edf3;
  --muted: #8b97a6;
  --accent: #3fb950;
  --accent-dim: #2ea043;
  --danger: #f85149;
  --warn: #d29922;
  --info: #58a6ff;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

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

/* ---------------------------------------------------------------- layout */

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
nav .brand { font-weight: 700; letter-spacing: .5px; color: var(--accent); }
nav .brand span { color: var(--muted); font-weight: 400; font-size: 12px; }
nav a.tab { color: var(--muted); padding: 4px 2px; border-bottom: 2px solid transparent; }
nav a.tab.active, nav a.tab:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
nav .spacer { flex: 1; }
nav .who { color: var(--muted); font-size: 13px; }
nav .who b { color: var(--text); }

main { max-width: 1200px; margin: 0 auto; padding: 24px 22px 60px; }

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
p.sub { color: var(--muted); margin: 0 0 22px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.bot-card h3 { margin: 0; font-size: 16px; }
.bot-card .meta { color: var(--muted); font-size: 12.5px; margin: 6px 0 12px; }
.bot-card .meta div { margin-top: 2px; }

/* ---------------------------------------------------------------- status */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: #21262d; color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.online { color: var(--accent); border-color: #1f6f2d; }
.badge.online .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge.conectando, .badge.autenticando { color: var(--warn); border-color: #6b5115; }
.badge.conectando .dot, .badge.autenticando .dot { background: var(--warn); }
.badge.morto { color: var(--danger); border-color: #6b2320; }
.badge.morto .dot { background: var(--danger); }

/* --------------------------------------------------------------- botões */

button, .btn {
  font: inherit; cursor: pointer;
  background: #21262d; color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 13px; transition: .12s;
}
button:hover, .btn:hover { border-color: #3d4753; background: #2a313a; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #04140a; font-weight: 600; }
button.primary:hover { background: var(--accent); border-color: var(--accent); }
button.danger { color: var(--danger); border-color: #5c2521; }
button.danger:hover { background: #2d1512; }
button.ghost { background: transparent; }
button.sm { padding: 4px 9px; font-size: 12.5px; }

/* --------------------------------------------------------------- inputs */

label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  font: inherit; width: 100%;
  background: #0d1117; color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* --------------------------------------------------------------- tabelas */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ chat */

.console {
  background: #0a0d12; border: 1px solid var(--line); border-radius: var(--radius);
  height: 62vh; min-height: 340px; overflow-y: auto;
  padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.65;
}
.console .line { display: flex; gap: 8px; word-break: break-word; }
.console .t { color: #4c5663; flex: none; }
.console .in { color: #d3dae3; }
.console .out { color: var(--accent); }
.console .sys { color: var(--info); font-style: italic; }

.stat { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.stat:last-child { border-bottom: none; }
.stat span { color: var(--muted); }

.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- outros */

.pill { font-size: 11.5px; background: #21262d; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); }

#toast {
  position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
#toast div {
  background: var(--bg-card); border: 1px solid var(--line); border-left: 3px solid var(--info);
  padding: 10px 14px; border-radius: 7px; max-width: 340px; animation: slide .18s ease;
}
#toast div.err { border-left-color: var(--danger); }
#toast div.ok { border-left-color: var(--accent); }
@keyframes slide { from { opacity: 0; transform: translateX(12px); } }

.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-wrap .card { width: 100%; max-width: 360px; }
.login-wrap h1 { color: var(--accent); text-align: center; }
.login-wrap p.sub { text-align: center; }

.checks { display: grid; gap: 6px; max-height: 160px; overflow-y: auto; }
.checks label { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 0; font-size: 13px; }
.checks input { width: auto; }
