/* ============ 布局：侧边栏 / 顶栏 / 内容区 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px; flex: 0 0 224px;
  background: #0f231d; color: #dbe6e1;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 6px 22px; text-decoration: none; color: inherit; cursor: pointer; }
.brand:hover .brand-txt strong { color: var(--brand); }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; color: #1d1305; overflow: hidden; flex: 0 0 36px;
  font-weight: 800; font-size: 17px;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 2px; box-sizing: border-box; }
.brand-txt strong { display: block; font-size: 15px; color: #fff; letter-spacing: 3px; line-height: 1.2; }
.brand-txt span { font-size: 10.5px; color: #8ea79d; letter-spacing: 1.5px; }

.nav-group-label {
  font-size: 10px; color: #5f7770; letter-spacing: 2px;
  padding: 10px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; margin-bottom: 2px;
  border: 0; border-radius: 10px; background: transparent;
  color: #a9c0b7; font-size: 13.5px; text-align: left;
  cursor: pointer; transition: .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(224, 164, 88, .20), rgba(255, 255, 255, .03));
  color: #fff; box-shadow: inset 2px 0 0 #e0a458;
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 6px; border-radius: 99px;
  background: rgba(224, 164, 88, .18); color: #e8b266;
}
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user { display: flex; gap: 9px; align-items: center; padding: 6px 4px; }
.user .avatar { width: 30px; height: 30px; border-radius: 50%; background: #1d3b32; color: #e0a458; display: grid; place-items: center; font-size: 12px; }
.user strong { display: block; font-size: 12.5px; color: #e7efeb; }
.user span { font-size: 11px; color: #7f978d; }
.link-reset { background: none; border: 0; color: #8ea79d; font-size: 12px; padding: 8px 4px; cursor: pointer; }
.link-reset:hover { color: #e0a458; }
.side-actions { display: flex; justify-content: space-between; align-items: center; }

.main { margin-left: 224px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 15px 28px; border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 242, .88); backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 19px; font-weight: 650; letter-spacing: .3px; }
.topbar p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.who { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.who strong { display: block; font-size: 12.5px; line-height: 1.3; }
.who span { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.menu-toggle { display: none; }

.view { padding: 22px 28px 64px; max-width: 1460px; width: 100%; }
.view.fade-in { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: 1.6fr 1fr; }
.g-2b { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1180px) {
  .g-2, .g-2b, .g-3 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: 24px 0 48px rgba(0, 0, 0, .25); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; }
  .topbar p { display: none; }
  .view { padding: 16px 16px 56px; }
  .who { display: none; }
  .scrim {
    position: fixed; inset: 0; background: rgba(10, 20, 16, .4);
    z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }
}

@media (max-width: 560px) {
  .top-actions .btn-label { display: none; }
  .kpi .k-val { font-size: 23px; }
}
