@charset "UTF-8";
/* Estrutura isolada, carregada por último. Classes próprias evitam a mistura com o menu horizontal anterior. */
.shell.portal-shell { --rail:4.75rem; display:grid; grid-template-columns:var(--rail) minmax(0,1fr); grid-template-rows:auto 1fr; min-height:100vh; background:var(--surface); }
.shell.portal-shell:has(.portal-disclosure[open]) { --rail:14.5rem; }
.portal-shell .portal-header.topbar { grid-column:1 / -1; position:relative; top:auto; display:flex; flex-wrap:nowrap; align-items:center; min-height:80px; padding:.75rem 2rem; gap:1.25rem; background:var(--surface); border-bottom:1px solid var(--line); z-index:21; }
.portal-shell .portal-header .brand { flex:0 0 auto; margin:0; padding:0; }
.brand-mark { background:var(--accent); color:var(--surface); border-radius:var(--r-1); }
.portal-shell .portal-header .brand-text strong,.portal-shell .portal-header .rail-user strong { color:var(--ink); }
.portal-shell .portal-header .brand-text small,.portal-shell .portal-header .rail-user span { color:var(--muted); }
.portal-shell .portal-header .topbar-ctx { display:flex; flex-wrap:nowrap; align-items:center; gap:.6rem; min-width:0; margin-right:auto; }
.portal-shell .portal-header .topbar-ctx form { min-width:0; }
.portal-shell .portal-header .topbar-ctx .btn { max-width:100%; }
.context-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.portal-shell .portal-header .rail-foot { flex:0 0 auto; margin:0; padding:0; border:0; max-width:18rem; color:var(--ink); }
.portal-shell .portal-header .rail-foot .avatar { flex:none; }
.portal-shell .portal-header form[action="/logout"] { flex:none; }
.avatar { color:var(--accent-ink); background:var(--accent-bg); border:1px solid var(--accent-line); }
.shell.portal-shell > .rail.portal-sidebar { grid-column:1; grid-row:2; position:sticky; top:0; align-self:start; inset-inline:auto; width:auto; height:100dvh; max-height:100dvh; min-height:0; display:flex; flex-direction:column; padding:.75rem; background:var(--surface); border:0; border-right:1px solid var(--line); overflow:auto; z-index:20; }
.portal-disclosure { margin:0 0 .75rem; position:static; flex:none; overflow:visible; }
.rail-toggle { display:flex; align-items:center; justify-content:center; gap:.6rem; width:100%; min-height:44px; padding:.6rem .4rem; border:1px solid var(--line); border-radius:var(--r-1); color:var(--ink-2); background:var(--surface); font-size:.875rem; list-style:none; white-space:nowrap; }
.rail-toggle::-webkit-details-marker { display:none; }
.rail-toggle-icon { flex:none; }
.portal-shell .portal-sidebar > .rail-nav { position:static; width:100%; max-height:none; display:flex; flex-direction:column; overflow:visible; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; gap:.35rem; }
.portal-shell .portal-sidebar .nav-link { color:var(--ink-2); border-radius:var(--r-1); min-height:44px; padding:.65rem .4rem; gap:.65rem; }
.portal-shell .portal-sidebar .nav-link:hover,.portal-shell .portal-sidebar .nav-link.is-active { background:var(--accent-bg); color:var(--accent-ink); }
.portal-shell .portal-sidebar .nav-index { flex:none; width:2rem; text-align:center; color:var(--muted); font-size:.8rem; }
.portal-shell .portal-sidebar .nav-link.is-active .nav-index { color:var(--accent-ink); }
.portal-shell .portal-sidebar .nav-label { min-width:0; white-space:normal; }
.portal-shell .portal-sidebar .nav-section { margin:0; }
.portal-shell .portal-sidebar .nav-section-title { color:var(--muted); margin:.9rem .4rem .35rem; }
.portal-sidebar:not(:has(.portal-disclosure[open])) :is(.nav-label,.nav-section-title,.rail-toggle-label) { display:none; }
.portal-sidebar:not(:has(.portal-disclosure[open])) .nav-link { justify-content:center; }
.portal-sidebar:not(:has(.portal-disclosure[open])) .nav-section { border-top:1px solid var(--line); padding-top:.35rem; }
.shell.portal-shell > .main.portal-main { grid-column:2; grid-row:2; margin:0; width:100%; background:var(--bg); }

@media (max-width:760px) {
  .shell.portal-shell,.shell.portal-shell:has(.portal-disclosure[open]) { --rail:4rem; }
  .portal-shell .portal-header.topbar { min-height:64px; padding:.5rem .65rem; gap:.5rem; }
  .portal-shell .portal-header .brand-text small,.portal-shell .portal-header .rail-user,.portal-shell .portal-header .rail-foot-go,.portal-shell .portal-header .tag { display:none; }
  .portal-shell .portal-header .brand { gap:.4rem; }
  .portal-shell .portal-header .brand-text { display:flex; }
  .portal-shell .portal-header .brand-text strong { font-size:.9rem; }
  .portal-shell .portal-header .brand-mark { width:1.8rem; height:1.8rem; }
  .portal-shell .portal-header .topbar-ctx { gap:.35rem; flex:1 1 auto; }
  .portal-shell .portal-header .topbar-ctx .btn { padding:.5rem; font-size:.75rem; max-width:10rem; }
  .portal-shell .portal-header .rail-foot .avatar { width:1.75rem; height:1.75rem; }
  .portal-shell .portal-header form[action="/logout"] .btn { padding:.5rem; font-size:.75rem; }
  .shell.portal-shell > .rail.portal-sidebar { width:4rem; padding:.5rem; }
  .shell.portal-shell > .rail.portal-sidebar:has(.portal-disclosure[open]) { width:min(14.5rem,calc(100vw - 4rem)); box-shadow:var(--sh-3); }
}
@media (min-width:761px) and (max-width:1100px) {
  .portal-shell .portal-header.topbar { padding:.65rem 1rem; gap:.75rem; }
  .portal-shell .portal-header .brand-text small,.portal-shell .portal-header .rail-user,.portal-shell .portal-header .rail-foot-go,.portal-shell .portal-header .tag { display:none; }
  .portal-shell .portal-header .topbar-ctx .btn { max-width:22rem; }
}
@media (max-width:450px) {
  .portal-shell .portal-header .topbar-ctx .btn { max-width:7rem; }
  .portal-shell .portal-header .brand-text { display:none; }
  .content { padding:1.25rem .75rem 3rem; }
}

.portal-shell .portal-header { justify-content:flex-start; backdrop-filter:none; }
.portal-shell .portal-sidebar { gap:0; justify-content:flex-start; align-items:stretch; }
.shell.portal-shell > .rail.portal-sidebar { height:calc(100dvh - 5rem); max-height:calc(100dvh - 5rem); }
.portal-shell .portal-disclosure { flex:0 0 auto; min-height:auto; }
.portal-shell .portal-sidebar > .rail-nav { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.portal-shell .rail-toggle { list-style:none; }
.portal-shell .rail-toggle::marker { content:""; }
.portal-shell .rail-toggle:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.portal-shell .portal-sidebar .nav-link.is-active::before { display:none; }
.portal-shell .portal-sidebar :is(.nav-link:hover,.nav-link.is-active) .nav-index { color:var(--accent-ink); }
.portal-shell .portal-header .rail-user { min-width:0; }
.portal-shell .portal-header .rail-foot { max-width:14rem; flex-shrink:1; }
.portal-shell .portal-header .tag { max-width:12rem; overflow:hidden; }
@media print { .shell.portal-shell { display:block; } .portal-shell .portal-sidebar,.portal-shell .portal-header { display:none !important; } }
@media (min-width:761px) and (max-width:1020px) { .shell.portal-shell > .rail.portal-sidebar { height:calc(100dvh - 9rem); max-height:calc(100dvh - 9rem); } }
@media (max-width:760px) { .shell.portal-shell > .rail.portal-sidebar { height:calc(100dvh - 8rem); max-height:calc(100dvh - 8rem); } }
@media (forced-colors:active) { .portal-shell .rail-toggle:focus-visible { outline-color:Highlight; } }
