:root {
  --bg: #0b0f15;
  --bg-2: #111826;
  --bg-3: #162033;
  --border: #22324b;
  --text: #e6edf3;
  --muted: #8a97a8;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --chip: #1b2840;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.layout { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.brand { font-weight: 700; font-size: 16px; color: #fff; display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-item { padding: 9px 12px; border-radius: 8px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: #fff; }
.main { overflow: auto; padding: 22px 26px; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.header h1 { font-size: 20px; margin: 0; }
.header .user { color: var(--muted); font-size: 13px; }

.btn { background: var(--accent); color: #fff; border: 0; padding: 9px 14px; border-radius: 8px; font-weight: 600; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--err); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }

input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; } }

.server-card { display: flex; flex-direction: column; gap: 10px; }
.server-card .row { display: flex; align-items: center; justify-content: space-between; }
.server-card h3 { margin: 0; font-size: 15px; }
.meta { color: var(--muted); font-size: 12px; }
.chip { display: inline-block; padding: 3px 8px; background: var(--chip); border-radius: 999px; font-size: 11px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.table th { color: var(--muted); font-weight: 600; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 80; }
.modal-bg.open { display: flex; }
.modal { width: min(560px, 92vw); max-height: 90vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.modal h2 { margin: 0 0 14px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; margin-bottom: 5px; color: var(--muted); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #1b2840, #0b0f15); }
.login .card { width: min(380px, 92vw); }
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login p { color: var(--muted); margin: 0 0 18px; }

.term-wrap { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 0px); }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 6px; flex: 1; overflow: auto; }
.tab { display: flex; align-items: center; gap: 6px; background: var(--bg-3); padding: 6px 10px; border-radius: 8px 8px 0 0; border: 1px solid var(--border); border-bottom: 0; font-size: 12px; cursor: pointer; }
.tab.active { background: #0b1220; border-color: var(--accent); }
.tab .x { color: var(--muted); margin-left: 4px; }
.term-host { background: #000; height: 100%; }
.term-pane { display: none; height: 100%; }
.term-pane.active { display: block; }

.stat { background: var(--bg-3); padding: 12px 14px; border-radius: 10px; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; }

.toast { position: fixed; bottom: 16px; right: 16px; background: var(--bg-3); border: 1px solid var(--border); padding: 10px 14px; border-radius: 8px; z-index: 99; display: none; }
.toast.show { display: block; }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--err); }

.log-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; color: #cbd5e1; border-bottom: 1px dashed var(--border); padding: 6px 0; }

.empty { color: var(--muted); text-align: center; padding: 40px 20px; }

.split { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
