/* MyStationHub Ver022 — ChatGPT-inspired, 10px-gap sidebars.
   Scoped to Master Admin and station dashboard only. No auth changes. */
:root{--msh-side-gap:10px;--msh-side-border:#dfe7f3}
.app{display:grid;grid-template-columns:248px minmax(0,1fr);gap:var(--msh-side-gap);padding:var(--msh-side-gap);align-items:start}
.app>.side{position:sticky;top:var(--msh-side-gap);align-self:start;width:auto;height:calc(100dvh - 20px);min-height:0;max-height:calc(100dvh - 20px);overflow-x:hidden;overflow-y:auto;padding:22px 12px 16px;border:1px solid var(--msh-side-border);border-radius:16px;background:#fff;scrollbar-width:thin}
.app>.side .brand{margin:0 9px 25px;white-space:nowrap}
.app>.side a:not(.brand){gap:11px;min-height:44px;padding:10px 13px;font-size:13px;border-radius:11px}
.app>.side a:not(.brand) svg{width:19px;height:19px;flex:0 0 19px}
.app>.main{min-width:0;min-height:calc(100dvh - 20px);border:1px solid var(--msh-side-border);border-radius:16px;background:#f8faff;overflow:hidden}
.app>.main>.top{border-radius:16px 16px 0 0}
.app .mobile-bar{display:none!important}
.msh-admin-side-toggle{display:none;flex:none;align-items:center;justify-content:center;width:41px;height:41px;padding:0;border:1px solid #d7e3f3;border-radius:11px;background:#fff;color:#1759bf}
.msh-admin-side-toggle svg{width:21px;height:21px}
.msh-admin-nav-backdrop{display:none!important}
@media (min-width:861px) and (max-width:1100px){
 .app{grid-template-columns:220px minmax(0,1fr)}
 .app>.side{width:auto}
}

/* Station dashboard: the actual existing nav is moved (not duplicated)
   into this sidebar after /api/me + account name have finished. */
.msh-dashboard-page .msh-customer-workspace{display:grid;grid-template-columns:264px minmax(0,1fr);gap:var(--msh-side-gap);padding:var(--msh-side-gap);max-width:1700px;margin:0 auto;align-items:start;min-width:0}
.msh-dashboard-page:not(.msh-sidebar-equipped) .msh-customer-workspace{display:block}
.msh-dashboard-page .msh-customer-side{position:sticky;top:88px;align-self:start;width:auto;min-height:0;max-height:calc(100dvh - 100px);overflow-y:auto;overflow-x:hidden;padding:10px;border:1px solid var(--msh-side-border);border-radius:16px;background:#fff;scrollbar-width:thin}
.msh-dashboard-page .msh-customer-side[hidden]{display:none!important}
/* Reserve the scrollbar's space; reveal its thumb only while using the menu. */
.msh-dashboard-page #mshCustomerSidebar{scrollbar-width:thin;scrollbar-gutter:stable;scrollbar-color:transparent transparent}
.msh-dashboard-page #mshCustomerSidebar:hover,
.msh-dashboard-page #mshCustomerSidebar:focus-within{scrollbar-color:#97b1ca transparent}
.msh-dashboard-page #mshCustomerSidebar::-webkit-scrollbar{width:6px;background:transparent}
.msh-dashboard-page #mshCustomerSidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:8px}
.msh-dashboard-page #mshCustomerSidebar:hover::-webkit-scrollbar-thumb,
.msh-dashboard-page #mshCustomerSidebar:focus-within::-webkit-scrollbar-thumb{background:#97b1ca}
.msh-customer-side-intro{display:grid;gap:2px;padding:10px 13px 16px;border-bottom:1px solid #edf1f7;margin-bottom:10px}
.msh-customer-side-intro strong{font-size:14px;letter-spacing:-.015em;color:#10294b}
.msh-customer-side-intro span{font-size:11px;color:#718098}
.msh-dashboard-page .msh-customer-workspace .dashboard-main{min-width:0;max-width:none;width:100%;margin:0;padding:23px 20px 46px;border:1px solid var(--msh-side-border);border-radius:16px;background:#f8faff;min-height:calc(100dvh - 100px)}
.msh-dashboard-page .customer-header .header-inner{display:flex!important;grid-template-columns:none!important;justify-content:space-between!important;gap:16px!important}
.msh-dashboard-page .customer-header .brand{margin:0 auto 0 0!important;grid-column:auto!important;justify-self:start}
.msh-dashboard-page .customer-header .customer-header-actions{margin-left:auto!important;grid-column:auto!important;justify-self:end}
.msh-dashboard-page #mshCustomerSidebar #customerNav.customer-top-nav{display:flex!important;position:static!important;flex-direction:column!important;flex:initial!important;align-items:stretch!important;justify-content:flex-start!important;width:100%!important;min-width:0!important;max-width:100%!important;max-height:none!important;gap:4px!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important;overflow:visible!important;font-size:13px!important}
.msh-dashboard-page #mshCustomerSidebar #customerNav[hidden]{display:none!important}
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-home,
.msh-dashboard-page #mshCustomerSidebar #customerNav>.msh-workspace-link{display:flex!important;align-items:center;min-height:48px;width:100%;padding:12px;gap:12px;text-decoration:none;white-space:normal;border-radius:10px;color:#425777;font-size:14px;font-weight:650}
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-home[aria-current="page"],
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-home:hover,
.msh-dashboard-page #mshCustomerSidebar #customerNav>.msh-workspace-link:hover,
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-dropdown[open]>summary{background:#eaf2ff;color:#0857f8}
.msh-dashboard-page #mshCustomerSidebar #customerNav .account-nav-icon{width:19px;height:19px;flex:0 0 19px}
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-dropdown{position:relative!important;width:100%!important;flex:0 0 auto;min-width:0}
.msh-dashboard-page #mshCustomerSidebar #customerNav>.account-nav-dropdown>summary .account-nav-chevron{margin-left:auto!important}
.msh-dashboard-page #mshCustomerSidebar #customerNav .account-nav-panel{position:static!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:2px 0 8px!important;padding:4px 4px 4px 13px!important;border:0!important;border-left:2px solid #d9e7ff!important;border-radius:0!important;background:#fbfdff!important;box-shadow:none!important}
.msh-dashboard-page #mshCustomerSidebar #customerNav .account-nav-panel a{white-space:normal;overflow-wrap:anywhere;padding:10px 12px;font-size:12px}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-business-account-name{display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-business-signout:not([hidden]){display:block!important;width:100%;min-height:44px;padding:10px 12px;margin:5px 0 0;text-align:left;border:0!important;border-radius:9px;background:transparent!important;box-shadow:none!important;color:#bc3d53;font-size:13px;font-weight:700;cursor:pointer}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-business-signout:hover{background:#fff0f2!important}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-business-account-divider{height:1px;margin:7px 4px;background:#e8edf4}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-business-account-menu{margin-top:6px;padding-top:7px;border-top:1px solid #edf1f7}
.msh-dashboard-page .msh-customer-nav-backdrop{display:none!important}
.msh-dashboard-page .account-menu-toggle{display:none!important}
@media(min-width:861px) and (max-width:1100px){
 .msh-dashboard-page .msh-customer-workspace{grid-template-columns:236px minmax(0,1fr)}
}
@media(max-width:860px){
 .app{display:block!important;padding:0!important}
 .app>.side{position:fixed!important;top:0!important;bottom:0!important;left:0!important;z-index:112!important;width:min(300px,calc(100vw - 50px))!important;max-width:calc(100vw - 50px);height:100dvh!important;max-height:100dvh!important;min-height:0!important;border-radius:0 16px 16px 0!important;transform:translateX(-110%);transition:transform .2s ease;box-shadow:0 12px 40px #0b22452b;visibility:hidden}
 .app.msh-admin-nav-open>.side{transform:translateX(0);visibility:visible}
 .app>.main{min-height:100dvh!important;border:0!important;border-radius:0!important;overflow:visible!important}
 .app>.main>.top{border-radius:0!important;position:sticky;top:0;z-index:35}
 .app .mobile-bar{display:none!important}
 .app .top-title{margin-right:auto}
 .app .msh-admin-side-toggle{display:inline-flex!important}
 .app>.msh-admin-nav-backdrop:not([hidden]){display:block!important;position:fixed;inset:0;z-index:110;background:rgba(5,18,40,.36);border:0;padding:0;width:100%;height:100dvh}
 .msh-dashboard-page .msh-customer-workspace{display:block!important;width:100%;padding:0!important}
 .msh-dashboard-page .msh-customer-workspace .dashboard-main{border:0!important;border-radius:0!important;min-height:calc(100dvh - 72px);padding:20px 15px 48px!important}
 .msh-dashboard-page .msh-customer-side{position:fixed!important;top:0!important;bottom:0!important;left:0!important;z-index:111!important;width:min(300px,calc(100vw - 50px))!important;max-width:calc(100vw - 50px);height:100dvh!important;max-height:100dvh!important;border-radius:0 16px 16px 0!important;transform:translateX(-110%);transition:transform .2s ease;visibility:hidden;box-shadow:0 12px 40px #0b22452b}
 .msh-dashboard-page.msh-customer-nav-open .msh-customer-side{transform:translateX(0);visibility:visible}
 .msh-dashboard-page .msh-customer-nav-backdrop:not([hidden]){display:block!important;position:fixed;inset:0;z-index:100;background:rgba(5,18,40,.36);border:0;padding:0;width:100%;height:100dvh}
 .msh-dashboard-page .account-menu-toggle:not([hidden]){display:inline-flex!important}
 .msh-dashboard-page .customer-header{z-index:102!important}
 .msh-dashboard-page .customer-header .header-inner{justify-content:space-between!important}
}
@media(prefers-reduced-motion:reduce){
 .app>.side,.msh-dashboard-page .msh-customer-side{transition:none!important}
}
/* Visible drawer dismiss action for one-handed iPhone usage. */
.msh-side-close{display:none}
@media(max-width:860px){
 .app>.side .msh-side-close,
 .msh-dashboard-page .msh-customer-side .msh-side-close{
  display:flex!important;align-items:center;justify-content:center;gap:9px;
  width:100%;min-height:44px;margin:0 0 13px;padding:8px 13px;
  background:#f4f7fc;border:1px solid #e3eaf5;border-radius:11px;
  color:#3c5578;font-size:14px;font-weight:700;text-align:center;cursor:pointer;
 }
}

/* MyStationHub Ver023 -- iPhone/iPad admin drawer visibility fix.
   The older workflow-preview.css hides .side at 760px or below.
   Ver022 animated the drawer but did not override display:none. */
@media (max-width: 860px) {
  .app > #mshAdminSidebar.side {
    display: block !important;
  }
}

/* Direct workspace destinations; account tools live in the business menu. */
.msh-dashboard-page #mshCustomerSidebar #customerNav>a:focus-visible{outline:2px solid #0857f8;outline-offset:2px}
.msh-dashboard-page #mshCustomerSidebar #customerNav>a[aria-current="page"]{background:#eaf2ff;color:#0857f8;box-shadow:inset 3px 0 #0857f8}
.msh-dashboard-page #mshCustomerSidebar #customerNav>a:not([aria-current="page"]):hover{background:#f4f7fc;color:#425777}

/* Monitoring and setup groups share one station context. */
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-workspace-group{display:block;padding:17px 12px 6px;color:#718098;font-size:10px;font-weight:750;letter-spacing:.09em;text-transform:uppercase}
.msh-dashboard-page #mshCustomerSidebar #customerNav .msh-workspace-divider{display:block;height:1px;background:#edf1f7;margin:10px 12px}
.msh-dashboard-page .msh-unified-accordion{scroll-margin-top:108px}

/* A single dedicated page occupies the workspace beside the persistent nav. */
#msh-command [hidden]{display:none!important}
#msh-command .msh-workspace-page{background:#fff;border:1px solid #dbe4f1;border-radius:16px;padding:22px;margin-top:18px;min-width:0}
#msh-command .msh-workspace-page>.msh-cmd-columns>.msh-cmd-card{box-shadow:none}
#msh-view-title:focus{outline:none}
#msh-command .msh-workspace-support .msh-support-card{background:#fff;border:1px solid #dce6f5;border-radius:16px;padding:22px;margin:18px 0}
#msh-command .msh-workspace-support .formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#msh-command .msh-workspace-support .formfield.wide{grid-column:1/-1}
#msh-command .msh-workspace-support label{display:block;margin-bottom:7px;font-weight:700;font-size:13px}
#msh-command .msh-workspace-support input,#msh-command .msh-workspace-support select,#msh-command .msh-workspace-support textarea{width:100%;min-height:45px;border:1px solid #cddbec;border-radius:10px;padding:10px 12px;font:inherit}
#msh-command .msh-workspace-support textarea{resize:vertical}
@media(max-width:650px){#msh-command .msh-workspace-page,#msh-command .msh-workspace-support .msh-support-card{padding:16px}#msh-command .msh-workspace-support .formgrid{grid-template-columns:1fr}}

/* Expandable workspace menus with dedicated pages. */
#mshCustomerSidebar .msh-workspace-menu>summary{display:flex;align-items:center;gap:12px;min-height:48px;padding:12px;border-radius:10px;color:#425777;font-size:14px;font-weight:650;cursor:pointer;list-style:none}
#mshCustomerSidebar .msh-workspace-menu>summary::-webkit-details-marker{display:none}
#mshCustomerSidebar .msh-workspace-menu>summary:hover{background:#f4f7fc}
#mshCustomerSidebar .msh-workspace-menu[data-active="true"]>summary{color:#0857f8}
#mshCustomerSidebar .msh-workspace-chevron{width:16px;height:16px;margin-left:auto;flex:none;transition:transform .15s}
#mshCustomerSidebar .msh-workspace-menu[open] .msh-workspace-chevron{transform:rotate(180deg)}
#mshCustomerSidebar .msh-workspace-submenu{display:grid;gap:3px;margin:3px 0 7px 20px;padding-left:9px;border-left:1px solid #dce6f5}
#mshCustomerSidebar .msh-workspace-submenu a{display:flex;align-items:center;min-height:44px;padding:9px 10px;border-radius:8px;font-size:12px;font-weight:600;line-height:1.5;color:#425777;text-decoration:none;white-space:normal;overflow-wrap:break-word}
#mshCustomerSidebar .msh-workspace-submenu a:hover{background:#f4f7fc}
#mshCustomerSidebar .msh-workspace-submenu a[aria-current="page"]{background:#eaf2ff;color:#0857f8;box-shadow:inset 3px 0 #0857f8}
#mshCustomerSidebar .msh-workspace-menu>summary:focus-visible,#mshCustomerSidebar .msh-workspace-submenu a:focus-visible{outline:2px solid #0857f8;outline-offset:2px}
#msh-command .msh-workspace-page .msh-cmd-connections{grid-template-columns:minmax(0,1fr)}
