/* Flat, grouped navigation. The existing content layout and sidebar width stay intact. */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100dvh;
  background: #f7f9fc;
  border-right: 1px solid #e5eaf2;
  color: #273449;
}
.sidebar .brand {
  flex-shrink: 0;
  height: 80px;
  align-items: center;
  gap: 11px;
  padding: 18px 17px;
  color: #18263d;
}
.sidebar .brand .brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  margin: 0;
  border-radius: 11px;
  background: #2864e9;
  color: #fff;
}
.sidebar .brand .brand-mark .icon {width: 23px; height: 23px; stroke-width: 1.8;}
.sidebar .brand strong {font-size: 18px; font-weight: 700; letter-spacing: -.3px;}
.sidebar .brand > div > span {margin-top: 4px; font: 600 9px Arial,sans-serif; letter-spacing: 1.3px; color: #61718a;}
.workspace-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  margin: 0 12px 18px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e4eaf3;
  border-radius: 12px;
}
.workspace-card > .icon {width: 28px; height: 28px; padding: 4px; border-radius: 8px; color: #536784; background: #f0f3f9;}
.workspace-card > div {flex: 1; min-width: 0;}
.workspace-card strong {display: block; font-size: 13px; font-weight: 600; color: #27364e; white-space: nowrap;}
.workspace-card > div > span {display: block; margin-top: 4px; font-size: 11px; color: #61718a; white-space: nowrap;}
.workspace-badge {padding: 3px 5px; border: 1px solid #e1e7f1; border-radius: 5px; font-size: 10px; color: #61718a; background: #f8faff;}
.sidebar .nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 12px 5px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e4 transparent;
}
.nav-section {margin-bottom: 15px;}
.sidebar .nav-section-label {margin: 0 8px 8px; font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .5px; color: #61718a;}
.nav-section-card {padding: 5px; border: 1px solid #e7ecf4; border-radius: 12px; background: #fff;}
.sidebar .nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 1px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #4f5e74;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  transition: color 150ms, background-color 150ms, border-color 150ms;
}
.sidebar .nav .nav-link > .icon {width: 19px; height: 19px; stroke-width: 1.7; color: #77869d;}
.nav-label {flex: 1; min-width: 0;}
.sidebar .nav .nav-link:hover {background: #f3f6fb; color: #243957;}
.sidebar .nav .nav-link.active {background: #edf3ff; border-color: #dfe9fc; color: #2459d3; font-weight: 600;}
.sidebar .nav .nav-link.active:hover {background: #e6eeff;}
.sidebar .nav .nav-link.active > .icon {color: #2c65df;}
.nav-active-dot {width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #3670ec; opacity: 0;}
.nav-link.active .nav-active-dot {opacity: 1;}
.sidebar .nav .nav-link > .nav-chevron {width: 13px; height: 13px; margin-left: auto; transition: transform 150ms;}
.sidebar .nav .nav-link[aria-expanded=true] > .nav-chevron {transform: rotate(90deg);}
.sidebar .nav .subnav {padding: 0 0 0 10px; margin: 3px 5px 7px 20px; border-left: 1px solid #dce4f0;}
.sidebar .nav .subnav a {min-height: 44px; padding: 8px; margin: 0; gap: 8px; border-radius: 7px; font-size: 12px; font-weight: 400; color: #586a84; background: transparent; box-shadow: none; transition: background-color 150ms, color 150ms;}
.sidebar .nav .subnav a:hover {background: #f3f6fb; color: #244da1;}
.sidebar .nav .subnav a.active {color: #2459d3; background: #eff4ff; font-weight: 600;}
.subnav-dot {flex: 0 0 4px; height: 4px; border-radius: 50%; background: #a6b5cb;}
.subnav a.active .subnav-dot {background: #3670ec;}
.sidebar .side-foot {flex-shrink: 0; margin: 0; padding: 6px 12px 12px; border-top: 1px solid #e7ecf3; background: #f7f9fc;}
.sidebar-help {display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 9px 10px; border: 0; border-radius: 9px; color: #60718b; background: transparent; font-size: 12px; text-align: left;}
.sidebar-help > .icon {width: 17px; height: 17px;}
.sidebar-help > .icon:last-child {width: 13px; height: 13px; margin-left: auto;}
.sidebar-help:hover {color: #2459d3; background: #eaf0fb;}
.sidebar-account {display: flex; align-items: center; gap: 10px; width: 100%; min-height: 61px; padding: 10px; border: 1px solid #e2e8f2; border-radius: 12px; color: #27364e; background: #fff; text-align: left; transition: border-color 150ms, background-color 150ms;}
.sidebar-account:hover {border-color: #bfd0ef; background: #fbfcff;}
.sidebar-avatar {display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: #eaf0fe; color: #345dc5; font-size: 15px; font-weight: 600;}
.sidebar-account-copy {display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0;}
.sidebar-account-copy strong {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600;}
.sidebar-account-copy > span {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #61718a;}
.sidebar-account > .icon {width: 14px; height: 14px; color: #7e8ca2;}
.sidebar :is(a,button):focus-visible {outline: 2px solid #4c7ceb; outline-offset: 2px;}
@media(max-width: 1020px) {
  .sidebar .brand {padding: 18px 12px; gap: 8px;}
  .sidebar .brand strong {font-size: 16px;}
  .sidebar .brand .brand-mark {flex-basis: 32px; height: 32px;}
  .sidebar .brand > div > span {font-size: 8px; letter-spacing: .9px;}
  .workspace-card {gap: 7px; padding: 8px;}
  .workspace-card strong {font-size: 12px;}
  .workspace-card > .icon {width: 24px; height: 24px;}
  .workspace-badge {font-size: 9px; padding: 3px;}
  .sidebar .nav .nav-link {gap: 8px; padding: 9px 7px; font-size: 13px;}
  .sidebar .nav .nav-link > .icon {width: 18px; height: 18px;}
  .sidebar .nav .subnav {margin-left: 15px; padding-left: 5px;}
  .sidebar .nav .subnav a {padding: 8px 5px;}
}
@media(max-width: 760px) {
  .sidebar {width: min(280px, calc(100vw - 48px));}
  .sidebar.open {box-shadow: 12px 0 32px #122e5214;}
  .sidebar .brand {padding: 18px 20px; gap: 12px;}
  .sidebar .brand strong {font-size: 18px;}
  .sidebar .brand > div > span {font-size: 9px; letter-spacing: 1.3px;}
  .sidebar .nav .nav-link {padding: 9px 12px; font-size: 14px; gap: 12px;}
  .sidebar .nav .subnav a {font-size: 13px;}
  .workspace-card {padding: 10px 12px;}
  .workspace-card strong {font-size: 13px;}
  .workspace-badge {font-size: 10px; padding: 3px 6px;}
}
@media(prefers-reduced-motion: reduce) {
  .sidebar, .sidebar * {transition: none !important;}
}
