* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Segoe UI", Arial, sans-serif;
  color: #eef4ff;
  background: #0b1020;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 22px 18px;
  background: linear-gradient(180deg, #101827, #080d18);
  border-right: 1px solid rgba(126, 146, 255, .18);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, #6e5bff, #23d4ff);
}
.brand span { display: block; margin-top: 4px; color: #8ea1c8; font-size: 13px; }
nav { display: grid; gap: 8px; }
nav a, .logout button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  color: #a9b8d8;
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}
nav a.active, nav a:hover, .logout button:hover {
  color: #fff;
  border-color: rgba(72, 213, 255, .28);
  background: rgba(72, 213, 255, .10);
}
.logout { position: absolute; left: 18px; right: 18px; bottom: 20px; }
.main { margin-left: 236px; min-height: 100vh; padding: 24px 30px 60px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: .5px; }
.admin-user { color: #9fb3df; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: rgba(20, 29, 50, .92);
  border: 1px solid rgba(126, 146, 255, .18);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 42px rgba(0,0,0,.24);
}
.card h2, .card h3 { margin: 0 0 16px; }
.stat { font-size: 32px; font-weight: 800; }
.muted { color: #8ea1c8; }
.flash {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: rgba(72, 213, 255, .10); border: 1px solid rgba(72, 213, 255, .22);
}
.flash.error { background: rgba(255, 76, 105, .13); border-color: rgba(255, 76, 105, .28); }
.flash.success { background: rgba(61, 220, 151, .12); border-color: rgba(61, 220, 151, .28); }
label { display: block; margin-bottom: 7px; color: #9fb3df; font-size: 13px; }
input, select, textarea {
  width: 100%;
  color: #f4f8ff;
  background: #0e1526;
  border: 1px solid rgba(126, 146, 255, .22);
  border-radius: 11px;
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #35cfff; box-shadow: 0 0 0 3px rgba(53,207,255,.12); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
button, .btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  color: #fff;
  background: linear-gradient(135deg, #6857ff, #20cbee);
  font-weight: 700;
  cursor: pointer;
}
button.secondary, .btn.secondary { background: #1c263b; color: #c9d6f1; border: 1px solid rgba(126, 146, 255, .20); }
button.danger { background: linear-gradient(135deg, #ff4c69, #ff915b); }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(126, 146, 255, .13);
  text-align: left;
  vertical-align: top;
}
th { color: #91a5ce; font-size: 13px; font-weight: 600; }
.badge {
  display: inline-flex; align-items: center;
  min-height: 24px; padding: 3px 9px; border-radius: 99px;
  background: rgba(72, 213, 255, .12); color: #6fe9ff; font-size: 12px;
}
.badge.warn { background: rgba(255, 187, 77, .12); color: #ffd078; }
.badge.off { background: rgba(255, 76, 105, .13); color: #ff9aaa; }
.login-wrap { max-width: 430px; margin: 90px auto; }
.login-wrap .card { padding: 28px; }
pre {
  white-space: pre-wrap;
  background: #080d18;
  border: 1px solid rgba(126, 146, 255, .18);
  border-radius: 12px;
  padding: 14px;
  color: #cbd7ef;
}
@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .logout { position: static; margin-top: 14px; }
  .main { margin-left: 0; padding: 18px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-row, .form-row.cols-3 { grid-template-columns: 1fr; }
}
