/* One fixed shell: the navigation scrolls below the brand, never behind it. */
:root { --shell-height: 88px; --sidebar-width: 220px; }
body:not(.audit-shell) .shell-header { height: var(--shell-height); position: relative; z-index: 80; }
body:not(.audit-shell) .topbar {
  position: fixed; inset: 0 0 auto; z-index: 82; width: 100%; max-width: none;
  min-height: var(--shell-height); height: var(--shell-height); margin: 0;
  padding: 10px 22px 10px calc(var(--sidebar-width) + 24px);
  display: flex; align-items: center; gap: 18px; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: 0 2px 12px #30203e03;
}
body:not(.audit-shell) .topbar .brand {
  position: absolute; left: 22px; top: 22px; width: calc(var(--sidebar-width) - 72px);
  min-height: 44px; z-index: 2; overflow: hidden;
}
body:not(.audit-shell) .topbar .brand .tedsuite-logo { width: 140px; max-width: 100%; }
body:not(.audit-shell) .topbar .brand > div > .brand-product { display: block; margin-top: 5px; font-size: 10px; letter-spacing: .6px; }
body:not(.audit-shell) .sidebar-collapse {
  position: absolute; left: calc(var(--sidebar-width) - 43px); top: 27px;
  display: grid; width: 30px; height: 34px; min-width: 30px; flex-basis: 30px;
  color: #8b7d9d; border-radius: 7px;
}
body:not(.audit-shell) .sidebar-collapse:hover { color: var(--accent); background: var(--accent-soft); }
body:not(.audit-shell) .sidebar {
  top: var(--shell-height); bottom: 0; padding: 20px 12px 16px; width: var(--sidebar-width);
  z-index: 80; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--border); scrollbar-width: thin;
}
body:not(.audit-shell) .sidebar #nav { padding: 0; width: 100%; margin: 0; }
body:not(.audit-shell) .sidebar .nav-group-label { font-size: 10px; letter-spacing: 1px; margin: 20px 12px 8px; }
body:not(.audit-shell) .sidebar .nav-group-label:first-child { margin-top: 1px; }
body:not(.audit-shell) .sidebar .nav-item { min-height: 41px; padding: 10px 12px; font-size: 12px; gap: 10px; }
body:not(.audit-shell) .sidebar-footer { padding-top: 26px; margin-inline: 11px; }
body:not(.audit-shell) .sidebar-footer small { font-size: 10px; line-height: 1.6; }
body:not(.audit-shell) #main { margin-left: var(--sidebar-width); min-height: calc(100dvh - var(--shell-height)); }
body:not(.audit-shell) .content { padding-top: 23px; }
body:not(.audit-shell) .topbar .header-workspace { display: block; }
.topbar .header-workspace { flex: 1 1 220px; min-width: 135px; max-width: 390px; padding: 0; margin: 0; border: 0; }
.topbar .header-workspace > #tenant-name { max-width: 100%; margin: 0 0 4px; color: #92879e; font-size: 9px; font-weight: 600; letter-spacing: .9px; line-height: 1.3; text-transform: uppercase; }
.topbar .page-heading { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; }
.topbar .page-heading > div:first-child { min-width: 0; }
.topbar .page-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -.55px; }
.topbar .page-heading p { margin: 3px 0 0; font-size: 10px; line-height: 1.4; color: #81768e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.topbar #heading-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; flex: none; }
.topbar #heading-actions:empty { display: none; }
.topbar #heading-actions .button { min-height: 32px; font-size: 10px; padding: 6px 8px; }
.header-clock { display: grid; flex: 0 0 auto; min-width: 117px; gap: 2px; border-left: 1px solid var(--border); padding-left: 17px; }
#header-clock-time { font-size: 22px; font-weight: 450; line-height: 1.05; color: #453851; letter-spacing: -.65px; font-variant-numeric: tabular-nums; }
#header-clock-date { color: #81728e; font-size: 9px; line-height: 1.3; }
body:not(.audit-shell) .topbar #header-summary { margin-left: auto; flex: 0 0 auto; }
body:not(.audit-shell) .topbar .topbar-actions { margin-left: 0; gap: 4px; flex: none; }
body:not(.audit-shell) .topbar .account { padding-left: 11px; gap: 4px; flex: none; }
body:not(.audit-shell) .topbar .account-profile { gap: 7px; }
body:not(.audit-shell) .topbar .account-avatar { width: 31px; height: 31px; font-size: 10px; }
body:not(.audit-shell) .mobile-menu { display: none; }
body.sidebar-collapsed:not(.audit-shell) { --sidebar-width: 76px; }
body.sidebar-collapsed:not(.audit-shell) .topbar .brand { left: 18px; top: 21px; width: 40px; }
body.sidebar-collapsed:not(.audit-shell) .topbar .brand .tedsuite-logo,
body.sidebar-collapsed:not(.audit-shell) .topbar .brand .brand-product,
body.sidebar-collapsed:not(.audit-shell) .topbar .brand .portal-client { display: none; }
body.sidebar-collapsed:not(.audit-shell) .topbar .brand .tedsuite-brand-icon { display: block; width: 36px; height: 36px; }
body.sidebar-collapsed:not(.audit-shell) .sidebar-collapse { position: static; flex: 0 0 30px; }
body.sidebar-collapsed:not(.audit-shell) .sidebar { padding-inline: 12px; }
body.sidebar-collapsed:not(.audit-shell) .sidebar .nav-item { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed:not(.audit-shell) .sidebar .nav-item > span,
body.sidebar-collapsed:not(.audit-shell) .sidebar .nav-item.active:after,
body.sidebar-collapsed:not(.audit-shell) .sidebar-footer > span:last-child { display: none; }
body.sidebar-collapsed:not(.audit-shell) .sidebar .nav-group-label { height: 1px; margin: 16px 8px 11px; padding: 0; background: var(--border); overflow: hidden; color: transparent; font-size: 0; }
body.sidebar-collapsed:not(.audit-shell) .sidebar .nav-group-label:first-child { margin-top: 0; height: 0; }
body.sidebar-collapsed:not(.audit-shell) .sidebar-footer { justify-content: center; margin-inline: 0; }
.audit-shell .header-workspace .page-heading, .audit-shell .sidebar-collapse { display: none; }
.audit-shell .header-clock { min-width: 107px; border-color: #51465f; }
.audit-shell #header-clock-date { color: #b9abc9; }
.audit-shell #header-clock-time { color: #eee6f7; font-size: 19px; }
@media (max-width: 1380px) {
  body:not(.audit-shell) .topbar { gap: 12px; padding-right: 16px; }
  body:not(.audit-shell) .topbar .account-profile > span:last-child { display: none; }
  .topbar .header-workspace { flex-basis: 190px; }
  .header-clock { padding-left: 12px; min-width: 110px; }
}
@media (min-width: 1001px) and (max-width: 1230px) {
  body:not(.audit-shell) .topbar .header-summary-inline { gap: 10px; }
  body:not(.audit-shell) .topbar .header-counter { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 9px; min-height: 37px; justify-content: center; }
  body:not(.audit-shell) .topbar .header-counter strong { font-size: 14px; }
  body:not(.audit-shell) .topbar .header-health { font-size: 0; margin-left: 0; }
  body:not(.audit-shell) .topbar .header-health i { width: 5px; height: 5px; }
  body:not(.audit-shell) .topbar .header-summary-inline { display: flex; }
  body:not(.audit-shell) .topbar .header-summary-compact { display: none; }
  body:not(.audit-shell) .topbar .audit-mode-toggle { max-width: 44px; width: 38px; padding: 5px; }
  body:not(.audit-shell) .topbar .audit-mode-toggle > span:last-child { display: none; }
}
@media (max-width: 1000px) {
  :root { --shell-height: 82px; }
  body:not(.audit-shell) .topbar { padding-left: 18px; gap: 10px; }
  body:not(.audit-shell) .topbar .brand { position: static; width: 112px; min-width: 112px; flex: none; }
  body:not(.audit-shell) .topbar .brand .tedsuite-logo { width: 112px; }
  body:not(.audit-shell) .topbar .brand > div > .brand-product { display: none; }
  body:not(.audit-shell) .mobile-menu { display: grid; flex: 0 0 36px; min-width: 36px; }
  body:not(.audit-shell) .sidebar-collapse { display: none; }
  body:not(.audit-shell) .sidebar { top: var(--shell-height); padding-top: 18px; width: 244px; transform: translateX(-100%); visibility: hidden; }
  body:not(.audit-shell) .sidebar.open { transform: translateX(0); visibility: visible; }
  body:not(.audit-shell) #main { margin-left: 0; }
  body:not(.audit-shell) .menu-scrim { top: var(--shell-height); z-index: 79; }
  body:not(.audit-shell) .header-summary-mini { display: none; }
  body:not(.audit-shell) .header-summary-caption { display: inline; }
  body:not(.audit-shell) .topbar .audit-mode-toggle { width: 38px; max-width: 38px; padding: 5px; }
  body:not(.audit-shell) .topbar .audit-mode-toggle > span:last-child { display: none; }
  body:not(.audit-shell) .header-clock { min-width: 99px; padding-left: 10px; }
  body:not(.audit-shell) #header-clock-time { font-size: 19px; }
  body:not(.audit-shell) #header-clock-date { font-size: 8px; }
  .topbar .header-workspace { min-width: 0; flex-basis: 145px; }
  .topbar .page-heading h1 { font-size: 16px; }
  .topbar .page-heading p { display: none; }
  body:not(.audit-shell) .topbar .account #logout { width: 36px; height: 44px; flex-basis: 36px; }
}
@media (max-width: 760px) {
  :root { --shell-height: 106px; }
  body:not(.audit-shell) .topbar { align-items: flex-start; padding: 10px 10px 41px; gap: 7px; }
  body:not(.audit-shell) .topbar .brand { width: 38px; min-width: 38px; flex-basis: 38px; }
  body:not(.audit-shell) .topbar .brand .tedsuite-logo { display: none; }
  body:not(.audit-shell) .topbar .brand .tedsuite-brand-icon { display: block; width: 35px; height: 35px; margin-top: 3px; }
  body:not(.audit-shell) .topbar .header-workspace { flex: 1 1 auto; padding-top: 5px; }
  body:not(.audit-shell) .topbar #tenant-name { font-size: 8px; margin-bottom: 3px; letter-spacing: .4px; }
  body:not(.audit-shell) .topbar .page-heading h1 { font-size: 15px; }
  body:not(.audit-shell) .topbar #heading-actions .button { font-size: 9px; padding-inline: 5px; }
  body:not(.audit-shell) .topbar #header-summary { position: absolute; bottom: 1px; left: 15px; margin: 0; }
  body:not(.audit-shell) .header-summary-compact > summary { min-height: 34px; gap: 7px; }
  body:not(.audit-shell) .header-summary-mini { display: flex; gap: 11px; font-size: 9px; }
  body:not(.audit-shell) .header-summary-caption { display: none; }
  body:not(.audit-shell) .header-summary-mini b.header-count-value { font-size: 11px; }
  body:not(.audit-shell) .header-clock { position: absolute; bottom: 11px; right: 15px; min-width: 0; padding-left: 0; border: 0; display: flex; align-items: baseline; gap: 8px; }
  body:not(.audit-shell) #header-clock-time { font-size: 16px; letter-spacing: -.3px; }
  body:not(.audit-shell) #header-clock-date { font-size: 9px; }
  body:not(.audit-shell) .topbar .topbar-actions > #refresh { display: none; }
  body:not(.audit-shell) .topbar .topbar-actions { padding-top: 0; }
  body:not(.audit-shell) .topbar .account { padding: 0; border: 0; }
  body:not(.audit-shell) .topbar .account-profile { width: 36px; min-width: 36px; min-height: 44px; padding: 0; }
  body:not(.audit-shell) .topbar .audit-mode-toggle { width: 36px; min-width: 36px; max-width: 36px; min-height: 44px; padding: 5px; }
  body:not(.audit-shell) .topbar .audit-mode-toggle > span:last-child { display: none; }
  body:not(.audit-shell) .header-summary-popover { top: var(--shell-height); left: 10px; right: auto; }
  body:not(.audit-shell) .content { padding-top: 16px; }
  .audit-shell .header-clock { display: none; }
}
@media (max-width: 410px) {
  body:not(.audit-shell) .topbar { gap: 4px; }
  body:not(.audit-shell) #header-clock-date { max-width: 72px; white-space: nowrap; overflow: hidden; }
  body:not(.audit-shell) .header-summary-mini { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .topbar, #main { transition: none !important; }
}
