/* ACL - Hide ACCESS_DENIED elements */
.menu a[href="ACCESS_DENIED"].item,
form[action="ACCESS_DENIED"],
a[href="ACCESS_DENIED"].button,
a[data-url="ACCESS_DENIED"].button {
    display: none !important;
}

a[href="ACCESS_DENIED"] {
    pointer-events: none !important;
    color: #0d0d0d !important;
}

/* ACL Permissions Tree */
.acl-tree ul {
    list-style: none;
    padding-left: 2rem;
    padding-top: 0.45rem;
    margin: 0;
}

.acl-tree > ul {
    padding-left: 0;
}

.acl-tree-node {
    padding: 2px 0;
}

.acl-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    user-select: none;
    color: #666;
    font-size: 0.75rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.acl-tree-toggle::before {
    content: '\25B6'; /* right arrow */
    display: inline-block;
    transition: transform 0.25s ease-in-out;
}

.acl-tree-open > .acl-tree-toggle::before {
    transform: rotate(90deg);
}

.acl-tree-node > ul {
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 0.3s ease-in-out, opacity 0.25s ease-in-out;
    opacity: 1;
}

.acl-tree-closed > ul {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease-in-out, opacity 0.2s ease-in-out;
}

.acl-tree-leaf > .acl-tree-toggle {
    visibility: hidden;
    width: 0;
}

/* Folder / file icons */
.acl-tree-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    vertical-align: middle;
}

.acl-tree-label::before {
    content: '';
    flex-shrink: 0;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.acl-tree-node:not(.acl-tree-leaf) > .acl-tree-label::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4a017'%3E%3Cpath d='M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

.acl-tree-node.acl-tree-open:not(.acl-tree-leaf) > .acl-tree-label::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4a017'%3E%3Cpath d='M20 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5l2 2h9a2 2 0 0 1 2 2v1H11l-2 5h11.28a2 2 0 0 0 1.94-1.51L24 8H4v9l2-6h16l-2.6 7.78A2 2 0 0 1 17.5 20H4a2 2 0 0 1-2-2'/%3E%3C/svg%3E");
}

.acl-tree-leaf > .acl-tree-label::before {
    display: none;
}

.acl-tree-leaf {
    padding-left: 3rem;
}

.acl-tree-label:hover > span {
    text-decoration: underline;
}

.acl-tree-cb {
    flex-shrink: 0;
    margin: 0 !important;
}

/* Root node container should not be height-constrained */
.acl-tree > ul > .acl-tree-node > ul {
    max-height: none;
    overflow: visible;
}

/* Category separators */
.acl-tree-node[data-slug] {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e5e5;
}

.acl-tree-node[data-slug]:last-child {
    border-bottom: none;
}
