/* Shared session and supervisor workspace controls, including embedded views. */
#prototypeSessionBar,#supervisorPageSwitcher { box-sizing:border-box; width:calc(100% - 30px); max-width:730px; margin:14px auto; padding:14px 16px; border:1px solid #dfb77e; border-radius:18px; background:#fff5e6; color:#482600; }
#prototypeSessionBar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 14px; align-items:center; }
#prototypeSessionBar[hidden],#supervisorPageSwitcher[hidden] { display:none; }
#prototypeSessionLabel { font-size:13px; line-height:21px; overflow-wrap:anywhere; }
#prototypeSessionBar small { grid-column:1 / -1; font-size:11px; line-height:18px; color:#71441e; }
#prototypeLogoutBtn { min-width:64px; min-height:36px; margin:0; padding:8px 16px; border:1px solid #dfb77e; border-radius:24px; background:#f4d6a6; color:#482600; font-size:12px; font-weight:700; cursor:pointer; }
#supervisorPageSwitcher { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; background:linear-gradient(125deg,#fff8ed,#f9e4c3); }
#supervisorPageSwitcher > strong { min-width:0; font-size:13px; line-height:21px; }
#supervisorPageSwitcher a { display:block; min-height:38px; padding:9px 14px; border-radius:24px; background:#f8b62d; color:#482600; text-decoration:none; text-align:center; font-size:12px; line-height:20px; font-weight:700; }
#supervisorPageSwitcher small { grid-column:1 / -1; padding-top:10px; border-top:1px solid #dfc6a5; font-size:11px; line-height:19px; color:#71441e; }
#prototypeLogoutBtn:focus-visible,#supervisorPageSwitchLink:focus-visible { outline:2px solid #a66808; outline-offset:3px; }
body:has(#todayBusinessSection) :is(#prototypeSessionBar,#supervisorPageSwitcher) { max-width:450px; }
@media(max-width:360px) { #supervisorPageSwitcher { grid-template-columns:minmax(0,1fr); } #supervisorPageSwitcher a { width:100%; box-sizing:border-box; } }
.erp-sidebar-footer { width:100%; margin-top:auto; padding-top:28px; }
.erp-sidebar-footer #prototypeSessionBar { width:100%; max-width:none; margin:0; grid-template-columns:minmax(0,1fr); gap:10px; background:#fff5e6; }
.erp-sidebar-footer #prototypeLogoutBtn { grid-row:3; width:100%; background:#482600; color:#fff5e6; border-color:#482600; min-height:42px; }
.erp-sidebar-footer #prototypeSessionBar small { grid-row:2; }
.erp-sidebar-link[hidden] { display:none; }
#adminHome > .top-bar::after { display:none; }
#adminHome #openSidebarBtn { display:grid; place-items:center; width:40px; height:40px; padding:4px; margin-left:auto; border:0; background:transparent; cursor:pointer; }
#adminHome #openSidebarBtn:focus-visible { outline:2px solid #a66808; outline-offset:2px; }
body:has(> #supervisorWorkspaceFrame:not([hidden])) { padding-top:0; }
/* Keep the original yellow sidebar; blend only the new logout footer into it. */
#erpSidebar .erp-sidebar-footer { width:min(78%,390px); padding-top:28px; }
#erpSidebar #prototypeSessionBar { width:100%; margin:0; padding:18px 0 0; border:0; border-top:1px solid rgba(86,46,0,.35); border-radius:0; background:transparent; text-align:center; gap:8px; }
#erpSidebar #prototypeSessionLabel { font-size:12px; line-height:20px; color:#562e00; }
#erpSidebar #prototypeSessionBar small { font-size:11px; line-height:18px; color:#71441e; }
#erpSidebar #prototypeLogoutBtn { margin-top:6px; min-height:42px; border:0; border-radius:26px; background:#feecd2; color:#562e00; font-size:14px; }
#erpSidebar #supervisorPageSwitcher { grid-row:3; display:flex; flex-direction:column; gap:8px; width:100%; max-width:none; margin:4px 0 0; padding:0; border:0; border-radius:0; background:transparent; }
#erpSidebar #supervisorPageSwitcher[hidden] { display:none; }
#erpSidebar #supervisorPageSwitcher > strong { order:1; font-size:12px; }
#erpSidebar #supervisorPageSwitcher small { order:2; flex-basis:auto; padding:0; border:0; font-size:11px; line-height:18px; }
#erpSidebar #supervisorPageSwitchLink { order:3; box-sizing:border-box; width:100%; min-height:42px; padding:10px 14px; border:1px solid #562e00; border-radius:26px; background:transparent; color:#562e00; font-size:14px; line-height:20px; }
#erpSidebar #prototypeLogoutBtn { grid-row:4; }

/* One scrollable menu body keeps the close control reachable on short phones. */
/* The retired identity selector must not leave an empty bordered spacer.
   Keep the panel whenever an authorized prototype shift tool is visible. */
#prototypeIdentityPanel:not(:has(> :not([hidden]):not(.hidden))) { display:none; }
#erpSidebar { overflow:hidden; overscroll-behavior:contain; }
#erpSidebar .erp-sidebar-content {
 height:100%; min-height:0; overflow-y:auto; overflow-x:hidden;
 padding: max(80px,calc(env(safe-area-inset-top) + 68px)) max(18px,env(safe-area-inset-right)) max(28px,calc(env(safe-area-inset-bottom) + 20px)) max(18px,env(safe-area-inset-left));
 overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch;
 scroll-padding-top:80px; scroll-padding-bottom:24px;
}
#erpSidebar .erp-sidebar-content > * { flex-shrink:0; min-width:0; }
#erpSidebar .erp-sidebar-profile { max-width:100%; overflow-wrap:anywhere; }
#erpSidebar .erp-sidebar-nav,#erpSidebar .erp-sidebar-footer { width:min(100%,390px); }
#erpSidebar .erp-sidebar-nav { margin-top:28px; }
#erpSidebar .erp-sidebar-link { min-height:48px; padding:12px 10px; font-size:17px; line-height:24px; white-space:normal; overflow-wrap:anywhere; touch-action:manipulation; }
#erpSidebar .erp-sidebar-chevron { flex-shrink:0; }
#erpSidebar .erp-sidebar-footer { padding-top:24px; }
#erpSidebar #prototypeSessionBar { gap:12px; }
#erpSidebar #prototypeLogoutBtn,#erpSidebar #supervisorPageSwitchLink { min-height:48px; padding:13px 16px; font-size:16px; line-height:22px; touch-action:manipulation; overflow-wrap:anywhere; }
#erpSidebar .erp-sidebar-close { top:max(12px,env(safe-area-inset-top)); right:max(14px,env(safe-area-inset-right)); }
@media(max-height:600px) {
 #erpSidebar .erp-sidebar-avatar { width:76px; height:76px; }
 #erpSidebar .erp-sidebar-brand { margin-top:8px; font-size:14px; }
 #erpSidebar .erp-sidebar-name { font-size:22px; }
 #erpSidebar .erp-sidebar-nav { margin-top:20px; }
}
