:root {
	--accent: #5C67F2;
	--accent-soft: #EEF0FE;
	--accent-hover: #4A55E0;
	--accent-gradient-start: #5C67F2;
	--accent-gradient-end: #6B75F5;
	--bg: #F8F9FB;
	--surface: #FFFFFF;
	--surface-muted: #F1F3F9;
	--border: #E2E8F0;
	--border-light: #EDF2F7;
	--text: #2D3748;
	--text-soft: #718096;
	--text-faint: #A0AEC0;
	--select-bg: #F0F1FE;
	--select-border: #5C67F2;
	--green: #4CAF50;
	--orange: #FFA726;
	--red: #FF5C5C;
	--shadow-sm: 0 1px 2px rgba(45, 55, 72, 0.04), 0 2px 8px rgba(45, 55, 72, 0.05);
	--shadow-md: 0 2px 4px rgba(45, 55, 72, 0.04), 0 8px 24px rgba(45, 55, 72, 0.07);
	--shadow-card: 0 4px 20px rgba(45, 55, 72, 0.06);
	--radius: 12px;
	--radius-lg: 16px;
	--radius-pill: 999px;
	--sidebar-w: 248px;
	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	--fs-base: 15px;
	--fs-sm: 13px;
	--fs-xs: 12px;
	--fs-micro: 11px;
	--fs-title: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
* { scrollbar-width: thin; scrollbar-color: #E2E8F0 transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }
body {
	font-family: var(--font); font-size: var(--fs-base); color: var(--text);
	background: var(--bg); height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased;
}
.app { display: flex; height: 100vh; }
.sidebar {
	width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--surface);
	border-right: 1px solid var(--border-light); display: flex; flex-direction: column;
}
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 12px; }
.logo-mark {
	width: 38px; height: 38px; border-radius: var(--radius);
	background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
	color: #fff; font-weight: 700; font-size: 13px;
	display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.logo-text { font-size: 14px; font-weight: 600; }
.logo-text small { display: block; font-size: var(--fs-micro); font-weight: 400; color: var(--text-faint); margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav-item {
	display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
	cursor: pointer; border: none; background: none; width: 100%; text-align: left;
	font-size: 13px; font-family: inherit; color: #7F8B9B;
}
.nav-item:hover { background: var(--surface-muted); color: var(--text); }
.nav-item.active { background: var(--select-bg); color: var(--text); font-weight: 500; border-left: 3px solid var(--select-border); padding-left: 7px; }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: #94A3B8; }
.nav-item .badge { margin-left: auto; font-size: 10px; color: #94A3B8; }
.nav-divider { height: 1px; background: var(--border-light); margin: 10px 4px; }
.sidebar-bottom { padding: 12px 14px; border-top: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.avatar {
	width: 34px; height: 34px; border-radius: 50%;
	background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
	color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.sidebar-bottom .who { font-size: 13px; font-weight: 600; }
.sidebar-bottom .role { font-size: 11px; color: var(--text-faint); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
	height: 56px; background: var(--surface); border-bottom: 1px solid var(--border-light);
	display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;
}
.topbar h1 { font-size: var(--fs-title); font-weight: 700; flex: 1; letter-spacing: -0.02em; }
.topbar-meta { font-size: var(--fs-sm); color: var(--text-soft); }
.btn {
	border: none; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-family: inherit;
	font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-muted); color: var(--text); }
.btn-danger { background: #FEECEC; color: var(--red); }
.btn-ok { background: #E8F6EA; color: #2E7D32; }
.content { flex: 1; overflow: hidden; position: relative; }
.view { display: none; height: 100%; overflow: auto; padding: 24px; }
.view.active { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-card); }
.kpi-card .label { font-size: var(--fs-micro); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.kpi-card .delta { font-size: 12px; color: var(--green); margin-top: 4px; }
.kpi-card .delta.down { color: var(--red); }
.kpi-card .delta.warn { color: var(--orange); }
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 16px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.card-h h2 { font-size: 14px; font-weight: 600; flex: 1; }
.card-b { padding: 8px 0; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
	border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-family: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.toolbar input { min-width: 220px; }
.toolbar .pill { margin-left: auto; white-space: nowrap; }
.search-box .pill { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); padding: 10px 16px; font-weight: 600; border-bottom: 1px solid var(--border-light); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
tr:hover td { background: var(--surface-muted); }
tr.clickable { cursor: pointer; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); display: inline-block; }
.pill-on { background: #E8F6EA; color: #2E7D32; }
.pill-off { background: #FEECEC; color: var(--red); }
.pill-warn { background: #FFF4E5; color: #E65100; }
.pill-info { background: var(--accent-soft); color: var(--accent); }
.pill-mute { background: var(--surface-muted); color: var(--text-soft); }
.row-actions { display: flex; gap: 6px; }
.row-actions button { font-size: 12px; padding: 5px 8px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 88px; padding: 8px 18px 16px; }
.bars span { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; min-height: 8px; }
.bars span.on { background: var(--accent); }
.act { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.act:last-child { border-bottom: none; }
.act .t { color: var(--text-faint); font-size: 12px; min-width: 72px; }
.drawer-bg { display: none; position: fixed; inset: 0; background: rgba(45,55,72,0.28); z-index: 40; }
.drawer-bg.open { display: block; }
.drawer {
	position: fixed; top: 0; right: 0; width: 420px; max-width: 96vw; height: 100%;
	background: var(--surface); z-index: 50; box-shadow: var(--shadow-md);
	display: none; flex-direction: column;
}
.drawer.open { display: flex; }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; }
.drawer-h h3 { flex: 1; font-size: 16px; }
.drawer-b { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; justify-content: flex-end; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 88px; resize: vertical; }
.toast {
	position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
	background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13px;
	opacity: 0; transition: 0.25s; z-index: 80; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gate {
	position: fixed; inset: 0; background: var(--bg); z-index: 90;
	display: flex; align-items: center; justify-content: center;
}
.gate.gone { display: none; }
.gate-card { background: #fff; width: 380px; padding: 32px; border-radius: 16px; box-shadow: var(--shadow-card); }
.gate-card h1 { font-size: 20px; margin-bottom: 4px; }
.gate-card p { font-size: 13px; color: var(--text-soft); margin-bottom: 20px; }
.login-error {
	display: none;
	color: var(--red);
	font-size: 13px;
	font-weight: 600;
	margin: -8px 0 14px;
}
.btn-busy {
	opacity: 0.85;
	cursor: wait;
}
.login-spinner {
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid rgba(255,255,255,0.35);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: -2px;
	margin-right: 6px;
	animation: loginspin 0.7s linear infinite;
}
@keyframes loginspin {
	to { transform: rotate(360deg); }
}
.note { font-size: 12px; color: var(--text-soft); padding: 0 18px 16px; }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: calc(100vh - 120px); }
.side-list { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: auto; }
.side-list button {
	display: block; width: 100%; text-align: left; padding: 12px 14px; border: none; background: none;
	font-family: inherit; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border-light); color: var(--text);
}
.side-list button:hover, .side-list button.on { background: var(--select-bg); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-muted); padding: 12px; border-radius: 10px; white-space: pre-wrap; }
.search-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 14px; }
.search-box .quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-box .quick input { flex: 1; min-width: 200px; }
.adv { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.adv.open { display: block; }
.srow { display: grid; grid-template-columns: 1fr 140px 1fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.srow select, .srow input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: 13px; }
.cv-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cv-grid { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 10px; min-height: 520px; }
.cv-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cv-panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); flex: 1; display: flex; flex-direction: column; min-height: 180px; overflow: hidden; }
.cv-panel.active { box-shadow: 0 0 0 2px var(--accent); }
.cv-ph { padding: 10px 12px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cv-ph span { font-weight: 400; color: var(--text-faint); font-size: 11px; }
.cv-ph .pill { margin-left: auto; }
.cv-panel table { font-size: 12px; }
.cv-panel td, .cv-panel th { padding: 8px 10px; }
.cv-warn { color: #E65100; }
.issource td { background: #E8F6EA; }
.isselected td { background: var(--select-bg); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; padding: 4px 0 12px; }
.checks label { display: flex; align-items: center; gap: 6px; }
.tl { padding: 8px 0; }
.tl-item { display: grid; grid-template-columns: 88px 14px 1fr; gap: 10px; padding: 0 18px 16px; position: relative; }
.tl-item:before { content: ""; position: absolute; left: 105px; top: 18px; bottom: 0; width: 2px; background: var(--border-light); }
.tl-item:last-child:before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-top: 4px; }
.tl-dot.auth { background: var(--green); }
.tl-dot.ui { background: var(--accent); }
.tl-dot.command { background: var(--orange); }
.tl-dot.pwa { background: #7C4DFF; }
.tl-dot.gap { background: var(--red); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.hint { font-size: 12px; color: var(--text-soft); margin: 0 0 12px; }
@media (max-width: 1100px) {
	.cv-grid, .form-grid, .srow { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
	.grid2, .split { grid-template-columns: 1fr; }
	.sidebar { display: none; }
}
