/* Shared desktop/mobile shell. Existing navigation and permissions remain authoritative. */
body.layout-signed{--layout-navy:#08264a;--layout-side:232px;background:#f4f6f9}
body.layout-signed>header{background:var(--layout-navy)!important;gap:10px;padding:10px 20px!important;min-height:70px;box-sizing:border-box}
body.layout-signed #ux-mobile-toggle{display:block!important;order:-1!important;width:auto;max-width:100%;min-height:44px;background:transparent;color:#fff;border:1px solid #fff5;padding:8px 12px}
body.layout-signed #menu-toggle{display:none!important}
body.layout-signed #dash-nav button.active,body.layout-signed #nav button.active{background:#dceaf9!important;color:#08264a!important;border-left:4px solid #2670ae}
body.layout-signed .qedit-table th{background:#08264a}
body.layout-signed .layout-open-pdf{display:inline-flex;align-items:center;min-height:46px;padding:10px 15px;background:#08264a;color:white;border-radius:7px}
@media(min-width:1000px){
 body.layout-signed #dash-nav,body.layout-signed:not(.dash-office) #nav{position:fixed!important;top:var(--layout-header-height,70px);bottom:0;left:0;width:var(--layout-side)!important;max-height:none!important;overflow-y:auto!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;flex-wrap:nowrap!important;gap:4px!important;padding:14px 10px!important;margin:0!important;box-sizing:border-box;background:#fff!important;border-right:1px solid #d9e1ea;z-index:40}
 body.layout-signed #dash-nav>button,body.layout-signed #nav>button,body.layout-signed #dash-nav summary{display:block!important;flex:none!important;text-align:left;color:#243c54;background:transparent;min-height:44px;font-size:1rem!important;padding:10px 12px!important;white-space:normal}
 body.layout-signed #dash-nav .dash-more>div{position:static!important;display:block;width:auto!important;max-width:none!important;max-height:none!important;box-shadow:none;border:0;padding:4px 6px!important}
 body.layout-signed #dash-nav .dash-more:not([open])>div{display:none!important}
 body.layout-signed .dash-more section{margin:10px 0}
 body.layout-signed .shell{display:block;margin-left:var(--layout-side)}
 body.layout-signed #wf-global{margin-left:var(--layout-side);padding:10px 24px}
 body.layout-signed.layout-nav-hidden .shell,body.layout-signed.layout-nav-hidden #wf-global{margin-left:0}
 body.layout-signed.layout-nav-hidden #dash-nav,body.layout-signed.layout-nav-hidden:not(.dash-office) #nav{display:none!important}
 body.layout-signed #wf-drawer{width:min(1450px,96vw);max-width:96vw}
 body.layout-signed .dash-areas{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.layout-signed #wf-modal:has(.qedit-form)>section{width:min(1500px,96vw);max-width:96vw}
}
@media(max-width:999px){
 body.layout-signed>header{padding:8px 12px!important;min-height:68px;flex-wrap:wrap!important}
 body.layout-signed header>img{max-height:42px;width:auto}
 body.layout-signed #q7-brief{font-size:11px}
 body.layout-signed #ux-mobile-toggle{font-size:.95rem}
 body.layout-signed .ux-mobile-navigation{display:none!important}
 body.layout-signed.ux-menu-open .ux-mobile-navigation{display:flex!important;position:fixed!important;top:var(--layout-header-height,108px);left:0;bottom:0;max-height:calc(100dvh - var(--layout-header-height,108px))!important;width:min(310px,85vw)!important;overflow:auto!important;flex-direction:column!important;flex-wrap:nowrap!important;align-items:stretch!important;gap:5px!important;padding:14px!important;background:#fff!important;color:#243c54;box-shadow:18px 0 60px #08264a55;z-index:80;margin:0!important;box-sizing:border-box}
 body.layout-signed .ux-mobile-navigation button,body.layout-signed .ux-mobile-navigation summary{color:#243c54!important;text-align:left;flex:none!important;min-height:46px;width:100%;white-space:normal;background:#fff!important;font-size:1rem!important}
 body.layout-signed .ux-mobile-navigation .dash-more>div{position:static!important;display:block;max-width:none!important;width:auto!important;max-height:none;padding:8px!important;border:0;box-shadow:none}
 body.layout-signed .ux-mobile-navigation .dash-more:not([open])>div{display:none!important}
 body.layout-signed .shell{display:block;margin:0}
 body.layout-signed main{padding:12px!important}
 body.layout-signed .dash-areas,body.layout-signed .dash-columns{grid-template-columns:1fr}
 body.layout-signed .dash-metric strong{font-size:1.4rem}
 body.layout-signed .qedit-actions{position:static!important;display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important;padding:10px 0!important;box-shadow:none}
 body.layout-signed .qedit-actions .q7-mini{grid-column:1/-1;font-size:.85rem;padding:8px;line-height:1.4}
 body.layout-signed .qedit-actions .qdoc-language{margin:0!important;display:flex;align-items:center;gap:5px;font-size:.85rem;min-width:0}
 body.layout-signed .qedit-actions select{width:100%;min-width:0;min-height:44px}
 body.layout-signed .qedit-actions button{min-width:0;min-height:46px;font-size:.9rem;white-space:normal;margin:0}
 body.layout-signed .qedit-form{scroll-padding-bottom:16px;padding-bottom:16px}
 body.layout-signed .q7-total{position:static!important}
 body.layout-signed #wf-modal:has(.qedit-form)>section{width:100%;max-width:100%;max-height:96dvh;padding:14px}
 body.layout-signed #wf-modal:has(.qedit-form){padding:8px}
 body.layout-signed .qc-reference .qc-info{max-height:none!important;overflow:visible!important}
 body.layout-signed #qdoc-pdf iframe{display:none}
}

.layout-quote{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid #dce2e9}.layout-quote>div{min-width:0;overflow-wrap:anywhere}.layout-quote p{margin:6px 0}.layout-quote button{flex-shrink:0}@media(max-width:600px){.layout-quote{align-items:flex-start;flex-direction:column}.layout-quote button{width:100%}}

/* Override legacy #dash-nav {position:static!important}: keep the drawer out of header flow. */
@media(max-width:999px){
 body.layout-signed.ux-menu-open #dash-nav.ux-mobile-navigation,body.layout-signed.ux-menu-open #nav.ux-mobile-navigation{position:fixed!important;top:var(--layout-header-height,108px)!important;bottom:0!important;left:0!important;right:auto!important;height:auto!important;max-height:calc(100dvh - var(--layout-header-height,108px))!important;overflow-y:auto!important;overflow-x:hidden!important}
}
.layout-nav-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;vertical-align:middle;margin-right:10px;color:currentColor}
.layout-nav-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:1000px){
 body.layout-signed.layout-nav-hidden{--layout-side:72px}
 body.layout-signed.layout-nav-hidden .shell,body.layout-signed.layout-nav-hidden #wf-global{margin-left:var(--layout-side)}
 body.layout-signed.layout-nav-hidden #dash-nav,body.layout-signed.layout-nav-hidden:not(.dash-office) #nav{display:flex!important;width:var(--layout-side)!important;overflow-x:hidden!important}
 body.layout-signed #dash-nav>button,body.layout-signed #dash-nav>details>summary{display:flex!important;align-items:center}
 body.layout-signed.layout-nav-hidden #dash-nav>button,body.layout-signed.layout-nav-hidden #dash-nav>details>summary{justify-content:center;padding:10px 8px!important;min-height:46px;position:relative}
 body.layout-signed.layout-nav-hidden #dash-nav .layout-nav-label{position:absolute!important;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
 body.layout-signed.layout-nav-hidden #dash-nav .layout-nav-icon{margin:0}
 body.layout-signed.layout-nav-hidden #dash-nav .dash-more>div{display:none!important}
}

@media(min-width:1000px){body.layout-signed.layout-nav-hidden #nav>details>summary{display:none!important}body.layout-signed.layout-nav-hidden #nav button{display:flex;justify-content:center;align-items:center;min-height:46px;width:100%;padding:10px 8px!important}body.layout-signed.layout-nav-hidden #nav .layout-nav-label{position:absolute!important;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}body.layout-signed.layout-nav-hidden #nav .layout-nav-icon{margin:0}}

.layout-nav-label{color:inherit!important}
