@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

:root {
  --bg: #041525;
  --bg-card: rgba(10, 35, 58, 0.85);
  --border: rgba(45, 212, 191, 0.18);
  --text: #e8f4ff;
  --muted: #7eb8d4;
  --accent: #2dd4bf;
  --gold: #ffd166;
  --gold-dim: #c9a227;
  --green: #4ade80;
  --red: #f87171;
  --sidebar: rgba(4, 21, 37, 0.95);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "Segoe UI", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(26, 95, 122, 0.4), transparent),
    linear-gradient(180deg, #041525 0%, #062a40 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--red); font-size: 0.875rem; margin-top: 8px; }
.success { color: var(--green); font-size: 0.875rem; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
.sidebar .brand {
  padding: 24px 20px 8px;
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #fff8e0, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar .brand-sub {
  padding: 0 20px 16px;
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--border);
}
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 13px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar nav button.active {
  background: rgba(45, 212, 191, 0.08);
  color: var(--gold);
  border-left-color: var(--gold);
}
.sidebar nav button:hover:not(.active) {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.sidebar .user-box {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}
.main { flex: 1; padding: 28px 32px; overflow: auto; }
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page h2 {
  margin: 0 0 24px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, border-color 0.2s;
}
.stat:hover { transform: translateY(-2px); border-color: rgba(255,209,102,0.3); }
.stat .num { font-size: 2rem; font-weight: 900; color: var(--gold); }
.stat .label { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.grid2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .sidebar { width: 200px; } }

label { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(4, 21, 37, 0.7);
  color: #fff;
  margin-bottom: 12px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}
.url-row { display: flex; gap: 10px; margin-bottom: 12px; }
.url-row select { width: 110px; flex-shrink: 0; margin-bottom: 0; }
.url-row input { flex: 1; margin-bottom: 0; }
textarea { min-height: 100px; resize: vertical; font-family: inherit; }

table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255,255,255,0.02); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.off { background: #64748b; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  background: rgba(255,255,255,0.08);
}
.badge.running { background: rgba(45,212,191,0.15); color: var(--accent); }
.badge.completed { background: rgba(74,222,128,0.15); color: var(--green); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: -6px; margin-bottom: 12px; }
code { background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 6px; font-size: 0.8125rem; color: var(--gold); }
