:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #222633;
  --border: #2a2e3d;
  --text: #e4e4e7;
  --text-dim: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #22c55e;
  --green-bg: rgba(34,197,94,0.12);
  --yellow: #eab308;
  --yellow-bg: rgba(234,179,8,0.12);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59,130,246,0.12);
  --purple: #a855f7;
  --purple-bg: rgba(168,85,247,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo h1 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.sidebar-logo span { font-size: 12px; color: var(--text-dim); display: block; margin-top: 4px; }

.sidebar nav { padding: 0 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; color: var(--text-dim); text-decoration: none;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
}
.sidebar nav a:hover { background: var(--bg-card-hover); color: var(--text); }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a .icon { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 12px; border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: block; padding: 8px 12px; color: var(--text-dim);
  text-decoration: none; font-size: 13px; border-radius: 8px; transition: all 0.15s;
}
.sidebar-footer a:hover { background: var(--red-bg); color: var(--red); }

.main { margin-left: 240px; flex: 1; padding: 32px; max-width: 1200px; }

.page-header { margin-bottom: 28px; }
.page-header h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.page-header p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; transition: border-color 0.15s;
}
.card:hover { border-color: #3a3f52; }
.card-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 8px;
}
.card-value { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.badge-online { background: var(--green-bg); color: var(--green); }
.badge-online::before { background: var(--green); }
.badge-ssl { background: var(--blue-bg); color: var(--blue); }
.badge-ssl::before { background: var(--blue); }
.badge-stopped { background: var(--red-bg); color: var(--red); }
.badge-stopped::before { background: var(--red); }
.badge-warning { background: var(--yellow-bg); color: var(--yellow); }
.badge-warning::before { background: var(--yellow); }

.table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 24px;
}
.table-wrap h3 {
  padding: 16px 20px; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
td { padding: 14px 20px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

code {
  background: #0d0f14; padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}

.log-box {
  background: #0d0f14; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap;
  color: var(--text-dim); max-height: 500px; overflow-y: auto;
}

.progress-bar {
  height: 8px; background: var(--border); border-radius: 4px;
  overflow: hidden; margin-top: 8px;
}
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.progress-green { background: var(--green); }
.progress-yellow { background: var(--yellow); }
.progress-red { background: var(--red); }

.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-box p { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.login-box input[type="password"] {
  width: 100%; padding: 12px 14px; background: #0d0f14;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 15px; margin-bottom: 16px;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button {
  width: 100%; padding: 12px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.login-box button:hover { background: var(--accent-hover); }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 12px; }

.section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin: 24px 0 12px; padding-left: 12px;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
