.authenticated { --sidebar-width: 252px; }
.menu-collapsed .authenticated { --sidebar-width: 80px; }
.sidebar {
  width: var(--sidebar-width); background: linear-gradient(165deg, #153c55, #0c263b);
  position: fixed; inset: 0 auto 0 0; color: #fff; z-index: 40;
  padding: 24px 14px; display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 17px; letter-spacing: 1px; padding: 0 4px; }
.brand img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.brand b { display: block; font-size: 12px; font-weight: 400; color: #c2d5e2; }
.nav-label { color: #a5bece; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; margin: 34px 12px 14px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; color: #d7e4ee; padding: 13px; border-radius: 12px; font-size: 14px; min-height: 48px; }
.sidebar nav svg, .shell-button svg, .sidebar-toggle svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { background: #ffffff12; color: white; text-decoration: none; }
.sidebar nav a[aria-current="page"] { background: #ffffff20; color: #fff; box-shadow: inset 3px 0 #f3a451; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 32px 10px 0; font-size: 12px; color: #a9c1d1; }
.sidebar-foot small { font-size: 12px; color: inherit; }
.shell-button { min-width: 44px; min-height: 44px; padding: 10px; border-radius: 12px; border: 1px solid #dce5ed; background: #f8fafc; color: #284b65; gap: 8px; }
.shell-button:hover { background: #eaf1f7; color: #163e5a; }
.sidebar-toggle { margin-top: 24px; justify-content: flex-start; padding: 13px; color: #d7e4ee; background: #ffffff10; border: 1px solid #ffffff20; border-radius: 12px; gap: 13px; font-size: 14px; }
.sidebar-toggle:hover { background: #ffffff20; }
.menu-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.topbar { position: relative; inset: auto; height: auto; margin-left: var(--sidebar-width); background: #fff; border-bottom: 1px solid #e2e9f0; display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 18px 28px; min-width: 0; box-shadow: 0 3px 16px #13395205; }
.menu-toggle { flex-shrink: 0; }
.authenticated .topbar { position: sticky; top: 0; z-index: 20; }
html { scroll-padding-top: calc(var(--shell-header-height, 0px) + 16px); }
@media print { .authenticated .topbar { position: static; } }
.header-institution { min-width: 0; font-size: 12px; line-height: 1.65; color: #4c6278; }
.header-institution strong { display: block; font-size: 12px; color: #25455e; }
.header-institution span { display: block; }
.account { display: flex; align-items: center; gap: 16px; min-width: 0; max-width: 100%; margin-left: auto; }
.account-identity { min-width: 0; overflow-x: auto; padding: 3px 0; }
.account-name { display: block; white-space: nowrap; font-size: 14px; color: #28455c; }
.account small { display: block; font-size: 12px; }
.account form { margin: 0; flex-shrink: 0; }
.logout-button { padding-inline: 16px; }
.authenticated .main { margin: 0 0 0 var(--sidebar-width); padding: 32px 36px; min-height: calc(100vh - 170px); }
.authenticated .site-footer { margin-left: var(--sidebar-width); }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; background: #071c32a3; backdrop-filter: blur(3px); }
@media (max-width: 1250px) {
  .topbar { grid-template-columns: 44px minmax(0, 1fr); }
  .account { grid-column: 1 / -1; width: 100%; justify-content: space-between; border-top: 1px solid #edf1f5; padding-top: 12px; }
}
@media (min-width: 901px) {
  .menu-collapsed .brand span, .menu-collapsed .nav-label, .menu-collapsed .sidebar-foot { display: none; }
  .menu-collapsed .sidebar nav { margin-top: 30px; }
  .menu-collapsed .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 900px) {
  .authenticated, .menu-collapsed .authenticated { --sidebar-width: 0px; }
  .sidebar { width: min(290px, calc(100vw - 48px)); transform: translateX(-100%); visibility: hidden; }
  .menu-open .sidebar { transform: translateX(0); visibility: visible; }
  .menu-open { overflow: hidden; }
  .sidebar-toggle { display: none; }
  .topbar { padding: 16px 20px; gap: 12px; }
  .header-institution { flex-basis: calc(100% - 60px); min-width: 0; }
  .account { flex-basis: 100%; justify-content: space-between; border-top: 1px solid #edf1f5; padding-top: 12px; }
  .authenticated .main { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .account { gap: 10px; flex-wrap: wrap; }
  .account-identity { flex-basis: 100%; }
  .logout-button { min-height: 40px; padding: 7px 16px; }
}
