:root {
  --primary: #C4786A;
  --primary-dark: #A85D50;
  --secondary: #8B9A7D;
  --bg: #F4F0EB;
  --surface: #FFFFFF;
  --text: #2C2A28;
  --muted: #8A847C;
  --border: #E8E2DA;
  --sidebar: #2C2A28;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
.login-page {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(196,120,106,.18), transparent 45%),
    radial-gradient(ellipse at 90% 100%, rgba(139,154,125,.14), transparent 40%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 20px; padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(44,42,40,.08);
  display: grid; gap: 10px;
}
.login-brand { font-size: 24px; font-weight: 700; }
.login-sub { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.login-card label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-card input, .form-control, select, textarea {
  width: 100%; height: 44px; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0 12px; font-size: 14px; font-family: inherit;
  background: #fff;
}
textarea.form-control { height: auto; padding: 12px; min-height: 120px; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--sidebar); color: #fff;
  padding: 24px 0; flex-shrink: 0;
}
.sidebar .brand {
  padding: 0 22px 24px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px;
}
.sidebar a {
  display: block; color: rgba(255,255,255,.72); padding: 12px 22px;
  font-size: 14px; transition: .15s;
}
.sidebar a:hover, .sidebar a.active {
  color: #fff; background: rgba(196,120,106,.25);
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.content { padding: 24px; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: #fff; border-radius: 16px; padding: 20px;
  border: 1px solid var(--border);
}
.stat-card .n { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.panel {
  background: #fff; border-radius: 16px; border: 1px solid var(--border);
  padding: 20px; margin-bottom: 20px;
}
.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-hd h2 { font-size: 16px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: #FAF7F4; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #F4F0EB; color: var(--text); }
.btn.danger { background: #FDECEC; color: #B33; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; height: 44px; }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.alert.error { background: #FDECEC; color: #A33; }
.alert.ok { background: #EEF6EA; color: #3D6B3A; }
.form-grid { display: grid; gap: 14px; max-width: 720px; }
.form-grid label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; background: #F4F0EB; color: var(--muted);
}
.badge.on { background: #EEF6EA; color: #3D6B3A; }
.badge.off { background: #FDECEC; color: #A33; }
.muted { color: var(--muted); }
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 180px; }
}
