:root {
  --sidebar-width: 230px;
  --primary: #4e73df;
  --dark: #343a40;
}

* { box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f4f6f9; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: #2f323e;
  color: #a6b0cf;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 1000;
}
.sidebar .brand { padding: 18px; color: #fff; font-size: 18px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,.05); }
.sidebar .menu-item { display: block; }
.sidebar .menu-title {
  padding: 12px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: .2s; user-select: none;
}
.sidebar .menu-title:hover, .sidebar .menu-item.active > .menu-title { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .menu-title i { width: 20px; text-align: center; }
.sidebar .submenu { display: none; background: #262833; }
.sidebar .submenu a {
  display: block; padding: 10px 18px 10px 48px; color: #a6b0cf; text-decoration: none; font-size: 14px;
}
.sidebar .submenu a:hover, .sidebar .submenu a.active { color: #fff; background: rgba(255,255,255,.04); }
.sidebar .menu-item.open > .submenu { display: block; }
.sidebar .arrow { margin-left: auto; font-size: 12px; transition: .2s; }
.sidebar .menu-item.open > .menu-title .arrow { transform: rotate(90deg); }

.main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e3e6f0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 999;
}
.topbar .user { font-size: 14px; color: #555; }
.content { padding: 24px; }

.card { border: none; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.05); background: #fff; }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; padding: 16px 20px; font-weight: 600; }
.card-body { padding: 20px; }

.table th { background: #f8f9fa; font-weight: 600; font-size: 14px; white-space: nowrap; }
.table td { vertical-align: middle; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.form-label { font-weight: 500; font-size: 14px; }
.pagination { justify-content: flex-end; }

.search-bar { background: #fff; padding: 16px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.search-bar .form-control, .search-bar .form-select { font-size: 14px; }

.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.05); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; }
.stat-card h4 { margin: 0; font-weight: 700; }
.stat-card small { color: #888; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4e73df 0%, #224abe 100%); }
.login-box { width: 400px; background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-box h3 { margin-bottom: 24px; text-align: center; color: #333; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: .3s; }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
}
