:root {
  --sidebar-bg: #1e293b;
  --sidebar-width: 220px;
  --content-bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
  background: var(--content-bg);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #334155;
  margin: 0;
}

/* ========== 布局 ========== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar .brand {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .brand small {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

.sidebar .nav-link {
  color: #cbd5e1;
  padding: 12px 20px;
  display: block;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active {
  background: rgba(59, 130, 246, .18);
  color: #fff;
  border-left-color: #3b82f6;
}
.sidebar .ico { display: inline-block; width: 20px; text-align: center; }

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar strong { font-size: 16px; color: #0f172a; }

.content { padding: 24px; flex: 1; }

.copyright {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 14px;
}

/* ========== 卡片 ========== */
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  height: 100%;
}
.stat-card .label { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: #0f172a; }
.stat-card .value.text-success { color: #16a34a !important; }
.stat-card .value.text-danger { color: #dc2626 !important; }
.stat-card .value.text-primary { color: #2563eb !important; }

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 16px;
}

/* ========== 表格 ========== */
.table th {
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
}
.table td { vertical-align: middle; }

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.login-card h1 {
  font-size: 20px;
  text-align: center;
  color: #0f172a;
  margin-bottom: 4px;
}
.login-card .sub {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 24px;
}

/* ========== 其他 ========== */
.pagination { margin-bottom: 0; }
.form-label { font-weight: 500; color: #475569; }
.required::after { content: " *"; color: #dc2626; }

@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .brand { font-size: 0; padding: 16px 0; text-align: center; }
  .sidebar .brand small { display: none; }
  .sidebar .nav-link { padding: 14px 0; text-align: center; font-size: 16px; }
  .sidebar .nav-link .txt { display: none; }
  .main { margin-left: 64px; }
  .content { padding: 12px; }
}
