/* 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; } }

/* Company workspace: floating glass header. Platform uses its own layout. */
.shell-header { isolation:isolate; margin:17px 28px 0; border:1px solid #dbeafb; border-radius:25px; background:radial-gradient(ellipse 12% 90% at 90% 0%,#fffffff0,transparent),radial-gradient(ellipse 12% 90% at 80% 100%,#eedcfdc0,transparent),radial-gradient(ellipse 10% 80% at 8% 100%,#d6e8ffc0,transparent),radial-gradient(ellipse 12% 60% at 20% 100%,#f0eaffa0,transparent),radial-gradient(ellipse 10% 90% at 35% 0%,#ffffffc0,transparent),radial-gradient(ellipse 16% 100% at 6% 0%,#ffffffc0,transparent),radial-gradient(ellipse 15% 120% at 24% 10%,#dbe8ffb0,transparent),radial-gradient(ellipse 12% 110% at 45% 12%,#e0dfffa0,transparent),radial-gradient(ellipse 17% 110% at 80% 0%,#fce9ffb0,transparent),linear-gradient(100deg,#e1f1fe,#dff7fd 36%,#edf2ff 57%,#e5f5ff 75%,#effaff); box-shadow:0 7px 20px #4388c319,inset 0 1px 0 #fff; }
.shell-header::before,.shell-header::after { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; border-radius:inherit; opacity:.6; }
.shell-header::before { opacity:.65; background:linear-gradient(118deg,transparent 7%,#c8dcff40 18%,#ffffffa0 30%,#c7efff60 45%,#ffffffa0 62%,transparent 87%); clip-path:polygon(0 0,53% 0,49% 36%,46% 62%,43% 77%,39% 87%,35% 96%,31% 100%,19% 100%,23% 74%,27% 42%,31% 0,0 0); }
.shell-header::after { opacity:.55; background:linear-gradient(112deg,transparent 24%,#d5e7ff90 44%,#ded0fa30 63%,#ffffffa0 78%,transparent 96%); clip-path:polygon(38% 100%,58% 0,65% 0,62% 33%,60% 59%,58% 81%,55% 100%,67% 100%,76% 0,85% 0,82% 40%,79% 69%,77% 83%,74% 96%,71% 100%); }
.shell-topbar { min-height:104px; padding:16px 24px; gap:22px; border-radius:inherit; background:transparent; }
.shell-header svg { width:25px; height:25px; }
.shell-brand { position:relative; padding-right:24px; border-right:0; gap:14px; }
.shell-brand::after { content:""; position:absolute; right:0; top:50%; transform:translateY(-50%); width:1px; height:50px; background:#c6d9ed; }
.shell-brand-mark { width:66px; height:66px; font-size:58px; border-radius:16px; }
.shell-brand strong { font-size:22px; font-weight:800; line-height:1.15; }
.shell-brand small { font-size:14px; line-height:1.25; }
.shell-navigation { gap:6px; align-items:center; justify-content:flex-start; padding-right:12px; }
.shell-tab { min-height:60px; padding:10px; gap:8px; font-size:15px!important; font-weight:600!important; border-radius:16px; }
.shell-tab > svg { box-sizing:border-box; width:40px; height:40px; padding:7px; border-radius:9px; stroke-width:2; }
.shell-dashboard:not(.is-active) > svg,.shell-group:not(.is-active) > summary > svg { padding:5px; }
.shell-chevron { margin-left:3px; width:8px; height:8px; flex-shrink:0; font-size:0; line-height:1; }
.shell-chevron::before { content:""; display:block; width:6px; height:6px; margin-top:-2px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
.shell-dashboard > svg { color:#006aff; fill:currentColor; }
.shell-tab.is-active,.shell-group.is-active > summary { color:#0064f5!important; background:#ffffffed; box-shadow:0 8px 20px #3686d523,inset 0 1px 0 #fff; }
.shell-tab.is-active > svg,.shell-group.is-active > summary > svg { background:#086aff; color:white; }
.shell-group[data-shell-group="payroll"].is-active > summary > svg { padding:2px; background:transparent; }
.shell-group[data-shell-group="payroll"].is-active > summary > svg > rect { fill:#086aff; stroke:none; }
.shell-group[data-shell-group="payroll"].is-active > summary > svg > path { stroke:#fff; stroke-width:1.4; }
.shell-header .shell-search { width:208px; height:60px; border:1px solid #d1deef; border-radius:30px!important; justify-content:flex-start; padding:0 18px; gap:12px; background:rgba(255,255,255,.65); font-size:15px!important; box-shadow:none; }
.shell-actions { gap:12px; margin-left:auto; }
.shell-icon { width:40px; height:44px; }
.shell-icon > svg { width:26px; height:26px; stroke-width:1.8; }
@media(min-width:1751px) {
    .shell-icon > svg,.shell-header .shell-search > svg { width:30px; height:30px; }
    .shell-header .shell-search > svg { color:var(--shell-ink); }
}
.shell-badge { right:0; top:-2px; }
.shell-account { padding-left:22px; margin-left:6px; border-left:0; }
.shell-account::before { content:""; position:absolute; left:0; top:50%; transform:translateY(-50%); width:1px; height:48px; background:#d3dcee; }
.shell-avatar { width:50px; height:50px; flex-shrink:0; }
.shell-company-logo { background:transparent; border-radius:8px; }
.shell-company-logo img { object-fit:contain; }
.shell-identity { max-width:175px; }
.shell-identity strong { font-size:15px; font-weight:600; }
.shell-identity small { font-size:13px; }
.shell-account-panel,.shell-menu { border-radius:16px; }
.shell-menu a { font-size:13px; }
html[data-theme="dark"] .shell-header { background:linear-gradient(115deg,#132131,#1b2b43); border-color:var(--shell-line); }
html[data-theme="dark"] .shell-header::before,html[data-theme="dark"] .shell-header::after { opacity:.2; }
html[data-theme="dark"] .shell-tab.is-active,html[data-theme="dark"] .shell-group.is-active > summary { background:#233c59; color:#9bc9ff!important; }
html[data-theme="dark"] .shell-search { background:var(--shell-paper); }
/* Measured 2048px reference rhythm; narrower screens retain their compact rules. */
@media(min-width:2000px) {
    .shell-topbar { gap:20px; }
    .shell-brand { width:278px; padding-right:36px; gap:16px; }
    .shell-brand::after { height:46px; }
    .shell-navigation { gap:0; padding-right:0; }
    .shell-dashboard { width:145px; padding-inline:6px; }
    .shell-group[data-shell-group="employee"] > summary { width:172px; }
    .shell-group[data-shell-group="hiring"] > summary { width:151px; }
    .shell-group[data-shell-group="payroll"] > summary { width:158px; padding-inline:14px; gap:9px; }
    .shell-group[data-shell-group="policy"] > summary { width:146px; }
    .shell-group[data-shell-group="self"] > summary { width:145px; }
    .shell-actions { gap:20px; }
    .shell-account { width:258px; padding-left:24px; margin-left:0; }
    .shell-account > summary { gap:12px; }
    .shell-avatar { width:48px; height:48px; }
    .shell-identity { width:154px; max-width:154px; }
    .shell-account .shell-chevron { width:8px; margin-left:0; }
}
@media(max-width:1750px) {
    .shell-topbar { gap:12px; padding-inline:18px; }
    .shell-brand { padding-right:16px; gap:10px; }
    .shell-brand-mark { width:54px; height:58px; font-size:49px; }
    .shell-brand strong { font-size:18px; }
    .shell-brand small { font-size:11px; }
    .shell-tab { padding-inline:9px; gap:5px; font-size:14px!important; }
    .shell-navigation { gap:3px; }
    .shell-header .shell-search { width:160px; }
    .shell-actions { gap:5px; }
    .shell-account { padding-left:12px; }
    .shell-identity { max-width:130px; }
}
@media(min-width:1151px) and (max-width:1450px) {
    .shell-header { margin-inline:20px; }
    .shell-topbar { min-height:100px; gap:8px; padding-inline:14px; }
    .shell-brand { padding-right:12px; }
    .shell-brand-mark { width:46px; height:50px; font-size:43px; }
    .shell-brand strong { font-size:16px; }
    .shell-brand small { font-size:10px; }
    .shell-tab { min-height:60px; font-size:13px!important; gap:4px; padding-inline:7px; }
    .shell-tab > svg { width:32px; height:32px; padding:5px; }
    .shell-header .shell-search { width:118px; padding-inline:12px; }
    .shell-icon { width:32px; }
    .shell-identity { max-width:108px; }
    .shell-identity strong { font-size:12px; }
    .shell-identity small { font-size:11px; }
    .shell-account > summary { gap:7px; }
    .shell-avatar { width:36px; height:36px; }
}
@media(max-width:1150px) {
    .shell-header { margin:14px 18px 0; border-radius:22px; }
    .shell-topbar { min-height:90px; }
    .shell-brand { border:0; padding:0; }
    .shell-brand::after { display:none; }
    .shell-navigation.is-open { display:block; }
    .shell-tab { min-height:48px; font-size:15px!important; }
    .shell-tab > svg { width:32px; height:32px; padding:5px; }
    .shell-header .shell-search { width:160px; }
}
@media(max-width:600px) {
    .shell-header { margin:10px 10px 0; border-radius:20px; }
    .shell-topbar { min-height:76px; gap:5px; padding:10px; }
    .shell-brand { gap:7px; }
    .shell-brand-mark { width:34px; height:38px; font-size:33px; border-radius:10px; }
    .shell-brand strong { font-size:13px; }
    .shell-brand small { font-size:8px; }
    .shell-actions { gap:0; }
    .shell-icon,.shell-search { width:30px; height:36px; padding:0; }
    .shell-header .shell-search { width:30px; height:36px; padding:0; background:transparent; justify-content:center; }
    .shell-header svg { width:21px; height:21px; }
    .shell-account { padding-left:6px; margin-left:3px; }
    .shell-account::before { height:30px; }
    .shell-avatar { width:30px; height:30px; }
    .shell-account-panel { max-width:calc(100vw - 42px); }
}
@media(min-width:601px) and (max-width:900px) {
    .shell-topbar { gap:8px; padding-inline:14px; }
    .shell-brand-mark { width:44px; height:48px; font-size:42px; }
    .shell-brand strong { font-size:16px; }
    .shell-brand small { font-size:10px; }
    .shell-header .shell-search { width:112px; padding-inline:10px; }
    .shell-icon { width:32px; }
    .shell-actions { gap:3px; }
    .shell-account { padding-left:8px; margin-left:3px; }
    .shell-account > summary { gap:7px; }
    .shell-avatar { width:34px; height:34px; }
    .shell-identity { max-width:102px; }
    .shell-identity strong { font-size:12px; }
    .shell-identity small { font-size:11px; }
}
