* { box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text-primary); margin: 0; font-size: 14px; line-height: 1.6; }
h1, h2, h3, h4, h5, h6, .font-heading { font-family: var(--font-heading); }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; margin-left: 240px; min-height: 100vh; min-width: 0; }

/* Sidebar */
.sidebar { width: 240px; background: var(--color-sidebar-bg); color: var(--color-sidebar-text); position: fixed; top: 0; left: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; z-index: 100; border-right: 1px solid var(--color-sidebar-border); }

/* Sidebar logo / brand */
.sidebar-logo { padding: 1rem 1rem 0.875rem; display: flex; align-items: center; gap: 0.625rem; border-bottom: 1px solid var(--color-sidebar-border); text-decoration: none; }
.sidebar-logo-mark { width: 38px; height: 38px; flex-shrink: 0; object-fit: contain; border-radius: 8px; }
.sidebar-logo-text-group { display: flex; flex-direction: column; }
.sidebar-logo-name { font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: #FFFFFF; line-height: 1; }
.sidebar-logo-sub { font-size: 8px; font-weight: 600; letter-spacing: 0.10em; color: var(--color-sidebar-meta); text-transform: uppercase; margin-top: 3px; }

/* Nav */
.sidebar-nav { list-style: none; margin: 0; padding: var(--space-3) 0; flex: 1; }
.sidebar-nav-group { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-sidebar-meta); padding: 0.875rem 1.25rem 0.25rem; user-select: none; }
.sidebar-nav-group:first-child { padding-top: 0.25rem; }
.sidebar-nav-item a { display: flex; align-items: center; gap: var(--space-3); padding: 0.5625rem 0.75rem; color: var(--color-sidebar-text); text-decoration: none; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); margin: 1px 0.5rem; transition: background 0.15s, color 0.15s; }
.sidebar-nav-item a:hover { background: var(--color-sidebar-hover); color: var(--color-sidebar-text-active); }
.sidebar-nav-item.active a { background: var(--color-sidebar-active-bg); color: var(--color-sidebar-text-active); font-weight: 600; }
.sidebar-nav-item a i { font-size: 16px; width: 18px; text-align: center; opacity: 0.75; flex-shrink: 0; }
.sidebar-nav-item a:hover i, .sidebar-nav-item.active a i { opacity: 1; }

/* Sidebar footer */
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--color-sidebar-border); font-size: 13px; }
.sidebar-user-row { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.625rem; }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; font-family: var(--font-heading); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-user-info { display: flex; flex-direction: column; }
.sidebar-user-name { font-weight: 600; color: #fff; font-size: 13px; }
.sidebar-user-org { color: var(--color-sidebar-meta); font-size: 11px; margin-top: 1px; }

/* Topbar */
.topbar { background: var(--color-surface); border-bottom: 1px solid var(--color-border); height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-6); position: sticky; top: 0; z-index: 50; }
.topbar-left .page-title { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--color-text-primary); margin: 0; }
.topbar-left .breadcrumb { font-size: 12px; color: var(--color-text-muted); margin: 2px 0 0; }
.page-body { padding: var(--space-6); flex: 1; min-width: 0; max-width: 100%; overflow-x: hidden; }
.page-body h1 { display: none; }
.page-body > .d-flex:has(> h1:only-child) { display: none !important; }
.page-body.body-page-heading h1 {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */
@media (max-width: 991px) {
  .sidebar { width: 48px; }
  .sidebar-logo-text, .sidebar-nav-item a span, .sidebar-footer { display: none; }
  .sidebar-nav-group { font-size: 0; padding: 0.375rem 0.75rem; border-top: 1px solid var(--color-sidebar-border); margin-top: 0.375rem; }
  .main-content { margin-left: 48px; }
  .sidebar-logo { justify-content: center; padding: var(--space-4); }
  .sidebar-nav-item a { justify-content: center; padding: var(--space-3); }
}
/* Mobile */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); width: 240px; transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
