/* App chrome. All company colors come from the existing brand variables. */
.os-layout {
  --workspace-sidebar-width: 268px;
  grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr);
}
.os-layout > .content {
  grid-column: 2;
}
.os-layout .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--workspace-sidebar-width);
  height: 100dvh;
  z-index: 30;
  padding: 28px 18px 18px;
  background: var(--nav);
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.os-layout .sidebar .shell-brand {
  padding: 0 8px !important;
  min-height: 72px;
  gap: 12px;
  letter-spacing: -0.4px;
}
.os-layout .shell-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.os-layout .shell-logo-sidebar {
  width: 210px;
}
.os-layout .company-brand .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 13px;
  background: var(--action) !important;
  color: #fff !important;
  font-weight: 700;
}
.os-layout .company-brand-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
  font-weight: 700;
  font-size: 19px;
}
.os-layout .company-brand-copy small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.1px;
  font-weight: 500;
  color: var(--muted);
}
.os-layout .workspace {
  margin: 22px 0 20px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 3px 14px #132d4c04;
  gap: 10px;
}
.os-layout .workspace-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--action-soft);
  color: var(--action);
  font-size: 12px;
  font-weight: 700;
}
.os-layout .workspace small {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.os-layout .workspace strong,
.os-layout .workspace select {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  color: var(--ink);
}
.os-layout .workspace > div {
  flex: 1;
  min-width: 0;
}
.os-layout .workspace select {
  max-width: 100%;
}
.os-layout .nav {
  padding: 0;
  scrollbar-color: var(--line) transparent;
  scrollbar-gutter: stable;
}
.os-layout .nav button,
.os-layout .nav-link,
.os-layout .nav-group summary {
  min-height: 44px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 11px;
  gap: 11px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}
.os-layout .nav .icon {
  width: 18px;
  height: 18px;
  color: currentColor;
  flex-shrink: 0;
}
.os-layout .nav button:hover,
.os-layout .nav-link:hover,
.os-layout .nav-group summary:hover {
  background: var(--nav-soft);
  color: var(--ink);
}
.os-layout .nav button.active {
  background: var(--action-soft);
  color: var(--action);
  font-weight: 700;
  box-shadow: inset 3px 0 var(--action);
}
.os-layout .nav button.active .icon {
  color: var(--action);
}
.os-layout .nav-ai {
  margin: 9px 0 4px;
  padding: 0;
}
.os-layout .nav-ai button {
  color: var(--action);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 650;
  box-shadow: 0 2px 7px #18345703;
}
.os-layout .nav-ai button.active {
  border-color: var(--action);
  background: var(--action-soft);
  box-shadow: none;
}
.os-layout .nav-caption {
  margin: 26px 12px 10px;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 1.3px;
  font-weight: 750;
  color: var(--muted);
}
.os-layout .nav-group summary {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}
.os-layout .nav-group summary .icon:last-child {
  width: 13px;
  height: 13px;
  color: var(--muted);
  transition: transform 0.16s ease;
}
.os-layout .nav-group > div {
  padding: 2px 0 7px 13px;
  margin-left: 20px;
  border-left: 1px solid var(--line);
}
.os-layout .nav-group > div button,
.os-layout .nav-group > div .nav-link {
  min-height: 39px;
  font-size: 12px;
  padding: 9px 11px;
  margin: 2px 0;
  border-radius: 9px;
}
.os-layout .nav-group > div .icon {
  width: 16px;
  height: 16px;
}
.os-layout .sidebar-footer {
  margin-top: 16px;
  padding: 14px 3px 0;
  border-top: 1px solid var(--line);
}
.os-layout .crm-return-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--action);
  background: var(--action-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.os-layout .crm-return-link:hover {
  background: var(--nav-soft);
  color: var(--ink);
}
.os-layout .profile {
  padding: 3px 0;
  gap: 10px;
  border: 0;
}
.os-layout .avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--action-soft);
  color: var(--action);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.os-layout .profile-link {
  flex: 1;
  min-width: 0;
  color: var(--ink);
}
.os-layout .profile-link strong {
  max-width: 145px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
}
.os-layout .profile-link small {
  font-size: 10px;
  color: var(--muted);
}
.os-layout .profile .icon-button {
  width: 32px;
  height: 34px;
  color: var(--muted);
}
.os-layout .platform-signature {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 17px;
}
.os-layout .powered-brand {
  display: block;
  min-width: 0;
}
.os-layout .powered-brand small {
  display: block;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 2px;
}
.os-layout .shell-logo-powered {
  width: 113px;
}
.os-layout .shell-version {
  font-size: 9px;
  color: var(--muted);
  padding-bottom: 7px;
  white-space: nowrap;
}
.os-layout .topbar {
  height: 78px;
  padding: 0 38px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.os-layout .topbar-start {
  gap: 14px;
  min-width: 0;
}
.os-layout .mobile-brand {
  display: none;
}
.os-layout .breadcrumb {
  gap: 11px;
  min-width: 0;
  font-size: 11px;
  white-space: nowrap;
}
.os-layout .breadcrumb .breadcrumb-workspace {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.os-layout .breadcrumb .breadcrumb-page {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-layout .breadcrumb .icon {
  width: 11px;
  height: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.os-layout .topbar-right {
  gap: 15px;
  flex-shrink: 0;
}
.os-layout .global-search {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  padding: 10px 13px;
  font-size: 11px;
  min-height: 40px;
}
.os-layout .global-search:hover {
  border-color: var(--action);
  color: var(--ink);
}
.os-layout .global-search .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.os-layout .global-search kbd {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 16px;
  font-size: 9px;
  color: var(--muted);
}
.os-layout .icon-button {
  border-radius: 11px;
}
.os-layout .icon-button:hover {
  background: var(--nav-soft);
}
.os-layout .notification-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--muted);
}
.os-layout .notification-button i {
  width: 5px;
  height: 5px;
  right: 7px;
  top: 7px;
  background: var(--action);
  box-shadow: 0 0 0 2px var(--surface);
}
.os-layout .demo-roles {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  background: var(--bg);
}
.os-layout .demo-roles button {
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
}
.os-layout .demo-roles button.active {
  background: var(--surface);
  color: var(--action);
  box-shadow: 0 1px 5px #162e4c0d;
}
.os-layout .main {
  padding: 36px 38px 40px;
  min-height: calc(100dvh - 150px);
}
.os-layout .workspace-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  background: var(--surface);
}
.os-layout .workspace-footer-brand {
  display: block;
  flex-shrink: 0;
  letter-spacing: 0;
}
.os-layout .shell-logo-footer {
  width: 128px;
}
.os-layout .workspace-footer-copy {
  flex: 1;
  font-size: 11px;
  color: var(--muted);
}
.os-layout .footer-dot {
  font-size: 10px;
  white-space: nowrap;
}
.os-layout .footer-dot:before {
  width: 5px;
  height: 5px;
  background: var(--action);
  margin-right: 7px;
}
.os-layout a:focus-visible,
.os-layout button:focus-visible,
.os-layout summary:focus-visible,
.os-layout select:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 3px;
}
@media (max-width: 1200px) {
  .os-layout {
    --workspace-sidebar-width: 246px;
  }
  .os-layout .sidebar {
    padding: 25px 14px 16px;
  }
  .os-layout .topbar {
    padding: 0 28px;
  }
  .os-layout .main {
    padding: 30px 28px 34px;
  }
  .os-layout .workspace-footer {
    padding: 18px 28px;
  }
  .os-layout .global-search span {
    display: none;
  }
  .os-layout .global-search kbd {
    margin-left: 1px;
  }
}
@media (max-width: 900px) {
  .os-layout .topbar-right {
    gap: 9px;
  }
  .os-layout .topbar {
    padding: 0 22px;
  }
  .os-layout .main {
    padding: 28px 22px 32px;
  }
  .os-layout .workspace-footer {
    padding: 16px 22px;
    gap: 16px;
  }
  .os-layout .workspace-footer-copy {
    display: none;
  }
}
@media (max-width: 760px) {
  .os-layout {
    display: block;
  }
  .os-layout .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: 286px;
    max-width: calc(100vw - 30px);
    height: 100dvh;
    padding: 24px 18px 18px;
    z-index: 40;
  }
  .os-layout .sidebar.open {
    display: flex;
    box-shadow: 16px 0 48px #112c4a26;
  }
  .os-layout .sidebar.open + .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #142f4f70;
    backdrop-filter: blur(3px);
  }
  .os-layout .sidebar .shell-brand {
    padding: 0 20px 0 6px !important;
  }
  .os-layout .sidebar-close {
    top: 25px;
    right: 9px;
    color: var(--muted);
  }
  .os-layout .topbar {
    height: auto;
    min-height: 72px;
    padding: 12px 18px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .os-layout .topbar-start {
    gap: 10px;
    flex: 1 0 201px;
    min-width: 0;
  }
  .os-layout .mobile-menu {
    display: grid;
    width: 34px;
    height: 38px;
    flex-shrink: 0;
    color: var(--ink);
  }
  .os-layout .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 190px;
    text-decoration: none;
    color: var(--ink);
  }
  .os-layout .shell-logo-mobile {
    width: 157px;
    flex-shrink: 0;
  }
  .os-layout .mobile-brand .brand-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    border-radius: 9px;
    font-size: 12px;
  }
  .os-layout .mobile-brand .company-brand-copy {
    font-size: 14px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .os-layout .mobile-brand .company-brand-copy small {
    font-size: 8px;
    margin-top: 3px;
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .os-layout .breadcrumb {
    display: none;
  }
  .os-layout .topbar-right {
    gap: 7px;
  }
  .os-layout .global-search {
    width: 34px;
    min-height: 34px;
    padding: 8px;
    justify-content: center;
    background: transparent;
    border: 0;
  }
  .os-layout .global-search kbd {
    display: none;
  }
  .os-layout .notification-button {
    width: 32px;
    height: 32px;
  }
  .os-layout .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
    border-radius: 10px;
  }
  .os-layout .demo-roles {
    padding: 2px;
  }
  .os-layout .demo-roles button {
    font-size: 9px;
    padding: 5px 6px;
  }
  .os-layout .main {
    padding: 25px 18px 28px;
    min-height: calc(100dvh - 145px);
  }
  .os-layout .workspace-footer {
    padding: 16px 18px;
    gap: 14px;
    justify-content: space-between;
  }
  .os-layout .shell-logo-footer {
    width: 109px;
  }
  .os-layout .footer-dot {
    font-size: 9px;
    white-space: normal;
    text-align: right;
  }
}
@media (max-width: 420px) {
  .os-layout .topbar-right:has(.demo-roles) {
    margin-left: 44px;
    justify-content: flex-end;
    flex: 1 0 calc(100% - 44px);
  }
  .os-layout .topbar {
    padding: 10px 14px;
  }
  .os-layout .main {
    padding: 22px 14px 25px;
  }
  .os-layout .workspace-footer {
    padding: 15px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .os-layout .nav button,
  .os-layout .nav-link,
  .os-layout .nav-group summary,
  .os-layout .nav-group summary .icon:last-child {
    transition: none;
  }
  .os-layout .sidebar-backdrop {
    backdrop-filter: none;
  }
}
