.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: color-mix(in srgb, var(--zn-bg-sidebar-alpha) 88%, var(--zn-bg-panel));
    border-right: 1px solid var(--zn-border);
    backdrop-filter: blur(14px);
    box-shadow: none;
    transition: width 0.14s ease;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 14px 12px;
    gap: 10px;
}

.sidebar-scroll-region {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sidebar-header-collapsible .brand-block {
    flex: 1 1 auto;
    min-width: 0;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: var(--zn-accent-text);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow: hidden;
}

.brand-mark-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    transform: none;
    transform-origin: center;
}

.dashboard-profile-trigger {
    text-decoration: none;
    cursor: pointer;
}

.dashboard-profile-image {
    transform: scale(1.08);
}

.dashboard-profile-company-logo {
    object-fit: cover;
    padding: 0;
    background: var(--zn-bg-surface-muted);
}

.brand-mark-company .brand-profile-fallback {
    display: none;
}

.brand-profile-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: var(--zn-accent-soft);
    color: var(--zn-accent-text);
    font-size: 0.86rem;
    font-weight: 800;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.brand-copy strong {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy span {
    color: var(--zn-text-muted);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-group-title,
.page-eyebrow,
.panel-eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.66rem;
    color: var(--zn-text-muted);
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 32px;
    padding: 7px 10px 7px 12px;
    border: 0;
    border-radius: 6px;
    text-decoration: none;
    color: var(--zn-text-secondary);
    font-size: 0.82rem;
    font-weight: 560;
    line-height: 1.2;
    transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-link:hover {
    color: var(--zn-text-primary);
    background: var(--zn-bg-surface-hover);
}

.sidebar-link.is-active {
    color: var(--zn-text-primary);
    background: color-mix(in srgb, var(--zn-accent-surface-muted) 44%, transparent);
    box-shadow: inset 2px 0 0 var(--zn-accent);
}

.sidebar-link-dot {
    display: none;
}

.sidebar-link-rail-label {
    display: none;
}

.sidebar-link-rail-icon {
    display: none;
}

.sidebar-link-icon-svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sidebar-footer-column {
    flex-direction: column;
    align-items: flex-start;
}

.brand-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0.86;
}

.brand-meta-stack strong {
    font-size: 0.74rem;
    font-weight: 600;
}

.brand-meta-stack span {
    color: var(--zn-text-muted);
    font-size: 0.65rem;
}

.brand-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer .status-pill {
    min-height: 20px;
    padding: 2px 7px;
    border-color: var(--zn-border-soft);
    background: transparent;
    color: var(--zn-text-muted);
    font-size: 0.62rem;
    box-shadow: none;
}

.dashboard-version-inline {
    color: var(--zn-text-muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.entity-identity {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.table-avatar-indicator {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--zn-accent-shadow);
    border: 1px solid var(--zn-accent-border-soft);
    color: var(--zn-accent-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.table-avatar-indicator-empty {
    background: var(--zn-bg-surface-hover);
    border-color: var(--zn-border);
    color: var(--zn-text-muted);
}

.workspace {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 18px 20px 14px;
    transition: margin-left 0.14s ease;
}

.workspace-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@media (min-width: 1181px) {
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar,
    body.dashboard-sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-inner,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-inner,
    body.dashboard-sidebar-collapsed .sidebar-inner {
        align-items: center;
        padding-right: 8px;
        padding-left: 8px;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .workspace,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .workspace,
    body.dashboard-sidebar-collapsed .workspace {
        margin-left: var(--sidebar-collapsed-width);
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-header-collapsible,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-header-collapsible,
    body.dashboard-sidebar-collapsed .sidebar-header-collapsible {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-header-collapsible .brand-block,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-header-collapsible .brand-block,
    body.dashboard-sidebar-collapsed .sidebar-header-collapsible .brand-block {
        justify-content: center;
        width: 100%;
        flex: 0 0 auto;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .brand-copy,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-group-title,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-footer-column > .sidebar-footer,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .brand-meta-stack,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .brand-copy,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-group-title,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-footer-column > .sidebar-footer,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .brand-meta-stack,
    body.dashboard-sidebar-collapsed .brand-copy,
    body.dashboard-sidebar-collapsed .sidebar-group-title,
    body.dashboard-sidebar-collapsed .sidebar-link-label,
    body.dashboard-sidebar-collapsed .sidebar-footer-column > .sidebar-footer,
    body.dashboard-sidebar-collapsed .brand-meta-stack {
        display: none;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-group,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-nav,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-group,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-nav,
    body.dashboard-sidebar-collapsed .sidebar-group,
    body.dashboard-sidebar-collapsed .sidebar-nav {
        align-items: center;
        width: 100%;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-nav,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-nav,
    body.dashboard-sidebar-collapsed .sidebar-nav {
        gap: 4px;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link,
    body.dashboard-sidebar-collapsed .sidebar-link {
        justify-content: center;
        width: 38px;
        min-height: 34px;
        padding: 0;
        border-radius: 8px;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link.is-active,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link.is-active,
    body.dashboard-sidebar-collapsed .sidebar-link.is-active {
        box-shadow: inset 2px 0 0 var(--zn-accent);
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link-rail-icon,
    body.dashboard-sidebar-collapsed .sidebar-link-rail-label,
    body.dashboard-sidebar-collapsed .sidebar-link-rail-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--zn-text-muted);
        font-size: 0.66rem;
        font-weight: 720;
        line-height: 1;
        letter-spacing: 0;
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link:hover .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link:hover .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link:focus-visible .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link:focus-visible .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link.is-active .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-link.is-active .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link:hover .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link:hover .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link:focus-visible .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link:focus-visible .sidebar-link-rail-icon,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link.is-active .sidebar-link-rail-label,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-link.is-active .sidebar-link-rail-icon,
    body.dashboard-sidebar-collapsed .sidebar-link:hover .sidebar-link-rail-label,
    body.dashboard-sidebar-collapsed .sidebar-link:hover .sidebar-link-rail-icon,
    body.dashboard-sidebar-collapsed .sidebar-link:focus-visible .sidebar-link-rail-label,
    body.dashboard-sidebar-collapsed .sidebar-link:focus-visible .sidebar-link-rail-icon,
    body.dashboard-sidebar-collapsed .sidebar-link.is-active .sidebar-link-rail-label,
    body.dashboard-sidebar-collapsed .sidebar-link.is-active .sidebar-link-rail-icon {
        color: var(--zn-text-primary);
    }

    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-admin .sidebar-collapse-chevron,
    html[data-dashboard-sidebar-state="collapsed"] body.dashboard-body-operator .sidebar-collapse-chevron,
    body.dashboard-sidebar-collapsed .sidebar-collapse-chevron {
        transform: rotate(-45deg);
    }
}
