/* Shared authenticated navigation. Page components keep their existing styling. */
body.rewise-top-shell { --sidebar-w: 0px; --shell-ink:#142b62; --shell-muted:#647797; --shell-line:#dfe8f4; --shell-paper:#fff; --shell-soft:#f1f7ff; --shell-blue:#0866ff; }
body.rewise-top-shell .application-shell { display:block!important; grid-template-columns: minmax(0,1fr)!important; }
body.rewise-top-shell .application-main { margin-left:0!important; width:100%!important; min-width:0; }
html:not([data-theme="dark"]) body.rewise-top-shell .application-shell,
html:not([data-theme="dark"]) body.rewise-top-shell .application-main { background:#f1f7fd!important; }
body.rewise-top-shell .page-content { padding-top:24px!important; max-width:1800px; }
.shell-header, .shell-header * { box-sizing:border-box; }
.shell-header { position:relative; z-index:100; color:var(--shell-ink); background:var(--shell-paper); border-bottom:1px solid var(--shell-line); box-shadow:0 4px 18px #1f4f8510; }
.shell-header a { text-decoration:none; color:inherit; }
.shell-header button, .shell-header summary { font:inherit; color:inherit; cursor:pointer; }
.shell-header svg { width:20px; height:20px; flex-shrink:0; }
.shell-header a:focus-visible, .shell-header button:focus-visible, .shell-header summary:focus-visible { outline:3px solid #56a5ff; outline-offset:3px; }
.shell-topbar { display:flex; align-items:center; gap:20px; padding:10px 24px; min-height:64px; background:linear-gradient(105deg,var(--shell-soft),var(--shell-paper) 48%); }
.shell-brand { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.shell-brand-mark { display:grid; place-items:center; width:38px; height:42px; border-radius:10px; font-size:35px; line-height:1; font-weight:800; color:#fff; background:linear-gradient(155deg,#1262ff 15%,#009cda 55%,#00c997); }
.shell-brand strong { display:block; font-size:16px; font-weight:800; letter-spacing:-.4px; }
.shell-brand small { display:block; font-size:10px; color:var(--shell-muted); margin-top:3px; }
.shell-search { display:flex; align-items:center; justify-content:center; gap:7px; flex-shrink:0; height:38px; padding:0 10px; border:1px solid #cbdcf2; border-radius:9px; background:var(--shell-paper); white-space:nowrap; font-size:12px!important; color:var(--shell-muted)!important; }
.shell-search:hover { background:var(--shell-soft); }
.shell-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.shell-icon { position:relative; display:grid; place-items:center; width:38px; height:38px; border:0; border-radius:9px; background:transparent; flex-shrink:0; }
.shell-icon:hover, .shell-tab:hover { background:var(--shell-soft); color:var(--shell-blue); }
.shell-badge { position:absolute; right:-2px; top:-3px; min-width:17px; border:2px solid var(--shell-paper); padding:1px 3px; border-radius:12px; background:#eb435d; color:#fff; font-size:9px; text-align:center; }
.shell-account { position:relative; margin-left:8px; }
.shell-header summary { list-style:none; }
.shell-header summary::-webkit-details-marker { display:none; }
.shell-account > summary { display:flex; align-items:center; gap:12px; }
.shell-avatar { display:grid; place-items:center; overflow:hidden; width:42px; height:42px; border-radius:50%; background:linear-gradient(145deg,#00b88a,#0093b5); color:#fff; font-size:20px; font-weight:700; }
.shell-avatar img { width:100%; height:100%; object-fit:cover; }
.shell-identity { min-width:0; max-width:150px; }
.shell-identity strong, .shell-identity small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shell-identity strong { font-size:12px; }
.shell-identity small { margin-top:4px; color:var(--shell-muted); font-size:11px; }
.shell-chevron { margin-left:auto; font-size:15px; }
.shell-account-panel { position:absolute; z-index:3; right:0; top:calc(100% + 16px); width:260px; padding:16px; background:var(--shell-paper); border:1px solid var(--shell-line); box-shadow:0 15px 35px #17365222; border-radius:12px; }
.shell-account-panel > strong, .shell-account-panel > small { display:block; overflow-wrap:anywhere; }
.shell-account-panel > small { color:var(--shell-muted); font-size:11px; margin:4px 0 12px; }
.shell-account-panel a, .shell-account-panel button { display:block; width:100%; text-align:left; border:0; background:none; padding:10px 8px; border-radius:6px; font-size:12px; }
.shell-account-panel a:hover, .shell-account-panel button:hover { background:var(--shell-soft); }
.shell-navigation { display:flex; flex:1; align-items:stretch; justify-content:center; gap:4px; min-width:0; }
.shell-tab { display:flex; align-items:center; gap:9px; padding:11px 13px; min-height:42px; border-radius:7px; font-size:12px!important; font-weight:650!important; white-space:nowrap; }
.shell-tab.is-active, .shell-group.is-active > summary { color:#fff!important; background:linear-gradient(110deg,#078dff,#0757ed); box-shadow:0 3px 9px #087bff26; }
.shell-group[open]:not(.is-active) > summary { background:var(--shell-soft); color:var(--shell-blue); }
.shell-group { position:relative; }
.shell-menu { position:absolute; left:0; top:calc(100% + 6px); width:260px; max-width:calc(100vw - 32px); padding:8px; max-height:min(68vh,440px); overflow:auto; background:var(--shell-paper); border:1px solid var(--shell-line); border-radius:10px; box-shadow:0 14px 30px #20395624; }
.shell-group:last-child .shell-menu { left:auto; right:0; }
.shell-menu a { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:7px; font-size:12px; line-height:1.4; }
.shell-menu a svg { width:17px; height:17px; color:#5e82af; }
.shell-menu a:hover, .shell-menu a[aria-current] { background:var(--shell-soft); color:var(--shell-blue); }
.shell-menu a[aria-current] { font-weight:700; box-shadow:inset 3px 0 var(--shell-blue); }
.shell-mobile-toggle { display:none; }
.shell-skip { position:fixed; left:12px; top:-100px; z-index:9999; background:#fff; color:#164899; padding:12px; border-radius:6px; }
.shell-skip:focus { top:8px; }
html[data-theme="dark"] body.rewise-top-shell { --shell-ink:#d8e7ff; --shell-muted:#9eb1cb; --shell-line:#2a3d55; --shell-paper:#132131; --shell-soft:#1c3048; --shell-blue:#73adff; }
@media(max-width:1350px) {
    .shell-topbar { gap:16px; padding-inline:20px; }
    .shell-navigation { gap:2px; }
    .shell-tab { font-size:11px!important; padding-inline:9px; gap:6px; }
    .shell-tab svg { width:17px; height:17px; }
}
@media(max-width:1150px) {
    .shell-mobile-toggle { display:grid; }
    .shell-topbar { flex-wrap:wrap; gap:12px; padding:10px 16px; }
    .shell-brand { margin-right:auto; }
    .shell-navigation { display:none; order:4; flex-basis:100%; padding:10px 0 8px; max-height:70dvh; overflow:auto; border-top:1px solid var(--shell-line); }
    .shell-navigation.is-open { display:block; }
    .shell-tab { font-size:13px!important; padding:12px; }
    .shell-menu { position:static; width:100%; max-width:none; max-height:none; padding:6px; border-radius:10px; box-shadow:none; margin:4px 0 10px; }
}
@media(max-width:600px) {
    .shell-topbar { gap:8px; padding:10px 12px; }
    .shell-brand { gap:7px; }
    .shell-brand-mark { width:30px; height:34px; font-size:28px; }
    .shell-brand strong { font-size:13px; }
    .shell-brand small { font-size:8px; }
    .shell-actions { gap:1px; }
    .shell-icon { width:32px; height:36px; }
    .shell-identity, .shell-account .shell-chevron, .shell-launcher { display:none; }
    .shell-avatar { width:32px; height:32px; font-size:16px; }
    .shell-account { margin-left:4px; }
    .shell-search { width:32px; height:36px; padding:0; border-color:transparent; background:transparent; }
    .shell-search span { display:none; }
    .shell-account-panel { right:0; width:min(260px,calc(100vw - 24px)); }
    body.rewise-top-shell .page-content { padding-top:16px!important; }
}
@media(prefers-reduced-motion:reduce) { .shell-header * { scroll-behavior:auto; transition:none; } }
