.app-shell { --sidebar-width-collapsed: 80px; --sidebar-width-expanded: 220px; --sidebar-motion: .2s cubic-bezier(.4, 0, .2, 1); min-height: 100vh; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-width-collapsed); display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, #064f96 0%, #063d76 55%, #073566 100%); color: #fff; box-shadow: 1px 0 0 rgba(15, 23, 42, .08); transition: width var(--sidebar-motion); }
.app-sidebar:hover, .app-sidebar:focus-within, .app-sidebar.is-expanded { width: var(--sidebar-width-expanded); }
.app-main { width: calc(100% - var(--sidebar-width-collapsed)); min-width: 0; margin-left: var(--sidebar-width-collapsed); transition: width var(--sidebar-motion), margin-left var(--sidebar-motion); }
.app-sidebar:hover + .app-main, .app-sidebar:focus-within + .app-main, .app-sidebar.is-expanded + .app-main { width: calc(100% - var(--sidebar-width-expanded)); margin-left: var(--sidebar-width-expanded); }

.app-brand { min-height: 92px; display: grid; grid-template-columns: 44px; place-content: center; padding: 16px 18px; white-space: nowrap; }
.brand-mark { width: 44px; height: 44px; overflow: hidden; border-radius: 50%; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: none; min-width: 0; }
.app-sidebar:hover .app-brand, .app-sidebar:focus-within .app-brand, .app-sidebar.is-expanded .app-brand { grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 11px; place-content: initial; }
.app-sidebar:hover .brand-copy, .app-sidebar:focus-within .brand-copy, .app-sidebar.is-expanded .brand-copy { display: block; animation: sidebar-copy-in .12s ease .07s both; }
.brand-copy b, .brand-copy small { display: block; overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy b { font-size: 18px; line-height: 1.2; }
.brand-copy small { margin-top: 3px; color: #c1ddf3; font-size: 11px; }

.app-nav { flex: 1; min-height: 0; padding: 7px 10px; overflow-x: clip; overflow-y: auto; scrollbar-width: thin; }
.nav-button, .shell-submenu-item { width: 100%; border: 0; background: transparent; color: #e4f1ff; white-space: nowrap; }
.nav-button { min-height: 48px; display: grid; grid-template-columns: 1fr; place-items: center; padding: 0; border-radius: 9px; font-size: 14px; font-weight: 650; line-height: 1.3; text-align: left; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; color: #d9edff; }
.nav-icon svg { width: 24px; height: 24px; display: block; }
.nav-label, .nav-caret { display: none; }
.app-sidebar:hover .nav-button, .app-sidebar:focus-within .nav-button, .app-sidebar.is-expanded .nav-button { grid-template-columns: 24px minmax(0, 1fr); place-items: center stretch; column-gap: 11px; padding: 0 12px 0 18px; }
.app-sidebar:hover .shell-admin-toggle, .app-sidebar:focus-within .shell-admin-toggle, .app-sidebar.is-expanded .shell-admin-toggle { grid-template-columns: 24px minmax(0, 1fr) 16px; }
.app-sidebar:hover .nav-label, .app-sidebar:focus-within .nav-label, .app-sidebar.is-expanded .nav-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: sidebar-copy-in .12s ease .07s both; }
.app-sidebar:hover .nav-caret, .app-sidebar:focus-within .nav-caret, .app-sidebar.is-expanded .nav-caret { width: 16px; height: 24px; display: grid; place-items: center; margin: 0; font-size: 15px; line-height: 1; animation: sidebar-copy-in .12s ease .07s both; transition: transform .15s ease; }
.nav-button:hover { background: rgba(255, 255, 255, .09); }
.nav-button.active { background: linear-gradient(90deg, #0878ef, #0868d7); color: #fff; box-shadow: 0 5px 14px rgba(0, 45, 105, .22); }
.nav-button:hover .nav-icon, .nav-button.active .nav-icon { color: #fff; }

.shell-admin { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
.shell-admin.is-closed .nav-caret { transform: rotate(180deg); }
.shell-admin.is-closed .shell-submenu { display: none; }
.shell-submenu { display: none; }
.warehouse-submenu { display: none; }
.app-sidebar:hover .shell-submenu, .app-sidebar:focus-within .shell-submenu, .app-sidebar.is-expanded .shell-submenu { position: relative; display: grid; margin: 2px 0 4px 13px; padding-left: 10px; animation: sidebar-copy-in .12s ease .09s both; }
.app-sidebar:hover .shell-warehouse.is-open .warehouse-submenu, .app-sidebar:focus-within .shell-warehouse.is-open .warehouse-submenu, .app-sidebar.is-expanded .shell-warehouse.is-open .warehouse-submenu { position: relative; display: grid; margin: 2px 0 4px 13px; padding-left: 10px; animation: sidebar-copy-in .12s ease .09s both; }
.app-sidebar:hover .shell-submenu::before, .app-sidebar:focus-within .shell-submenu::before, .app-sidebar.is-expanded .shell-submenu::before { position: absolute; top: 5px; bottom: 5px; left: 0; width: 1px; background: rgba(255, 255, 255, .2); content: ''; }
.app-sidebar:hover .shell-warehouse.is-open .warehouse-submenu::before, .app-sidebar:focus-within .shell-warehouse.is-open .warehouse-submenu::before, .app-sidebar.is-expanded .shell-warehouse.is-open .warehouse-submenu::before { position: absolute; top: 5px; bottom: 5px; left: 0; width: 1px; background: rgba(255, 255, 255, .2); content: ''; }
.shell-admin.is-closed .shell-submenu { display: none; }
.shell-submenu-item { min-height: 40px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 10px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 550; line-height: 1.3; text-align: left; }
.submenu-icon { width: 20px; height: 20px; display: grid; place-items: center; }
.submenu-icon svg { width: 20px; height: 20px; display: block; }
.submenu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-submenu-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.shell-submenu-item.active { background: rgba(31, 137, 245, .28); color: #fff; }
.warehouse-submenu-item:nth-child(4) .submenu-icon { transform: rotate(180deg); }

.sidebar-collapse { display: none; }
.sidebar-account { position: relative; margin: 0 10px 14px; }
.account-trigger { width: 100%; min-height: 62px; display: grid; grid-template-columns: 1fr; place-items: center; padding: 8px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; background: rgba(1, 31, 70, .18); color: #fff; text-align: left; }
.account-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #147cea; font-size: 14px; font-weight: 800; }
.account-copy, .account-caret { display: none; }
.app-sidebar:hover .account-trigger, .app-sidebar:focus-within .account-trigger, .app-sidebar.is-expanded .account-trigger { grid-template-columns: 38px minmax(0, 1fr) 16px; place-items: center stretch; gap: 9px; padding: 8px 8px 8px 10px; }
.app-sidebar:hover .account-copy, .app-sidebar:focus-within .account-copy, .app-sidebar.is-expanded .account-copy { display: block; min-width: 0; animation: sidebar-copy-in .12s ease .07s both; }
.app-sidebar:hover .account-caret, .app-sidebar:focus-within .account-caret, .app-sidebar.is-expanded .account-caret { width: 16px; height: 24px; display: grid; place-items: center; margin: 0; animation: sidebar-copy-in .12s ease .07s both; }
.account-trigger b, .account-trigger small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger b { font-size: 13px; }
.account-trigger small { margin-top: 3px; color: #c9e3fa; font-size: 11px; }
.account-popover { position: absolute; z-index: 30; right: 0; bottom: 68px; left: 0; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 28px rgba(7, 35, 70, .22); }
.account-popover[hidden] { display: none; }
.account-popover button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px; border: 0; border-radius: 6px; background: #fff; color: #203754; font-size: 13px; text-align: left; }
.account-popover button:hover { background: #eef5fc; }
.account-popover svg { width: 19px; }

.app-topbar { min-height: 92px; display: flex; align-items: center; gap: 24px; padding: 13px 24px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-heading { min-width: 290px; padding: 2px 0 1px; }.page-heading span { display: block; color: var(--brand); font-size: 11px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }.page-heading h1 { margin: 4px 0 0; color: var(--ink); font-size: 24px; font-weight: 800; line-height: 1.18; }.page-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.35; }
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; }.topbar-context, .topbar-actions { display: flex; align-items: center; gap: 14px; }.system-status, .meta-item { min-height: 38px; display: flex; align-items: center; gap: 7px; color: var(--brand-dark); font-size: 12px; white-space: nowrap; }.system-status i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #22c55e; }.meta-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.notification-zone { position: relative; width: 48px; height: 48px; display: grid; place-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }.notification-button { position: relative; border-color: transparent; background: var(--surface); color: #27394d; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }.notification-button > svg { color: #27394d; }.notification-button > span { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; border-radius: 10px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.app-user { min-width: 190px; display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }.app-user > span { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; font-weight: 800; }.app-user b, .app-user small { display: block; white-space: nowrap; }.app-user b { font-size: 13px; }.app-user small { color: var(--ink-soft); font-size: 11px; }
.app-content { width: 100%; min-width: 0; padding: 24px; }.toast-region { position: fixed; top: 98px; right: 22px; z-index: 80; }.app-toast { max-width: 360px; padding: 12px 15px; border: 1px solid #c9dceb; border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 30px rgba(15, 23, 42, .16); color: var(--brand-dark); font-size: 13px; font-weight: 650; }

@keyframes sidebar-copy-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1080px) { .topbar-context { display: none; } }
@media (max-width: 700px) { .app-shell { --sidebar-width-collapsed: 64px; --sidebar-width-expanded: 210px; }.app-topbar { min-height: 74px; padding: 9px 14px 8px; }.page-heading { min-width: 0; flex: 1 1 auto; }.page-heading h1 { font-size: 19px; }.page-heading p, .app-user div, .notification-button { display: none; }.topbar-meta, .topbar-actions { gap: 8px; flex: 0 0 auto; }.notification-zone { display: none; }.app-user { min-width: 40px; padding: 0; border: 0; }.app-content { padding: 16px; } }
