* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
header { background: #1e293b; padding: 1rem 0; border-bottom: 1px solid #334155; }
header .container { display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 1.5rem; color: #38bdf8; }
header nav a { color: #94a3b8; text-decoration: none; margin-left: 1.5rem; transition: color 0.2s; }
header nav a:hover, header nav a.active { color: #38bdf8; }
main { padding: 2rem 0; }
footer { background: #1e293b; padding: 1rem 0; margin-top: 2rem; border-top: 1px solid #334155; text-align: center; color: #64748b; }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.node-card { background: #1e293b; border-radius: 8px; padding: 1.25rem; border: 1px solid #334155; transition: border-color 0.2s; }
.node-card:hover { border-color: #38bdf8; }
.node-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.node-name { font-weight: 600; font-size: 1.1rem; }
.node-region { font-size: 1.25rem; margin-left: 0.5rem; }
.status { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.status.online { background: #064e3b; color: #34d399; }
.status.offline { background: #450a0a; color: #f87171; }
.status.loading { background: #1e293b; color: #64748b; }
.node-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.stat { text-align: center; }
.stat-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.1rem; font-weight: 600; }
.stat-bar { height: 4px; background: #334155; border-radius: 2px; margin-top: 0.25rem; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.stat-bar-fill.cpu { background: #38bdf8; }
.stat-bar-fill.ram { background: #a78bfa; }
.stat-bar-fill.disk { background: #fbbf24; }
.node-meta { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #334155; display: flex; justify-content: space-between; font-size: 0.8rem; color: #64748b; }
.loading { text-align: center; padding: 3rem; color: #64748b; }
.login-container { max-width: 400px; margin: 4rem auto; background: #1e293b; padding: 2rem; border-radius: 8px; border: 1px solid #334155; }
.login-container h2 { text-align: center; margin-bottom: 1.5rem; color: #38bdf8; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: #94a3b8; font-size: 0.9rem; }
.form-group input, .form-group select { width: 100%; padding: 0.75rem; background: #0f172a; border: 1px solid #334155; border-radius: 6px; color: #e2e8f0; font-size: 1rem; }
.form-group input:focus { outline: none; border-color: #38bdf8; }
button { padding: 0.75rem 1.5rem; background: #38bdf8; color: #0f172a; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
button:hover { background: #0ea5e9; }
.btn-primary { background: #38bdf8; }
.btn-edit { background: #a78bfa; color: #0f172a; padding: 0.4rem 0.8rem; font-size: 0.85rem; margin-right: 0.5rem; }
.btn-delete { background: #f87171; color: #0f172a; padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-run { background: #34d399; color: #0f172a; padding: 0.4rem 0.8rem; font-size: 0.85rem; margin-right: 0.5rem; }
.error { color: #f87171; margin-top: 0.5rem; }
.success { color: #34d399; margin-top: 0.5rem; }
.form-card { background: #1e293b; padding: 1.5rem; border-radius: 8px; border: 1px solid #334155; margin: 1rem 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.form-actions button[type="button"] { background: #334155; color: #e2e8f0; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #334155; }
th { color: #94a3b8; font-weight: 500; font-size: 0.85rem; text-transform: uppercase; }
td { font-size: 0.9rem; }
#node-token-display { margin-top: 1rem; padding: 1rem; background: #0f172a; border-radius: 6px; }
#node-token-display code { display: block; margin-top: 0.5rem; padding: 0.5rem; background: #1e293b; border-radius: 4px; word-break: break-all; font-size: 0.85rem; }
#admin-panel { background: #1a1a2e; border: 1px solid #334155; border-radius: 8px; padding: 1.5rem; margin-bottom: 2rem; }
#admin-panel h2 { color: #38bdf8; margin-bottom: 1rem; }
@media (max-width: 640px) {
  .node-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  header .container { flex-direction: column; gap: 0.5rem; }
}