.shell {
  grid-template-columns:var(--sidebar-width) minmax(0,1fr);
  background:var(--color-background);
}
.sidebar {
  position:sticky;
  z-index:30;
  top:0;
  height:100vh;
  overflow-y:auto;
  padding:16px 12px;
  border-right:0;
  background:#202626;
}
.brand {
  min-height:54px;
  padding:0 8px 14px;
  color:#fff;
}
.brand-mark {
  flex:0 0 auto;
  border-radius:var(--radius-sm);
  background:#8a5d47;
}
.brand span {
  letter-spacing:0;
  color:#aeb8b6;
}
.nav {
  display:block;
}
.nav-group + .nav-group {
  margin-top:12px;
}
.nav-group-toggle {
  display:flex;
  width:100%;
  min-height:28px;
  align-items:center;
  justify-content:space-between;
  border:0;
  padding:0 9px;
  color:#8f9a98;
  background:transparent;
  font-size:var(--font-size-xs);
  font-weight:750;
  text-align:left;
}
.nav-group-toggle:hover {
  color:#fff;
}
.nav-chevron {
  transform:rotate(0);
  transition:transform 160ms ease;
}
.nav-group-toggle[aria-expanded="false"] .nav-chevron {
  transform:rotate(-90deg);
}
.nav-group-pages {
  display:grid;
  gap:2px;
  margin-top:3px;
}
.nav-group-pages[hidden] {
  display:none;
}
.nav-item {
  display:grid;
  grid-template-columns:8px minmax(0,1fr);
  gap:8px;
  min-height:34px;
  align-items:center;
  padding:7px 9px;
  color:#c8cfcd;
  font-size:12px;
  font-weight:600;
}
.nav-item-marker {
  width:4px;
  height:4px;
  border-radius:50%;
  background:#68716f;
}
.nav-item:hover { color:#fff; background:#2b3231; }
.nav-item.active { color:#fff; background:#3a312d; }
.nav-item.active .nav-item-marker {
  background:#d69a78;
  box-shadow:0 0 0 3px rgba(214,154,120,.14);
}
.sidebar-footer {
  margin-top:auto;
  padding:18px 9px 2px;
  border-top:1px solid #39403f;
  color:#899390;
  font-size:var(--font-size-xs);
  line-height:1.6;
}
.workspace {
  min-height:100vh;
}
.topbar {
  position:sticky;
  z-index:20;
  top:0;
  min-height:76px;
  padding:11px 32px;
  gap:20px;
  background:color-mix(in srgb,var(--color-surface) 96%,transparent);
  backdrop-filter:blur(12px);
}
.topbar-heading {
  display:flex;
  min-width:0;
  align-items:center;
  gap:12px;
}
.topbar-copy {
  min-width:0;
}
.breadcrumb {
  display:flex;
  gap:6px;
  align-items:center;
  margin:0 0 4px;
  color:var(--color-text-muted);
  font-size:var(--font-size-xs);
}
.breadcrumb-separator {
  color:#a8b0af;
}
.topbar h1 {
  overflow:hidden;
  font-size:19px;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.top-actions {
  position:relative;
  align-items:center;
  flex:0 0 auto;
}
.icon-button,
.utility-button,
.profile-trigger {
  min-height:var(--control-height);
  border:1px solid var(--color-border);
  border-radius:var(--radius-sm);
  color:var(--color-text);
  background:var(--color-surface);
}
.icon-button {
  width:var(--control-height);
  height:var(--control-height);
}
.utility-button {
  display:inline-flex;
  height:var(--control-height);
  align-items:center;
  gap:6px;
  padding:0 11px;
  font-size:12px;
  font-weight:700;
}
.utility-button:hover,
.profile-trigger:hover,
.icon-button:hover {
  border-color:var(--color-secondary);
  background:var(--color-hover);
}

.theme-toggle { flex:0 0 auto; }
.theme-icon { display:grid; place-items:center; font-size:16px; line-height:1; }
:root[data-theme="dark"] .sidebar { background:#111514; }
:root[data-theme="dark"] .nav-item:hover { background:#222927; }
:root[data-theme="dark"] .nav-item.active { background:#3c2e28; }
:root[data-theme="dark"] .sidebar-footer { border-color:#2b3331; }
.notification-count {
  display:grid;
  min-width:17px;
  height:17px;
  place-items:center;
  border-radius:9px;
  color:#fff;
  background:var(--orange);
  font-size:10px;
}
.profile-trigger {
  display:grid;
  grid-template-columns:28px minmax(0,110px) auto;
  gap:8px;
  height:var(--control-height);
  align-items:center;
  padding:4px 8px 4px 5px;
  text-align:left;
}
.profile-trigger .avatar {
  width:28px;
  height:28px;
}
.profile-trigger strong {
  overflow:hidden;
  font-size:12px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.panel-caret {
  color:var(--color-text-muted);
  font-size:11px;
}
.floating-panel {
  position:absolute;
  z-index:50;
  top:calc(100% + 10px);
  right:0;
  width:min(360px,calc(100vw - 32px));
  border:1px solid var(--color-border);
  border-radius:var(--radius-md);
  background:var(--color-surface);
  box-shadow:0 18px 48px rgba(21,31,32,.15);
}
.floating-panel[hidden] {
  display:none;
}
.global-search-panel {
  right:154px;
  padding:12px;
}
.global-search-panel input {
  width:100%;
  height:40px;
  border:1px solid var(--color-border);
  border-radius:var(--radius-sm);
  padding:0 11px;
  outline:none;
}
.global-search-panel input:focus {
  border-color:var(--color-accent);
  box-shadow:0 0 0 3px rgba(8,122,113,.12);
}
.global-search-results {
  display:grid;
  max-height:330px;
  gap:2px;
  overflow-y:auto;
  margin-top:8px;
}
.global-search-results button {
  display:flex;
  min-height:38px;
  align-items:center;
  justify-content:space-between;
  border:0;
  border-radius:var(--radius-sm);
  padding:7px 9px;
  color:var(--color-text);
  background:transparent;
  text-align:left;
}
.global-search-results button:hover {
  background:var(--teal-soft);
}
.global-search-results small {
  color:var(--color-text-muted);
}
.shell-search-empty {
  margin:0;
  padding:18px 8px;
  color:var(--color-text-muted);
  font-size:12px;
  text-align:center;
}
.notification-panel {
  width:300px;
  padding:16px;
}
.notification-panel strong,
.notification-panel span {
  display:block;
}
.notification-panel span {
  margin-top:6px;
  color:var(--color-text-muted);
  font-size:12px;
  line-height:1.6;
}
.profile-menu {
  width:250px;
  padding:15px;
}
.profile-menu .account {
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  margin:0;
  border:0;
  padding:0;
  align-items:start;
}
.profile-menu .account > div:last-child {
  min-width:0;
}
.auth-message {
  margin-top:8px;
  color:var(--color-danger);
  line-height:1.45;
}
.sidebar-toggle {
  display:none;
}
.shell-scrim {
  display:none;
}
#shell-state {
  padding:32px;
}
#shell-state[hidden] {
  display:none;
}
.shell-state {
  display:grid;
  min-height:360px;
  place-items:center;
  align-content:center;
  border:1px solid var(--color-border);
  border-radius:6px;
  background:var(--color-surface);
  text-align:center;
}
.shell-state-mark {
  display:grid;
  width:42px;
  height:42px;
  place-items:center;
  border:1px solid #a9b7b4;
  border-radius:50%;
  color:var(--color-accent);
  font-size:20px;
  font-weight:700;
}
.shell-state h2 {
  margin:16px 0 7px;
  font-size:18px;
}
.shell-state p {
  max-width:430px;
  margin:0;
  color:var(--color-text-muted);
  font-size:13px;
  line-height:1.7;
}
.shell-state .secondary-button {
  margin-top:18px;
}
.shell-state-construction .shell-state-mark {
  border-style:dashed;
}
.shell-state-loading .shell-state-mark {
  border-color:#a88877;
  border-right-color:transparent;
  animation:shell-state-spin 800ms linear infinite;
}
.shell-state-error .shell-state-mark { color:var(--color-danger); border-color:#d7aaa5; }
.shell-state-empty .shell-state-mark { color:var(--color-secondary); border-color:#a9c3c0; }
@keyframes shell-state-spin { to { transform:rotate(360deg); } }
@media (max-width:980px) {
  .topbar {
    padding-right:20px;
    padding-left:20px;
  }
  .utility-button span:first-child {
    display:none;
  }
  .profile-trigger {
    grid-template-columns:28px auto;
  }
  .profile-trigger strong {
    display:none;
  }
  .global-search-panel {
    right:92px;
  }
}
@media (max-width:820px) {
  .shell {
    display:block;
  }
  .sidebar {
    display:flex;
    position:fixed;
    left:0;
    top:0;
    width:min(var(--sidebar-width),86vw);
    transform:translateX(-102%);
    transition:transform 180ms ease;
    box-shadow:12px 0 36px rgba(17,29,30,.16);
  }
  .shell.sidebar-open .sidebar {
    transform:translateX(0);
  }
  .shell-scrim {
    position:fixed;
    z-index:25;
    inset:0;
    background:rgba(20,29,30,.34);
  }
  .shell.sidebar-open .shell-scrim {
    display:block;
  }
  .sidebar-toggle {
    display:grid;
  }
  .topbar {
    min-height:78px;
  }
  .topbar h1 {
    max-width:42vw;
    font-size:18px;
  }
  .top-actions {
    gap:6px;
  }
  #global-search-trigger,
  #notification-trigger {
    width:var(--control-height);
    padding:0;
    justify-content:center;
  }
  #global-search-trigger span:first-child,
  #notification-trigger span:first-child {
    display:block;
  }
  .notification-count {
    position:absolute;
    top:-4px;
    right:-4px;
  }
  .profile-trigger {
    padding-right:5px;
  }
  .global-search-panel {
    position:fixed;
    top:70px;
    right:12px;
    left:12px;
    width:auto;
  }
  .notification-panel,
  .profile-menu {
    right:0;
  }
  #shell-state {
    padding:20px;
  }
  .shell-state {
    min-height:300px;
  }
}
@media (max-width:560px) {
  .topbar {
    min-height:72px;
    padding:12px;
  }
  .breadcrumb {
    display:none;
  }
  .topbar h1 {
    max-width:34vw;
    font-size:16px;
  }
  #refresh {
    display:none;
  }
  #primary-action {
    min-width:72px;
    padding:0 10px;
  }
  #view {
    padding:20px 12px 40px;
  }
  .metrics,
  .split,
  .approval-columns,
  .completed-approvals,
  .approval-overview,
  .customer-detail-grid,
  .help-grid {
    grid-template-columns:1fr;
  }
}
