/* Authorized workspace-only redesign. Load after styles.css; lobby/login unchanged. */
.app-shell{--workspace-blue:#2458a6;--workspace-ink:#20344f;--workspace-muted:#61718a;--workspace-line:#e0e6ef;--workspace-bg:#f3f4fa;--sidebar:208px;background:var(--workspace-bg);color:var(--workspace-ink)}
.app-shell :is(.workspace,.page,.portal-home,.portal-orders,.portal-files,.home-grid,.home-main,.home-context){min-width:0}
.app-shell .page{max-width:1600px;margin-inline:auto;padding:24px 16px 104px;width:100%}
.app-shell .sidebar{background:#fff;border-right:1px solid var(--workspace-line)}
.app-shell .sidebar :is(a,button){min-height:44px}
.app-shell .sidebar :is(.nav-link,.nav-item){border-radius:12px;margin-block:4px;font-size:14px}
.app-shell .sidebar :is(.nav-link,.nav-item).active{background:#edf1ff;color:var(--workspace-blue)}
.app-shell .topbar{background:#fff;border-bottom:1px solid var(--workspace-line);min-height:76px;height:auto;padding:14px 16px;gap:12px;flex-wrap:wrap}
.app-shell .topbar :is(.breadcrumb,.identity-current,.role-control){min-width:0;max-width:100%;overflow-wrap:anywhere}
.app-shell .topbar :is(button,select,a.button){min-height:44px}
.app-shell :is(.portal-home,.portal-orders,.portal-files){font-size:16px;color:var(--workspace-ink)}
.app-shell :is(.portal-home,.portal-orders,.portal-files) :is(h1,h2,h3,p,strong,small,a){overflow-wrap:anywhere}
.app-shell :is(.portal-home,.portal-orders,.portal-files) h1{font-size:clamp(26px,3vw,34px);line-height:1.2;letter-spacing:-.025em}
.app-shell :is(.portal-home,.portal-orders,.portal-files) h2{font-size:21px;line-height:1.3}
.app-shell :is(.portal-home,.portal-orders,.portal-files) h3{font-size:18px;line-height:1.35}
.app-shell :is(.portal-home,.portal-orders,.portal-files) :is(.button,button,input,select){min-height:44px;font-size:15px}
.app-shell :is(.portal-home,.portal-orders,.portal-files) .button{white-space:normal;text-align:center;line-height:1.4}
.app-shell :is(.portal-home,.portal-orders,.portal-files) .button.primary{background:var(--workspace-blue);border-color:var(--workspace-blue);color:white}
.app-shell :is(.portal-home,.portal-orders,.portal-files) .panel{border:1px solid var(--workspace-line);border-radius:18px;box-shadow:0 5px 20px #20344f05;overflow:hidden}
.app-shell :is(.portal-home,.portal-orders,.portal-files) .panel-head{padding:20px;flex-wrap:wrap;gap:12px}
.app-shell :is(.portal-home,.portal-orders,.portal-files) :is(.panel-body,.empty-state){padding:20px}
.app-shell :is(.portal-home,.portal-orders,.portal-files) :is(.panel-subtitle,.cell-sub,.metric-note,.small-label){font-size:14px;line-height:1.5}
.app-shell .workspace-search{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 100%;border:1px solid var(--workspace-line);background:#f6f7fb;border-radius:12px;padding:0 12px}
.app-shell .workspace-search input{width:100%;min-width:0;min-height:44px;background:transparent;border:0;color:var(--workspace-ink);font-size:16px;outline-offset:0}
.app-shell .workspace-alerts{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;border:1px solid var(--workspace-line);background:#fff;border-radius:12px;padding:8px 12px;color:var(--workspace-ink)}
.app-shell :is(.home-grid,.home-main,.home-context){display:grid;gap:20px;align-content:start}
.app-shell .home-grid{grid-template-columns:minmax(0,1fr)}
.app-shell .home-shortcuts{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.app-shell .home-shortcut{display:flex;flex-direction:column;gap:12px;padding:22px;border:1px solid var(--workspace-line);border-radius:18px;background:#fff;min-width:0;box-shadow:0 4px 16px #20344f04}
.app-shell .home-shortcut :is(.icon,.shortcut-icon){display:inline-flex;align-items:center;justify-content:center;background:#edf1ff;color:var(--workspace-blue);border-radius:14px;width:48px;height:48px}
.app-shell .home-shortcut :is(.value,.shortcut-value){font-size:30px;font-weight:750;color:var(--workspace-ink);line-height:1.2}
.app-shell .home-shortcut p{font-size:15px;line-height:1.55;color:var(--workspace-muted)}
.app-shell .home-shortcut :is(.button,.text-link){margin-top:auto;align-self:flex-start;min-height:44px;display:inline-flex;align-items:center}
.app-shell .home-next-card{padding:24px;border:1px solid #d7dff2;background:linear-gradient(115deg,#eef2ff,#f5f8ff);border-radius:20px;display:flex;flex-direction:column;align-items:flex-start;gap:16px;color:var(--workspace-ink)}
.app-shell .home-next-card :is(h2,h3){font-size:24px;line-height:1.3;color:var(--workspace-ink)}
.app-shell .home-next-card p{font-size:16px;color:#4d617e;max-width:66ch}
.app-shell .home-next-card .button{width:100%}
.app-shell :is(.home-task-list,.home-activity-list,.home-date-list){display:grid;gap:0;list-style:none;padding:0;margin:0;min-width:0}
.app-shell :is(.home-task,.home-activity,.home-date){display:flex;align-items:flex-start;gap:14px;padding:18px 20px;min-width:0;background:#fff;border-bottom:1px solid #edf0f5;overflow-wrap:anywhere}
.app-shell :is(.home-task,.home-activity,.home-date):last-child{border-bottom:0}
.app-shell :is(.home-task,.home-activity,.home-date)>div{min-width:0;flex:1}
.app-shell :is(.home-task,.home-activity,.home-date) p{font-size:15px;line-height:1.5;color:var(--workspace-muted);margin-top:5px}
.app-shell :is(.home-task,.home-activity,.home-date) :is(time,small){font-size:14px;line-height:1.5;color:var(--workspace-muted)}
.app-shell .home-task{flex-wrap:wrap}
.app-shell .home-task>.button{width:100%;margin-top:4px}
.app-shell .home-context .panel-title{font-size:19px}
.app-shell .home-progress-card{padding:22px;border:1px solid var(--workspace-line);border-radius:18px;background:#fff;display:grid;gap:14px;min-width:0}
.app-shell .home-progress-card :is(.progress-bar,progress){width:100%;height:10px;border-radius:8px;overflow:hidden}
.app-shell .home-progress-card .progress-bar{background:#e9edf5}
.app-shell .home-progress-card .progress-bar>span{background:var(--workspace-blue)}
.app-shell .home-progress-card :is(.button,.text-link){min-height:44px}
.app-shell .mobile-bottom-nav{background:#fff;border-top:1px solid var(--workspace-line);box-shadow:0 -4px 20px #20344f08;padding-bottom:max(8px,env(safe-area-inset-bottom))}
.app-shell .mobile-bottom-nav a{min-width:0;min-height:48px;font-size:13px;overflow-wrap:anywhere;text-align:center}
.app-shell :is(a,button,input,select,textarea):focus-visible{outline:3px solid #366ac0;outline-offset:3px}
@media(min-width:600px){.app-shell .home-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}.app-shell .home-next-card .button{width:auto}.app-shell .home-task{flex-wrap:nowrap;align-items:center}.app-shell .home-task>.button{width:auto;flex-shrink:0;margin-top:0}.app-shell .workspace-search{flex-basis:240px}}
@media(min-width:900px){.app-shell .page{padding:32px 28px 48px}.app-shell .topbar{padding:16px 28px}.app-shell .home-context{grid-template-columns:repeat(2,minmax(0,1fr))}.app-shell .home-next-card{padding:28px}.app-shell .workspace-search{max-width:620px}}
@media(min-width:1280px){.app-shell .home-grid{grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}.app-shell .home-context{grid-template-columns:minmax(0,1fr)}.app-shell .home-main{gap:24px}.app-shell .home-next-card{min-height:180px}}
@media(max-width:599px){.app-shell .page-head,.app-shell .workspace-welcome{gap:16px}.app-shell .page-head .actions{width:100%}.app-shell .page-head .actions .button{flex:1}.app-shell .home-shortcut{padding:20px}.app-shell .home-next-card{padding:20px}.app-shell .portal-files :is(.doc-actions,.document-actions){flex-wrap:wrap;gap:8px}.app-shell .portal-files :is(.doc-actions,.document-actions) .button{flex:1 1 140px}.app-shell .home-context{gap:16px}}
@media(prefers-reduced-motion:reduce){.app-shell *{scroll-behavior:auto;transition:none!important}}
@media print{.app-shell .page{padding:0}.app-shell .home-grid{display:block}.app-shell .home-context{display:block}.app-shell :is(.home-shortcut,.home-next-card,.home-progress-card){break-inside:avoid;box-shadow:none}.app-shell :is(.mobile-bottom-nav,.workspace-search,.workspace-alerts){display:none!important}}
/* Integration corrections against real shell and nested existing hero. */
.app-shell .sidebar-brand,.app-shell .sidebar-brand :is(span,strong){color:var(--workspace-ink)}
.app-shell .sidebar-brand>svg{color:var(--workspace-blue)}
.app-shell .company-context{background:#f3f5fb;border-color:var(--workspace-line);color:var(--workspace-ink)}
.app-shell .company-context :is(.company-name,strong){color:var(--workspace-ink)}
.app-shell .company-context :is(p,small,.small-label,.switch-company){color:#506582}
.app-shell .side-nav a{color:#4d617c;font-size:14px;min-height:44px;border-radius:12px}
.app-shell .side-nav a:hover{background:#f0f3fa;color:#234f92}
.app-shell .side-nav a.active,.app-shell .side-nav a[aria-current=page]{background:#e8eefe;color:#234f92;font-weight:700}
.app-shell .sidebar-bottom{border-color:var(--workspace-line)}
.app-shell .sidebar-bottom :is(p,.small-label){color:#536681}
.app-shell .sidebar-bottom .button{color:#28549a;font-size:13px;padding:10px 8px}
.app-shell .sidebar-bottom .button:hover{background:#edf1fb;color:#193f7b}
.app-shell .workspace-company-logo{height:50px;width:100%;display:flex;align-items:center;justify-content:center;margin-bottom:10px;border-radius:10px;overflow:hidden;background:#fff}
.app-shell .workspace-company-logo :is(img,svg){height:44px;max-height:44px;width:auto;max-width:100%;object-fit:contain;flex-shrink:1}
.app-shell .home-next-card .next-action-hero{background:transparent;border:0;padding:0;margin:0;width:100%;min-height:0;box-shadow:none;border-radius:0;color:var(--workspace-ink)}
.app-shell .home-next-card .next-action-hero :is(h1,h2,h3,strong){color:var(--workspace-ink)}
.app-shell .home-next-card .next-action-hero :is(p,small,.muted){color:#4d617e}
.app-shell .home-next-card .next-action-hero :is(.eyebrow,.small-label){color:#2458a6}
.app-shell .home-next-card .next-action-hero .button.primary{background:#2458a6;border-color:#2458a6;color:white}
.app-shell .home-next-card .next-action-hero .button.secondary{background:white;border-color:#a9b9d3;color:#244e8c}
@media(min-width:851px){
 .app-shell .topbar:has(.workspace-session-actions){display:flex;flex-flow:row wrap;align-items:center;gap:10px 16px;padding-block:12px;min-height:76px}
 .app-shell .topbar:has(.workspace-session-actions)>.breadcrumb{flex:1 1 160px;font-size:13px}
 .app-shell .workspace-session-actions{width:auto;max-width:100%;flex:0 1 auto;flex-wrap:nowrap;gap:12px;align-items:center}
 .app-shell .workspace-session-actions .identity-current{flex:0 1 auto;max-width:250px;min-width:0;flex-direction:row;align-items:center;gap:12px;border:0;padding:0}
 .app-shell .workspace-session-actions .identity-current>span{font-size:13px;line-height:1.3}
 .app-shell .workspace-session-actions .identity-current .text-link{min-height:44px;font-size:12px;line-height:1.3;padding:6px;align-items:center}
 .app-shell .workspace-session-actions .session-logout{min-height:44px;margin:0;white-space:nowrap;padding:8px 14px;font-size:13px;flex-shrink:0}
 .app-shell .topbar .workspace-search{flex:1 1 220px;min-width:160px}
}
/* Mobile session controls: explicit rows prevent identity compression. */
@media(max-width:850px){
 .app-shell .workspace-session-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;max-width:100%;gap:10px 12px;align-items:center}
 .app-shell .workspace-session-actions>.workspace-alerts{grid-column:1;grid-row:1;justify-self:start;max-width:100%}
 .app-shell .workspace-session-actions>:not(.workspace-alerts):not(.identity-current):not(.session-logout){grid-column:2;grid-row:1;justify-self:end;max-width:100%}
 .app-shell .workspace-session-actions>.identity-current{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;max-width:none;min-width:0;flex:none;gap:2px;padding:0;border:0;text-align:left}
 .app-shell .workspace-session-actions>.identity-current>span{font-size:14px;line-height:1.4;max-width:100%;word-break:normal;overflow-wrap:normal;white-space:normal;text-align:left}
 .app-shell .workspace-session-actions>.identity-current .text-link{font-size:14px;line-height:1.4;min-height:44px;max-width:100%;padding:5px 0;word-break:normal;overflow-wrap:normal;white-space:normal;justify-content:flex-start;text-align:left}
 .app-shell .workspace-session-actions>.session-logout{grid-column:2;grid-row:2;margin:0;min-height:44px;white-space:nowrap;font-size:14px;padding:10px 12px;justify-self:end}
}
/* Overview-only compact header: role remains in the visible company brand card. */
@media(max-width:850px){
 .app-shell .workspace:has(.mobile-workspace-brand) .workspace-session-actions{grid-template-columns:minmax(0,1fr) auto auto;gap:8px}
 .app-shell .workspace:has(.mobile-workspace-brand) .workspace-session-actions>.identity-current{display:none}
 .app-shell .workspace:has(.mobile-workspace-brand) .workspace-session-actions>.workspace-alerts{grid-column:1;grid-row:1;padding:8px;gap:5px;font-size:13px;min-height:44px}
 .app-shell .workspace:has(.mobile-workspace-brand) .workspace-session-actions>:not(.workspace-alerts):not(.identity-current):not(.session-logout){grid-column:2;grid-row:1}
 .app-shell .workspace:has(.mobile-workspace-brand) .workspace-session-actions>.session-logout{grid-column:3;grid-row:1;font-size:13px;padding:8px 10px}
 .app-shell .workspace:has(.mobile-workspace-brand) .topbar{padding:10px 14px;gap:8px}
 .app-shell .workspace:has(.mobile-workspace-brand) .page{padding-top:16px}
 .app-shell .mobile-workspace-brand{min-height:70px;padding:10px 14px;gap:12px;margin:0 0 20px}
 .app-shell .mobile-workspace-brand .mobile-workspace-logo{width:60px;flex-basis:60px}
 .app-shell .mobile-workspace-brand :is(img,.company-logo){width:60px;height:44px;object-fit:contain}
 .app-shell .mobile-workspace-brand strong{font-size:16px;line-height:1.25}
 .app-shell .mobile-workspace-brand a{min-height:44px;font-size:14px;line-height:1.2}
}
@media(max-width:850px){.app-shell .workspace:has(.mobile-workspace-brand) .workspace-alerts>span{display:none}.app-shell .workspace:has(.mobile-workspace-brand) .workspace-alerts{min-height:44px;height:44px;justify-self:start;min-width:58px}}
.app-shell .shipment-costs{margin-top:24px}.app-shell .shipment-costs .panel-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:22px;flex-wrap:wrap}.app-shell .shipment-costs .panel-body{padding:22px}.app-shell .cost-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:16px}.app-shell .cost-totals article{display:flex;flex-direction:column;gap:8px;padding:18px;background:#edf3ff;border:1px solid #d6e1f4;border-radius:14px}.app-shell .cost-totals strong{font-size:26px;overflow-wrap:anywhere}.app-shell .cost-row{display:flex;align-items:center;justify-content:space-between;gap:18px;border-top:1px solid #e0e6ef;padding:18px 0}.app-shell .cost-row>div{min-width:0}.app-shell .cost-row p,.app-shell .cost-row small{overflow-wrap:anywhere}.app-shell .cost-row>.button{flex-shrink:0;min-height:44px}.app-shell .cost-row>strong{white-space:nowrap}@media(max-width:600px){.app-shell .cost-row{align-items:flex-start;flex-direction:column}.app-shell .cost-row>.button{width:100%}}
