.app-shell{
min-height:100vh;
display:grid;
grid-template-columns:248px minmax(0,1fr)
}
.sidebar{
background:var(--sidebar-bg);
color:var(--sidebar-text);
position:sticky;
top:0;
height:100vh;
display:flex;
flex-direction:column;
padding:27px 15px 18px;
z-index:30
}
.brand,.auth-brand{
display:flex;
align-items:center;
gap:11px;
color:#fff;
padding:0 12px;
text-decoration:none!important
}
 .brand-compact-logo,.topbar-brand-logo{
display:block;
width:40px;
height:40px;
object-fit:contain;
flex:none;
background:#fff;
border-radius:9px;
padding:3px
}
.brand-full-logo{
display:block;
max-width:58px;
max-height:40px;
object-fit:contain;
flex:none
}
.topbar-brand-logo{display:none}
.brand-copy strong{font-size:13px}
.branding-preview{
max-width:500px;
padding:16px;
margin:14px 0 18px;
background:#fff;
border:1px solid var(--card-border);
border-radius:12px
}
.branding-preview img{
display:block;
max-width:100%;
max-height:130px;
width:auto;
height:auto;
object-fit:contain
}
.brand-mark{
display:grid;
place-items:center;
width:37px;
height:37px;
border-radius:11px;
background:linear-gradient(140deg,#3284ff,#1252d8);
color:#fff;
font-size:22px;
font-weight:800;
letter-spacing:-.12em;
padding-right:3px;
box-shadow:0 7px 21px rgba(30,107,255,.28)
}
.brand-copy,.auth-brand>span:last-child{
display:flex;
flex-direction:column;
line-height:1.05;
letter-spacing:.12em
}
.brand-copy strong,.auth-brand strong{
font-size:16px;
color:#fff
}
.brand-copy small,.auth-brand small{
font-size:8px;
letter-spacing:.25em;
color:#a9c7f3;
margin-top:5px
}
.sidebar-caption{
font-size:10px;
font-weight:700;
letter-spacing:.17em;
color:#7489a9;
padding:50px 14px 13px
}
.sidebar-caption-spaced{
padding-top:36px
}
.nav-item{
display:flex;
align-items:center;
gap:12px;
min-height:43px;
padding:9px 13px;
border-radius:10px;
color:var(--sidebar-text);
font-size:13px;
font-weight:600
}
.nav-item:hover{
background:rgba(255,255,255,.08);
color:#fff;
text-decoration:none
}
.nav-item.active{
background:var(--sidebar-active-bg);
color:var(--sidebar-active-text);
box-shadow:inset 3px 0 var(--color-accent)
}
.nav-icon{
font-size:20px;
width:20px;
line-height:1
}
.sidebar-bottom{
margin-top:auto;
padding:16px 13px 0;
border-top:1px solid rgba(255,255,255,.1);
font-size:11px
}
.sidebar-bottom p{
margin:8px 0 0;
color:#7186a7
}
.sidebar-status{
display:flex;
align-items:center;
gap:9px;
color:#c7d7ed
}
.status-dot{
display:inline-block;
flex:none;
width:7px;
height:7px;
border-radius:50%;
background:#50d5a0;
box-shadow:0 0 0 4px rgba(80,213,160,.12)
}
.workspace{
min-width:0;
display:flex;
flex-direction:column
}
.topbar{
height:76px;
padding:0 clamp(20px,4vw,58px);
display:flex;
align-items:center;
justify-content:space-between;
gap:18px;
background:var(--topbar-bg);
border-bottom:1px solid var(--card-border);
position:sticky;
top:0;
z-index:20
}
.topbar-left,.topbar-right{
display:flex;
align-items:center;
gap:15px
}
.topbar-context{
display:flex;
flex-direction:column;
line-height:1.25
}
.topbar-context strong{
font-size:13px
}
.topbar-overline{
font-size:9px;
color:var(--text-secondary);
letter-spacing:.17em;
font-weight:700
}
.topbar-env{
font-size:9px;
letter-spacing:.12em;
color:var(--color-primary);
border:1px solid var(--card-border);
padding:6px 9px;
border-radius:30px;
font-weight:800
}
.theme-form select{
background:var(--page-bg);
border:1px solid var(--card-border);
border-radius:8px;
padding:8px 10px;
max-width:175px;
color:var(--text-primary)
}
.user-avatar{
width:31px;
height:31px;
border-radius:50%;
display:grid;
place-items:center;
background:var(--sidebar-bg);
color:#fff;
font-weight:700
}
.user-name{
font-size:12px;
font-weight:600;
max-width:150px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.main-content{
width:min(100%,1440px);
padding:14px clamp(20px,4vw,58px) 28px;
margin:0 auto;
flex:1;
display:flex;
flex-direction:column
}
.page-header{
display:flex;
align-items:end;
justify-content:space-between;
gap:20px;
margin-bottom:27px
}
.page-header h1{
margin:5px 0 6px
}
.page-lead{
color:var(--text-secondary);
margin:0
}
.page-actions{
padding-bottom:7px
}
.breadcrumb{
display:flex;
align-items:center;
gap:9px;
color:var(--text-secondary);
font-size:11px;
margin-bottom:23px
}
.breadcrumb a{
color:var(--text-secondary)
}
.breadcrumb [aria-current]{
color:var(--text-primary);
font-weight:600
}
.eyebrow{
font-size:10px;
font-weight:800;
letter-spacing:.18em;
color:var(--color-primary);
margin-bottom:9px
}
.eyebrow-line{
display:inline-block;
width:15px;
height:1px;
background:var(--color-primary);
vertical-align:middle;
margin:0 7px
}
.footer{
text-align:center;
border-top:1px solid var(--card-border);
margin-top:auto;
padding-top:18px;
display:flex;
justify-content:center;
gap:12px;
color:var(--text-secondary);
font-size:11px
}
.scrim{
display:none
}
.menu-button{
display:none!important
}
@media(max-width:1100px){
.app-shell{
grid-template-columns:214px minmax(0,1fr)
}
.sidebar{
padding-left:10px;
padding-right:10px
}
.user-name{
display:none
}

}
@media(max-width:800px){
.topbar-brand-logo{display:block;width:30px;height:30px}

.app-shell{
display:block
}
.sidebar{
position:fixed;
left:0;
top:0;
width:258px;
transform:translateX(-105%);
transition:transform .22s ease;
box-shadow:10px 0 35px rgba(0,0,0,.12)
}
.app-shell.sidebar-open .sidebar{
transform:translateX(0)
}
.app-shell.sidebar-open .scrim{
display:block!important;
position:fixed;
inset:0;
background:rgba(11,22,48,.45);
z-index:25
}
.menu-button{
display:grid!important
}
.topbar{
height:67px
}
.main-content{
padding-top:25px
}
.page-header{
align-items:start
}
.topbar-env{
display:none
}

}
@media(max-width:560px){
.topbar{
padding:0 16px
}
.topbar-context{
display:none
}
.theme-form select{
max-width:122px;
font-size:11px
}
.topbar-right{
gap:7px
}
.user-avatar{
display:none
}
.main-content{
padding:12px 16px
}
.page-header{
display:block
}
.page-actions{
margin-top:15px
}
.footer{
flex-wrap:wrap
}

}

/* Keep shell controls inside the viewport; wide data scrolls in its own card. */
html,body{max-width:100%;overflow-x:clip}
.app-shell{width:100%;min-width:0}
.sidebar{min-width:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}
.brand-copy{min-width:0}
.brand-copy strong,.brand-copy small{overflow-wrap:anywhere}
.workspace,.topbar,.topbar-left,.topbar-right,.main-content,.page-header,.page-actions,.footer,.card{min-width:0;max-width:100%}
.topbar{height:auto;min-height:76px;flex-wrap:wrap;padding-top:10px;padding-bottom:10px}
.topbar-left{flex:1 1 160px}
.topbar-right{flex:1 1 620px;flex-wrap:wrap;justify-content:flex-end}
.topbar-right form{min-width:0;max-width:100%}
.topbar-right select{min-width:0;width:100%;max-width:100%;background:var(--page-bg);border:1px solid var(--card-border);border-radius:8px;padding:8px 10px;color:var(--text-primary)}
.company-form{flex:0 1 132px}
.establishment-form{flex:0 1 155px}
.theme-form{flex:0 1 155px}
.company-default-form .button,.topbar-logout{white-space:nowrap}
.main-content{width:min(100%,1440px)}
.page-header,.footer{flex-wrap:wrap}
.breadcrumb{min-width:0;flex-wrap:wrap}
.page-header>div:first-child{min-width:0}
@media(max-width:1100px){
.topbar-left,.topbar-right{flex-basis:100%}
.topbar-right{justify-content:flex-start;gap:9px}
}
@media(max-width:800px){
.topbar{min-height:67px;padding-top:10px;padding-bottom:10px}
.topbar-left{flex-basis:100%}
.topbar-right{flex-basis:100%;gap:7px}
.company-form{flex:1 1 95px}
.establishment-form{flex:1 1 100px}
.theme-form{flex:0 1 120px}
.topbar-logout{margin-left:auto}
}
@media(max-width:560px){
.topbar-right .company-default-form{order:4}
.topbar-right .theme-form{flex:0 1 105px}
.topbar-right .topbar-logout{order:3}
}

/* Sprint 0D: compact global shell and user menu. */
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell){grid-template-columns:74px minmax(0,1fr)}
.sidebar-collapse{width:100%;margin-top:12px;padding:7px;background:transparent;border:1px solid rgba(255,255,255,.18);border-radius:8px;color:var(--sidebar-text)}
.sidebar-collapse:hover{background:rgba(255,255,255,.09)}
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar{padding-left:10px;padding-right:10px}
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .brand{padding:0;justify-content:center}
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .brand-copy,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-caption,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .nav-label,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-status,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-bottom p{display:none}
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .nav-item{justify-content:center;padding:9px}
:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-bottom{padding:10px 0 0}
.topbar{height:76px;min-height:76px;flex-wrap:nowrap;padding-top:0;padding-bottom:0}
.topbar-left{flex:1 1 auto}
.topbar-right{flex:0 0 auto}
.user-menu-wrap{position:relative}
.user-menu-trigger{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 8px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text-primary)}
.user-menu-trigger:hover,.user-menu-trigger[aria-expanded=true]{background:var(--page-bg);border-color:var(--card-border)}
.user-menu-name{display:flex;flex-direction:column;align-items:start;line-height:1.2;max-width:150px}
.user-menu-name strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.user-menu-name small{font-size:10px;color:var(--text-secondary)}
.user-avatar-image{width:34px;height:34px;object-fit:cover;border-radius:50%}
.user-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(290px,calc(100vw - 24px));max-height:min(75vh,600px);overflow-y:auto;background:var(--card-bg);border:1px solid var(--card-border);border-radius:12px;box-shadow:0 20px 55px rgba(11,22,48,.18);padding:8px;z-index:40}
.user-menu a,.user-menu-logout{display:block;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:8px;background:transparent;color:var(--text-primary);font-size:12px;font-weight:600}
.user-menu a:hover,.user-menu-logout:hover{background:var(--page-bg);text-decoration:none}
.user-menu form{padding:8px 12px;border-top:1px solid var(--card-border)}
.user-menu form label{display:block;font-size:10px;font-weight:700;color:var(--text-secondary);margin-bottom:5px}
.user-menu form select{width:100%;max-width:100%;min-height:36px;border:1px solid var(--input-border);border-radius:8px;background:var(--input-bg);color:var(--text-primary);padding:6px}
.user-menu-logout{border-top:1px solid var(--card-border);color:var(--danger)}
@media(max-width:800px){:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell){display:block}:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar{width:258px;padding:27px 15px 18px}:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .brand-copy,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-caption,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .nav-label,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-status,:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .sidebar-bottom p{display:initial}:is(.app-shell.sidebar-collapsed, html[data-sidebar-collapsed="true"] .app-shell) .nav-item{justify-content:flex-start}.sidebar-collapse{display:none}.topbar-brand-logo{display:block}.topbar{height:67px;min-height:67px}}
@media(max-width:560px){.topbar-context{display:flex}.topbar-overline{display:none}.topbar-context strong{font-size:11px;max-width:115px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu-name{max-width:80px}.topbar-left{gap:8px}.topbar{padding:0 16px}}
