/* Application shell: navy brand bar with leaf strip, white sidebar, phone drawer. */
.workspace-body { margin: 0; }

.brandbar { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; }
.brandbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; padding: .6rem clamp(1rem, 2.5vw, 2rem); }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 6px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font: 600 1rem/1.15 var(--font-display); letter-spacing: .01em; }
.brand-text small { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #c9cdf0; }
.brand-account { margin-left: auto; display: inline-flex; align-items: center; gap: .6rem; color: #e1e4fa; text-decoration: none; font-size: .88rem; min-width: 0; }
.brand-account:hover { color: #fff; }
.brand-account span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #3a42a0; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.leaf-strip { height: 4px; background: linear-gradient(90deg, var(--leaf) 0 28%, var(--teal) 28% 50%, var(--sky) 50% 76%, var(--sun) 76% 100%); }
.menu-button { display: none; width: 44px; height: 44px; border-radius: var(--r-tight); border: 1px solid #4e56b0; background: transparent; color: #fff; font-size: 1.35rem; align-items: center; justify-content: center; }
.menu-button:hover { background: rgba(255, 255, 255, .08); }
.brandbar :focus-visible { outline-color: #f5b27a; }

.workspace-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.workspace-sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .85rem 2rem; }
.drawer-header { display: none; }
.nav-section-label { margin: 1.35rem .75rem .4rem; font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; color: var(--muted); }
.nav-section-label:first-child { margin-top: 0; }
.workspace-nav-link { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 40px; padding: .5rem .75rem; margin: .1rem 0; border: 0; border-radius: 8px; background: transparent; text-align: left; text-decoration: none; font-size: .9rem; color: var(--ink); }
.workspace-nav-link .bi { font-size: 1.05rem; color: var(--muted); width: 1.1rem; text-align: center; }
.workspace-nav-link:hover { background: var(--page); color: var(--ink); }
.workspace-nav-link.is-active { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.workspace-nav-link.is-active .bi { color: var(--navy); }
.workspace-sidebar form.button_to { margin: 0; }
.advanced-navigation { margin: .35rem .1rem; font-size: .85rem; }
.advanced-navigation summary { padding: .45rem .65rem; color: var(--muted); border-radius: 8px; cursor: pointer; }
.advanced-navigation summary:hover { background: var(--page); }
.drawer-backdrop { display: none; }

.workspace-main { min-width: 0; width: 100%; max-width: 1400px; padding: clamp(1.25rem, 3.5vw, 2.75rem) clamp(1rem, 3.5vw, 3rem) 4rem; }

@media (max-width: 900px) { .workspace-shell { grid-template-columns: 215px minmax(0, 1fr); } }

/* Phones: the sidebar becomes a slide-in drawer when JavaScript is available; without it the navigation stays visible above the content. */
@media (max-width: 767px) {
  .brandbar-inner { min-height: 58px; padding-block: .45rem; }
  .brand-logo { width: 36px; height: 36px; padding: 5px; }
  .brand-account span:not(.avatar) { display: none; }
  .workspace-shell { display: block; }
  html:not(.js) .workspace-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  html.js .menu-button { display: inline-flex; }
  html.js .brand-account { margin-left: auto; }
  html.js .brand-account + .menu-button { margin-left: 0; }
  html.js .workspace-sidebar { position: fixed; inset: 0 0 0 auto; z-index: 80; width: min(320px, 88vw); overflow-y: auto; border-right: 0; box-shadow: -20px 0 45px rgba(15, 20, 50, .2); transform: translateX(100%); visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s; padding-top: 1rem; }
  html.js .drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 .25rem 1rem; }
  html.js .drawer-header strong { font-family: var(--font-display); font-size: 1rem; }
  .drawer-close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-tight); background: var(--surface); color: var(--ink); font-size: 1.1rem; }
  html.js .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15, 20, 50, .45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  html.js .nav-open .workspace-sidebar { transform: translateX(0); visibility: visible; transition: transform .24s ease; }
  html.js .nav-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .workspace-nav-link { min-height: 44px; }
}
