:root {
  --sidebar-w: 250px; --sidebar-bg: #0d1117; --sidebar-border: #21262d;
  --sidebar-text: #8b949e; --sidebar-active: #fff; --sidebar-hover-bg: #161b22;
  --topbar-h: 60px; --accent: #4f46e5; --accent-soft: rgba(79,70,229,.12);
  --online: #22c55e; --offline: #ef4444; --unknown: #94a3b8;
  --surface: #fff; --page-bg: #f0f2f5;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08); --radius: 10px;
}
* { box-sizing: border-box; }
body { margin:0; font-family:'Inter','Segoe UI',system-ui,sans-serif; background:var(--page-bg); color:#1e293b; min-height:100vh; }

#sidebar { position:fixed; top:0; left:0; width:var(--sidebar-w); height:100vh; background:var(--sidebar-bg); border-right:1px solid var(--sidebar-border); display:flex; flex-direction:column; z-index:100; overflow:hidden; }
.sidebar-logo { height:var(--topbar-h); display:flex; align-items:center; gap:10px; padding:0 20px; border-bottom:1px solid var(--sidebar-border); flex-shrink:0; }
.sidebar-logo .logo-icon { width:32px; height:32px; background:var(--accent); border-radius:8px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:14px; flex-shrink:0; }
.sidebar-logo .logo-text { color:#fff; font-weight:700; font-size:18px; }
.sidebar-nav { flex:1; overflow-y:auto; padding:12px 0; }
.nav-section-label { font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:#484f58; padding:16px 20px 6px; display:block; }
.nav-link { display:flex; align-items:center; gap:10px; padding:9px 20px; color:var(--sidebar-text); text-decoration:none; font-size:13.5px; font-weight:500; transition:background .15s,color .15s; white-space:nowrap; }
.nav-link:hover { background:var(--sidebar-hover-bg); color:var(--sidebar-active); }
.nav-link.active { background:var(--accent-soft); color:var(--accent); border-right:3px solid var(--accent); }
.nav-link i { width:18px; text-align:center; font-size:15px; }
.sidebar-footer { border-top:1px solid var(--sidebar-border); padding:12px 16px; flex-shrink:0; }
.user-chip { display:flex; align-items:center; gap:10px; padding:8px; color:var(--sidebar-text); font-size:13px; }
.user-chip .avatar { width:32px; height:32px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }
.user-chip .user-info .name { color:#e6edf3; font-weight:600; line-height:1.2; }
.user-chip .user-info .role { font-size:11px; color:#484f58; }
.user-chip .logout-btn { margin-left:auto; color:var(--sidebar-text); text-decoration:none; font-size:15px; transition:color .15s; }
.user-chip .logout-btn:hover { color:var(--offline); }

#main { margin-left:var(--sidebar-w); min-height:100vh; display:flex; flex-direction:column; }
.topbar { height:var(--topbar-h); background:var(--surface); border-bottom:1px solid #e2e8f0; display:flex; align-items:center; padding:0 28px; gap:16px; position:sticky; top:0; z-index:50; }
.topbar-title { font-size:17px; font-weight:700; color:#0f172a; flex:1; }
.page-content { padding:28px; flex:1; }

.status-dot { width:12px; height:12px; border-radius:50%; display:inline-block; flex-shrink:0; }
.status-dot.online  { background:var(--online);  box-shadow:0 0 0 3px rgba(34,197,94,.2); }
.status-dot.offline { background:var(--offline); box-shadow:0 0 0 3px rgba(239,68,68,.2); }
.status-dot.unknown { background:var(--unknown); }
.status-dot.online.pulse { animation:pulse-online 2s infinite; }
@keyframes pulse-online { 0%,100%{box-shadow:0 0 0 3px rgba(34,197,94,.2)}50%{box-shadow:0 0 0 6px rgba(34,197,94,.05)} }

.server-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.server-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--card-shadow); padding:18px 20px; border:1px solid #e2e8f0; position:relative; transition:box-shadow .2s,transform .2s; }
.server-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.12); transform:translateY(-1px); }
.server-card.is-offline { border-left:3px solid var(--offline); }
.server-card.is-online  { border-left:3px solid var(--online); }
.server-card.is-unknown { border-left:3px solid var(--unknown); }
.card-header-row { display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; }
.card-title { font-weight:700; font-size:15px; color:#0f172a; line-height:1.3; }
.card-host  { font-size:12px; color:#64748b; font-family:monospace; }
.card-meta  { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.badge-group { font-size:11px; font-weight:600; padding:3px 8px; border-radius:20px; color:#fff; }
.badge-type  { font-size:11px; padding:3px 8px; border-radius:20px; background:#f1f5f9; color:#475569; font-weight:500; }
.card-footer-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.card-timing { font-size:11px; color:#94a3b8; line-height:1.4; }
.card-actions { display:flex; gap:6px; }

.btn-restart { display:inline-flex; align-items:center; gap:5px; padding:6px 12px; background:#f8f9fa; border:1px solid #dee2e6; border-radius:6px; font-size:12px; font-weight:600; color:#374151; cursor:pointer; transition:all .15s; }
.btn-restart:hover { background:#fff3cd; border-color:#f59e0b; color:#92400e; }
.btn-proxmox { display:inline-flex; align-items:center; gap:5px; padding:6px 12px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:6px; font-size:12px; font-weight:600; color:#1d4ed8; cursor:pointer; transition:all .15s; }
.btn-proxmox:hover { background:#dbeafe; }

.filter-bar { display:flex; gap:8px; flex-wrap:wrap; }
.filter-chip { padding:5px 14px; border-radius:20px; border:1.5px solid #e2e8f0; background:#fff; font-size:12.5px; font-weight:600; color:#475569; cursor:pointer; transition:all .15s; user-select:none; }
.filter-chip:hover { border-color:var(--accent); color:var(--accent); }
.filter-chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.search-wrap { position:relative; max-width:320px; }
.search-wrap i { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:#94a3b8; font-size:14px; }
.search-input { width:100%; padding:8px 12px 8px 34px; border:1.5px solid #e2e8f0; border-radius:8px; font-size:13.5px; outline:none; transition:border-color .15s; background:#fff; }
.search-input:focus { border-color:var(--accent); }

.stat-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--card-shadow); padding:20px 24px; border:1px solid #e2e8f0; display:flex; align-items:center; gap:16px; }
.stat-icon { width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-number { font-size:26px; font-weight:800; line-height:1; }
.stat-label  { font-size:12px; color:#64748b; font-weight:500; margin-top:3px; }

.uno-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.uno-table th { background:#f8fafc; padding:11px 14px; text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:#64748b; border-bottom:1px solid #e2e8f0; }
.uno-table td { padding:12px 14px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.uno-table tbody tr:hover { background:#fafbfc; }
.uno-table .actions { display:flex; gap:6px; }

.section-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--card-shadow); border:1px solid #e2e8f0; overflow:hidden; }
.section-card-header { padding:14px 20px; border-bottom:1px solid #e2e8f0; display:flex; align-items:center; justify-content:space-between; font-weight:700; font-size:14px; }
.section-card-body { padding:20px; }
.empty-state { text-align:center; padding:48px 20px; color:#94a3b8; }

.modal-content { border-radius:var(--radius); border:none; box-shadow:0 20px 60px rgba(0,0,0,.2); }

.step-indicator { display:flex; margin-bottom:24px; }
.step { flex:1; text-align:center; padding:8px; font-size:12px; font-weight:600; color:#94a3b8; border-bottom:2px solid #e2e8f0; }
.step.active { color:var(--accent); border-color:var(--accent); }
.step.done   { color:var(--online); border-color:var(--online); }
.vm-list-item { display:flex; align-items:center; gap:12px; padding:10px 14px; border:1.5px solid #e2e8f0; border-radius:8px; margin-bottom:8px; cursor:pointer; transition:all .15s; }
.vm-list-item:hover,.vm-list-item.selected { border-color:var(--accent); background:var(--accent-soft); }
.vm-name { font-weight:600; font-size:14px; }
.vm-vmid { font-size:11px; color:#94a3b8; font-family:monospace; }
.vm-status-badge { margin-left:auto; font-size:11px; font-weight:600; padding:2px 8px; border-radius:12px; }
.vm-status-badge.running { background:rgba(34,197,94,.15); color:#15803d; }
.vm-status-badge.stopped { background:rgba(239,68,68,.15); color:#b91c1c; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0d1117 0%,#161b22 100%); }
.login-card { background:#161b22; border:1px solid #30363d; border-radius:14px; padding:40px 36px; width:100%; max-width:380px; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.login-logo { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:28px; }
.login-logo .logo-box { width:44px; height:44px; background:var(--accent); border-radius:10px; display:flex; align-items:center; justify-content:center; font-weight:900; font-size:18px; color:#fff; }
.login-logo .logo-name { font-size:26px; font-weight:800; color:#e6edf3; }
.login-subtitle { text-align:center; color:#8b949e; font-size:13px; margin-bottom:28px; }
.login-label { display:block; color:#8b949e; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px; }
.login-input { width:100%; padding:10px 14px; background:#0d1117; border:1px solid #30363d; border-radius:8px; color:#e6edf3; font-size:14px; outline:none; transition:border-color .15s; }
.login-input:focus { border-color:var(--accent); }
.login-btn { width:100%; padding:11px; background:var(--accent); border:none; border-radius:8px; color:#fff; font-size:14px; font-weight:700; cursor:pointer; transition:background .15s; }
.login-btn:hover { background:#4338ca; }
