/* ==========================================================================
   H-Beyond CMS · 主框架与布局 (App Shell & Layout)
   ========================================================================== */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.brand-mark { width: 28px; height: 30px; color: var(--orange); }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav { padding: 14px 10px; overflow-y: auto; flex: 1; }
.nav-label {
  padding: 0 10px;
  margin: 16px 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-label:first-child { margin-top: 2px; }

.nav-item {
  width: 100%;
  height: 38px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--ink-2);
  position: relative;
  text-align: left;
  border-radius: var(--radius);
  margin: 2px 0;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s ease;
}
.nav-item:hover { background: #f3f4f6; color: var(--ink); }
.nav-item.active { background: #f3f4f6; color: var(--ink); font-weight: 600; }
.nav-item.active .svg-icon { stroke: var(--orange); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: var(--orange);
  border-radius: 2px;
}

.nav-item .count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 11px;
  border-radius: var(--radius-pill);
  color: var(--muted);
}
.nav-item .lock { margin-left: auto; color: var(--muted-light); }

.sidebar-foot {
  margin: 10px 12px 14px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.local-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 2px var(--green-soft);
}

.main { margin-left: var(--sidebar); min-height: 100vh; flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar);
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}

.mobile-menu { display: none; }
.crumb { font-size: 12px; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.top-spacer { flex: 1; }

.global-search { position: relative; width: 260px; }
.global-search > #searchIcon {
  position: absolute;
  left: 10px;
  top: 9px;
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
}
.global-search > #searchIcon .svg-icon { width: 15px; height: 15px; }
.global-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0 12px 0 34px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.global-search input:focus {
  background: var(--paper);
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

.search-results {
  position: absolute;
  right: 0;
  top: 42px;
  width: 380px;
  max-height: 430px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 80;
}
.search-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
}
.search-result:hover { background: var(--subtle); }

.content {
  padding: 24px 28px 48px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.page-head h1 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slideLeft { from { transform: translateX(24px); opacity: 0.8; } to { transform: none; opacity: 1; } }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .content { padding: 20px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .staff-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --topbar: 56px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; width: 240px; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .mobile-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 39; }
  .icon-btn.mobile-menu { display: inline-grid; }
  .crumb, .global-search { display: none; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 32px; }
  .metrics { grid-template-columns: 1fr; }
}
