:root {
  --shell-ground: #f2f2f3;
  --shell-ink: #1d1f20;
  --shell-muted: #5b5f63;
  --shell-line: rgba(29, 31, 32, .16);
}
.app { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; background: var(--shell-ground); color: var(--shell-ink); }
.app[hidden], [hidden] { display: none !important; }
.workspace { min-width: 0; padding: 22px 28px 32px; }
.workspace > * { max-width: 1040px; }
.sidebar { display: flex; flex-direction: column; gap: 14px; align-self: start; position: sticky; top: 0; min-height: 100vh; max-height: 100vh; overflow-y: auto; padding: 18px 14px; background: #e9e9ea; border-right: 1px solid var(--shell-line); }
.sidebar-head { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.logo-mark { box-sizing: border-box; width: 36px; height: 36px; display: inline-grid; place-items: center; color: var(--shell-muted); font: 400 11px Barlow, sans-serif; border: 1px dashed var(--shell-muted); text-decoration: none; }
.brand-name { font-family: var(--font-heading); font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.sidebar-nav { display: grid; align-content: start; gap: 12px; }
.nav-group-label { padding: 0 10px 4px; color: var(--shell-muted); font-size: 12px; font-weight: 700; }
.sidebar .nav-item { display: block; width: 100%; padding: 6px 10px; text-align: left; border: 0; background: transparent; color: var(--shell-ink); text-decoration: none; font: 400 15px/1.45 Barlow, sans-serif; cursor: pointer; }
.sidebar .nav-item:hover { background: #dcdfe2; }
.sidebar .nav-item.active { background: #2f5d8a; color: white; }
.sidebar-foot { border-top: 1px solid var(--shell-line); padding-top: 6px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0 0 20px; background: transparent; border: 0; }
.topbar-title { flex-grow: 1; }
#date-line { font-size: 13px; color: var(--shell-muted); }
#page-title { font: 600 40px/1.05 var(--font-heading); margin: 2px 0 0; letter-spacing: normal; text-transform: none; }
.header-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.unit-segment { display: inline-flex; border: 1px solid rgba(29,31,32,.32); }
.unit-segment button, .topbar-menu { height: 40px; padding: 0 16px; border: 0; border-radius: 0; background: transparent; cursor: pointer; color: var(--shell-ink); font: inherit; }
.unit-segment button + button { border-left: 1px solid rgba(29,31,32,.32); }
.unit-segment button[aria-pressed="true"] { background: var(--shell-ink); color: var(--shell-ground); }
.unit-segment button:disabled { color: #797d80; cursor: default; }
.main { max-width: 1040px; width: auto; margin: 0; padding: 0; }
.main .page-scroll { padding: 0; }
.page.new-scope .page-scroll > :not(.route-status) { visibility: hidden; }
.app-foot { display: block; margin: 26px 0 0; padding: 0; border: 0; color: var(--shell-muted); font-size: 13px; }
.topbar-menu { display: none; }
.coming-state { font-size: 16px; color: var(--shell-muted); margin: 12px 0; }
.login-card select { min-height: 44px; width: 100%; padding: 7px 10px; border: 1px solid var(--shell-line); font: inherit; }
.login-card .logo-mark { margin-bottom: 12px; }
#demo-login-form { display: grid; gap: 10px; margin: 18px 0; }
@media (max-width: 850px) {
  .app { display: block; }
  .workspace { padding: 18px 16px 30px; }
  .sidebar { display: none; min-height: 0; max-height: 70vh; position: static; border: 0; border-bottom: 1px solid var(--shell-line); }
  .app.sidebar-open .sidebar { display: flex; }
  .topbar-menu { display: block; height: 38px; padding: 0 12px; border: 1px solid var(--shell-line); align-self: center; }
}
@media print { .sidebar, .topbar-menu, .header-controls { display: none; } .app { display: block; } }
