:root {
    --portal-ink: #17233b;
    --portal-brand: #2563eb;
    --portal-brand-soft: #eff6ff;
    --portal-surface: #ffffff;
    --portal-canvas: #f5f7fb;
    --portal-muted: #586a82;
    --portal-line: #e4e9f0;
    --portal-card: rgba(255, 255, 255, 0.86);
}
* {
    box-sizing: border-box;
}
html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--portal-ink);
    background: var(--portal-canvas);
    font-family: "Aptos", "Segoe UI", sans-serif;
}
a {
    color: inherit;
    text-decoration: none;
}
.portal-shell {
    display: flex;
    align-items: stretch;
    min-height: 100dvh;
    background: var(--portal-canvas);
}
.portal-sider {
    position: sticky;
    top: 0;
    width: 242px;
    flex: 0 0 242px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--portal-line);
}
.shell-collapsed .portal-sider {
    width: 80px;
    flex-basis: 80px;
}
.portal-sider .sidebar-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.collapse-control {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 26px;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--portal-line);
    color: var(--portal-muted);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
}
.collapse-control:hover {
    background: var(--portal-canvas);
    color: var(--portal-ink);
}
.portal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.portal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 76px;
    padding: 0 36px;
    border-bottom: 1px solid var(--portal-line);
    background: #fff;
}
.header-location {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    font-size: 13px;
}
.header-workspace {
    color: var(--portal-muted);
}
.breadcrumb-divider {
    color: #c6cdd7;
}
.header-location strong {
    font-weight: 600;
}
.portal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 340px);
    margin: 0 0 0 auto;
    height: 40px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8f9fc;
    padding-left: 12px;
    color: var(--portal-muted);
}
.portal-search input {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 12px;
    color: var(--portal-ink);
}
.portal-search:focus-within {
    outline: 2px solid var(--portal-brand);
    outline-offset: 2px;
}
.portal-search button {
    flex: 0 0 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--portal-muted);
    cursor: pointer;
    border-radius: 8px;
}
.portal-search button:hover {
    color: var(--portal-brand);
    background: var(--portal-brand-soft);
}
.account-menu {
    flex-shrink: 0;
    position: relative;
}
.account-menu summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-radius: 8px;
    padding: 2px 4px;
    list-style: none;
}
.account-menu summary::-webkit-details-marker {
    display: none;
}
.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: #e9eef7;
    color: #314769;
    border: 2px solid #fff;
    outline: 1px solid var(--portal-line);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
}
.user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.account-chevron {
    display: flex;
    transform: rotate(90deg);
    color: var(--portal-muted);
}
.account-chevron svg {
    width: 14px;
    height: 14px;
}
.account-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 240px;
    padding: 8px;
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 32px #17233b14;
}
.account-popover > span {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--portal-line);
    padding: 12px;
    overflow-wrap: anywhere;
}
.account-popover strong {
    display: block;
    color: var(--portal-ink);
    font-weight: 600;
}
.account-popover a, .account-popover button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--portal-ink);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.account-popover a:hover, .account-popover button:hover {
    background: var(--portal-canvas);
}
.portal-content {
    width: 100%;
    max-width: 1520px;
    margin: 0 auto;
    padding: 36px;
    flex: 1;
    overflow-wrap: anywhere;
}
.portal-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 36px;
    color: var(--portal-muted);
    border-top: 1px solid var(--portal-line);
    font-size: 11px;
}
.portal-footer span {
    overflow-wrap: anywhere;
}
.portal-footer a {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}
.portal-footer svg {
    width: 14px;
    height: 14px;
}
.skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 100;
    padding: 12px 18px;
    background: #fff;
    border: 2px solid var(--portal-brand);
    border-radius: 6px;
}
.skip-link:focus {
    top: 12px;
}
.icon-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    color: var(--portal-ink);
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    cursor: pointer;
}
.mobile-menu-trigger {
    display: none;
}
.mobile-menu {
    position: fixed;
    inset: 0 auto 0 0;
    margin: 0;
    max-height: 100dvh;
    height: 100dvh;
    width: min(320px, 90vw);
    max-width: 90vw;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--portal-line);
    background: #fff;
}
.mobile-menu::backdrop {
    background: #17233b66;
}
.mobile-menu-inner {
    min-height: 100%;
    position: relative;
}
.mobile-menu-close {
    position: absolute;
    top: 17px;
    right: 12px;
    z-index: 1;
    width: 32px;
    min-width: 32px;
    min-height: 44px;
    border: 0;
}
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #fff3d6;
    padding: 14px 20px;
    color: #664b0a;
}
#blazor-error-ui a {
    text-decoration: underline;
    margin-left: 8px;
}
@media (min-width: 821px) {
    .mobile-menu[open] {
        display: none;
    }
}
@media (max-width: 1180px) {
    .portal-header {
        padding: 0 24px;
        gap: 16px;
    }
    .portal-content {
        padding: 28px 24px;
    }
    .portal-footer {
        padding: 18px 24px;
    }
    .header-workspace, .breadcrumb-divider {
        display: none;
    }
}
@media (max-width: 820px) {
    .portal-search input {
        font-size: 16px;
    }
    .portal-sider {
        display: none;
    }
    .mobile-menu-trigger {
        display: inline-grid;
    }
    .portal-header {
        padding: 12px 20px;
        height: auto;
        min-height: 72px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .header-location {
        gap: 10px;
    }
    .portal-search {
        order: 3;
        width: 100%;
        height: 42px;
    }
    .account-menu {
        margin-left: auto;
    }
    .user-name {
        max-width: 100px;
    }
    .portal-content {
        padding: 24px 20px;
    }
    .portal-footer {
        padding: 18px 20px;
        flex-wrap: wrap;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }
}
.sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.brand-lockup {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 22px 24px 28px;
    color: var(--portal-ink);
    min-height: 100px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--portal-brand);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.brand-copy {
    min-width: 0;
}
.brand-copy strong {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    font-weight: 700;
}
.brand-copy > span {
    display: block;
    margin-top: 2px;
    color: var(--portal-muted);
    font-size: 9px;
    letter-spacing: 1.8px;
    font-weight: 600;
}
.portal-menu {
    padding: 0 14px;
}
.nav-section {
    display: block;
    padding: 4px 12px 12px;
    color: var(--portal-muted);
    font-size: 9px;
    letter-spacing: 1.2px;
    font-weight: 600;
}
.admin-section {
    margin-top: 28px;
}
.portal-menu .portal-menu-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    margin: 3px 0;
    min-height: 46px;
    border-radius: 7px;
    color: #55627a;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
.portal-menu .portal-menu-item svg {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
}
.portal-menu .portal-menu-item:hover {
    color: var(--portal-brand);
    background: #f7f9fc;
}
.portal-menu .portal-menu-item.active {
    color: var(--portal-brand);
    background: var(--portal-brand-soft);
    font-weight: 600;
}
.sidebar-help {
    display: flex;
    gap: 10px;
    margin: auto 22px 24px;
    padding-top: 44px;
    color: var(--portal-muted);
}
.help-icon {
    padding-top: 2px;
    color: #97a4b7;
}
.help-copy strong {
    color: var(--portal-ink);
    font-size: 11px;
    font-weight: 600;
}
.help-copy p {
    font-size: 10px;
    margin: 5px 0 10px;
}
.help-copy a {
    display: inline-block;
    color: var(--portal-brand);
    font-size: 10px;
    padding: 8px 0;
}
.nav-compact .brand-lockup {
    padding-left: 22px;
    padding-right: 22px;
}
.nav-compact .brand-copy, .nav-compact .nav-label, .nav-compact .nav-section, .nav-compact .sidebar-help {
    display: none;
}
.nav-compact .portal-menu {
    padding: 0 12px;
}
.nav-compact .portal-menu .portal-menu-item {
    justify-content: center;
    padding: 14px 0;
    margin-bottom: 6px;
}
/* AndroidSync static-SSR adaptation: native disclosure replaces the JS/modal drawer. */
.tenant-context {
    margin-left:auto;
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:0;
    font-size:12px;
    overflow-wrap:anywhere;
}
.tenant-context>span {
    color:var(--portal-muted);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:1px;
}
.mobile-navigation {
    display:none;
}
.mobile-navigation summary {
    display:flex;
    gap:8px;
    align-items:center;
    cursor:pointer;
    min-height:44px;
    font-size:12px;
}
.mobile-navigation nav {
    position:absolute;
    left:12px;
    right:12px;
    top:64px;
    z-index:20;
    padding:12px;
    background:white;
    border:1px solid var(--portal-line);
    border-radius:8px;
    box-shadow:0 12px 30px #17233b14;
}
:focus-visible {
    outline:3px solid var(--portal-brand);
    outline-offset:3px;
}
.portal-footer {
    font-size:11px;
}
.portal-menu-item {
    display:flex;
    align-items:center;
    gap:12px;
}
@media(max-width:850px) {
    .portal-sider {
        display:none;
    }
    .mobile-navigation {
        display:block;
    }
    .portal-header {
        height:auto;
        min-height:72px;
        flex-wrap:wrap;
        gap:12px;
        padding:12px 18px;
    }
    .header-location {
        order:3;
        width:100%;
        font-size:12px;
    }
    .portal-content {
        padding:24px 18px;
    }
    .portal-footer {
        padding:18px;
        flex-wrap:wrap;
    }
    .account-menu .user-name {
        max-width:90px;
    }
    .tenant-context {
        max-width:150px;
    }
    .mobile-navigation nav .portal-menu-item {
        min-height:44px;
        padding:12px;
    }
    .mobile-navigation nav .active {
        background:var(--portal-brand-soft);
        color:var(--portal-brand);
    }
}
