﻿body #org-chart * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    position: relative;
}

#org-chart {
    margin: 0 auto;
    padding: 10px;
    color: #fff;
    text-align: center; 
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

    #org-chart ul.tree {
        list-style: none;
        margin: 0;
        padding: 0;
        text-align: center;
        display: table;
    }

        #org-chart ul.tree:before {
            outline: solid 1px #666;
            content: "";
            height: 30px;
            left: 50%;
            position: absolute;
            top: -30px;
        }

        #org-chart ul.tree:first-child:before {
            outline: none;
        }

        #org-chart ul.tree li {
            display: table-cell;
            padding: 40px 26px;
            padding-bottom: 0;
            vertical-align: top;
            width:150px
        }

            #org-chart ul.tree li:first-child:before {
                left: 50%;
            }

            #org-chart ul.tree li:last-child:before {
                right: 50%;
            }

            #org-chart ul.tree li:before {
                outline: solid 1px #666;
                content: "";
                left: 0;
                right: 0;
                top: 0;
                position: absolute;
            }

            #org-chart ul.tree li .box {
                border-radius: 0.2em;
                display: inline-block;
                margin: 0 0.2em 30px;
                padding: 15px;
                min-width: 150px;
            }

                #org-chart ul.tree li .box:before {
                    outline: solid 1px #666;
                    content: "";
                    height: 40px;
                    left: 50%;
                    top: -40px;
                    position: absolute;
                }

                #org-chart ul.tree li .box span {
                    font-size: 15px;
                    display: block;
                    margin: 2px 0;
                    line-height: 18px;
                }

    #org-chart > ul.tree > li:first-child::before {
        outline: none;
    }

    #org-chart > ul.tree > li > .box:first-child::before {
        outline: none;
    }

    /*Custom level 1*/
    #org-chart ul.tree.level-1 li .box {
        background-color: #BA0C37;
        width: 150px;
        height: 52px;
    }
    /*Custom level 2*/
    #org-chart ul.tree.level-2 li .box {
        background-color: #BA0C37;
        width: 200px;
        height: 52px;
        display: inline-flex;
        align-items: center;
        vertical-align: middle;
        justify-content: center;
    }

    #org-chart ul.tree.level-2 > li .box {
        margin: 0 0.5em 30px;
    }
    /*Custom level 3*/
    #org-chart ul.tree.level-3 li .box {
        background-color: #2FB7E4;
        width: 200px;
        height: 52px;
    }

    #org-chart ul.tree.level-3 li > .box:after {
        outline: solid 1px #666;
        content: "";
        position: absolute;
        top: 50%;
        left: -1px;
        transform: translate(-100%, -50%);
        width: 30px;
    }

    #org-chart ul.tree.level-3 > li.no-child .box::after {
        outline: none;
    }
    /*Custom level 4*/
    #org-chart ul.tree.level-4 li .box {
        background-color: transparent;
        border: 1px solid #BA0C37;
        color: #BA0C37;
        height: 74px;
        display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
        display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
        display: -ms-flexbox; /* TWEENER - IE 10 */
        display: -webkit-flex; /* NEW - Chrome */
        display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
        align-items: center;
        vertical-align: c;
        justify-content: center;
    }

    #org-chart ul.level-4::before {
        height: calc(100% - 10px);
        left: -25px;
        top: -57px;
    }

    #org-chart ul.level-4 > li::before {
        outline: none;
    }

    #org-chart ul.level-4 li {
        display: table-row;
    }

    #org-chart ul.tree.level-4 li > .box:before {
        outline: none;
    }

