:root {
	--bg: #0e1116;
	--panel: #171c24;
	--border: #2a323d;
	--text: #e6edf3;
	--muted: #8b97a6;
	--accent: #3b82f6;
	--ok: #22c55e;
	--off: #6b7280;
	--danger: #ef4444;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.45;
}

header.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
}

header.topbar h1 { font-size: 18px; margin: 0; }
header.topbar a { color: var(--accent); text-decoration: none; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

button {
	background: var(--accent);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 14px;
	cursor: pointer;
}
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
button:disabled { opacity: .5; cursor: not-allowed; }

input {
	width: 100%;
	padding: 11px 12px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 18px;
}

.login-card { max-width: 360px; margin: 80px auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.robot-card { cursor: pointer; transition: border-color .15s; }
.robot-card:hover { border-color: var(--accent); }
.robot-card h3 { margin: 0 0 8px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.off { background: var(--off); }

.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }

.feed { width: 100%; background: #000; border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 4 / 3; object-fit: contain; }
.feed-wrap { position: relative; }
.feed-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); }
.tag.attack, .tag.critical { color: var(--danger); border-color: var(--danger); }
.tag.warning { color: #f59e0b; border-color: #f59e0b; }

.cmd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --- app shell (sidebar nav) --- */
.app { display: flex; min-height: 100vh; }
.sidebar {
	width: 210px;
	flex-shrink: 0;
	background: var(--panel);
	border-right: 1px solid var(--border);
	padding: 14px 0;
	position: sticky;
	top: 0;
	height: 100vh;
}
.sidebar .brand { font-weight: 700; padding: 6px 20px 16px; font-size: 16px; }
.sidebar .nav-item {
	display: block;
	padding: 11px 20px;
	color: var(--muted);
	text-decoration: none;
	border-left: 3px solid transparent;
}
.sidebar .nav-item:hover { color: var(--text); background: var(--bg); }
.sidebar .nav-item.active { color: var(--text); border-left-color: var(--accent); background: var(--bg); }
.app-main { flex: 1; min-width: 0; }
.app-main .topbar { justify-content: flex-end; gap: 14px; }
.app-content { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

.stat { font-size: 28px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
	.app { flex-direction: column; }
	.sidebar { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; padding: 6px; }
	.sidebar .brand { display: none; }
	.sidebar .nav-item { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
	.sidebar .nav-item.active { border-left: 0; border-bottom-color: var(--accent); }
}
