#categoriiAdmin {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    width: 100%;
}

.categoriiTreePanel,
.categoriiEditPanel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-width: 0;
}

.categoriiHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.categoriiHeader h3 {
    margin: 0;
}

#newCategorie {
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    background: #23844b;
    color: #fff;
    cursor: pointer;
}

#categoriiTree {
    max-height: 70vh;
    overflow: auto;
}

.categoryList {
    margin: 0;
    padding: 0;
    list-style: none;
}

.categoryItem {
    list-style: none;
}

.categoryRow {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 35px;
    border-radius: 5px;
}

.categoryRow:hover {
    background: #f3f5f7;
}

.categoryToggle,
.categoryTogglePlaceholder {
    width: 24px;
    min-width: 24px;
    text-align: center;
}

.categoryToggle {
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform .15s;
}

.categoryItem.expanded>.categoryRow .categoryToggle {
    transform: rotate(90deg);
}

.categoryChildren {
    display: none;
    padding-left: 20px;
}

.categoryName {
    flex: 1;
    min-width: 0;
    padding: 7px 5px;
    border-radius: 4px;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.categoryName:hover {
    color: #1677cc;
}

.categoryName.selected {
    background: #e5f1ff;
    color: #005bb5;
    font-weight: 600;
}

.categoryFolder {
    font-size: 14px;
}

.categoryAdd {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #16803c;
    font-size: 20px;
    padding: 0 8px;
    opacity: 0;
}

.categoryRow:hover .categoryAdd,
.categoryAdd:focus-visible {
    opacity: 1;
}

.categoriiEditPanel .formGroup {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.categoriiEditPanel input,
.categoriiEditPanel select {
    box-sizing: border-box;
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.categorieFormButtons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.categorieFormButtons button {
    padding: 9px 16px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
}

.categorieFormButtons button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#saveCategorie {
    background: #23844b;
    color: white;
}

#deleteCategorie {
    background: #c0392b;
    color: white;
}

#cancelCategorie {
    background: #ddd;
    color: #333;
}

#categorieMessage:not(:empty) {
    margin: 10px 0;
}

@media (max-width: 750px) {
    #categoriiAdmin {
        grid-template-columns: 1fr;
    }
}