:root {
  --bg: #0f1420;
  --panel: #171e2e;
  --border: #262f45;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
}
* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

.login-screen { min-height:100vh; display:flex; align-items:center; justify-content:center; background: var(--bg); }
.login-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
}
.login-box h1 {
  margin: 0 0 4px;
  color: #1a1f2e;
  font-size: 22px;
  font-weight: 700;
}
.login-box .subtitle {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 24px;
}
.login-box .field-label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.login-box input {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 16px;
  background: #eef1f6;
  border: 1px solid #e2e5eb;
  border-radius: 8px;
  color: #1a1f2e;
  font-size: 14px;
}
.login-box input::placeholder { color: #9aa1ae; }
.login-box button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
}
.login-box button:hover { background: #2f6fe0; }
.error { color: var(--red); font-size: 13px; margin-top: 10px; }

.topbar { display:flex; align-items:center; gap:24px; padding:14px 24px; background: var(--panel); border-bottom:1px solid var(--border); }
.brand { font-weight:700; font-size:18px; display:flex; align-items:center; gap:10px; }
.brand-logo { width:28px; height:28px; object-fit:contain; }
nav { display:flex; gap:8px; flex:1; }
.nav-btn { background:none; border:none; color:var(--muted); padding:8px 14px; border-radius:6px; cursor:pointer; font-size:14px; }
.nav-btn.active, .nav-btn:hover { background:var(--border); color:var(--text); }
.logout-btn { background:none; border:1px solid var(--border); color:var(--muted); padding:6px 14px; border-radius:6px; cursor:pointer; }

main { padding:24px; max-width:1200px; margin:0 auto; }
.view { display:none; }
.view.active { display:block; }

.cards { display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; margin-bottom:24px; }
.card { background: var(--panel); border:1px solid var(--border); border-radius:10px; padding:20px; display:flex; flex-direction:column; }
.card-value { font-size:32px; font-weight:700; }
.card-label { color: var(--muted); font-size:13px; margin-top:4px; }
.card.online .card-value { color: var(--green); }
.card.offline .card-value { color: var(--red); }
.card.alert .card-value { color: var(--yellow); }

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

.table { width:100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align:left; color:var(--muted); font-weight:600; padding:10px; border-bottom:1px solid var(--border); }
.table td { padding:10px; border-bottom:1px solid var(--border); }
.status-badge { padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.status-online { background: rgba(34,197,94,0.15); color: var(--green); }
.status-offline { background: rgba(239,68,68,0.15); color: var(--red); }
.status-unknown { background: rgba(139,147,167,0.15); color: var(--muted); }

.btn-primary { background: var(--accent); color:white; border:none; padding:8px 16px; border-radius:6px; cursor:pointer; font-weight:600; }
.btn-icon { background:none; border:none; color:var(--muted); cursor:pointer; margin-right:8px; }
.btn-icon:hover { color: var(--text); }

.modal { position:fixed; inset:0; background:rgba(0,0,0,0.6); display:flex; align-items:center; justify-content:center; }
.modal-box { background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:24px; width:380px; max-height:90vh; overflow-y:auto; }
.modal-box label { display:block; margin-bottom:10px; font-size:13px; color:var(--muted); }
.modal-box input[type=text], .modal-box input[type=password], .modal-box input[type=number] {
  width:100%; padding:8px; margin-top:4px; background:#0f1420; border:1px solid var(--border); border-radius:6px; color:var(--text);
}
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.modal-actions button { padding:8px 16px; border-radius:6px; cursor:pointer; }
.modal-actions button[type=button] { background:none; border:1px solid var(--border); color:var(--text); }
