#Organograma {
  color: white;
  margin-left: auto;
  margin-right: auto;
  padding: 1em;
  width: 100%;
}
#Organograma *,
#Organograma *:before,
#Organograma *:after {
    margin: 0;
}
ol.organograma h3,
ol.organograma h4 {
  color: white;
  margin: 0;
}
ol.organograma,
ol.organograma ol,
ol.organograma li,
ol.organograma li > div {
  position: relative;
}
ol.organograma,
ol.organograma ol {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
ol.organograma {
  text-align: left;
}
ol.organograma ol {
  padding-top: 1em;
}
/* linhas de ligação */
ol.organograma ol:before,
ol.organograma ol:after,
ol.organograma li:before,
ol.organograma li:after,
ol.organograma > li > div:before,
ol.organograma > li > div:after {
  background-color: rgba(6,134,229,.25);
  content: '';
  position: absolute;
}

ol.organograma ol > li {
  padding: 1em 0 0 1em;
}
/* vertical de saída nível 2 */
ol.organograma > li ol:before {
  height: 1em;
  left: 50%;
  top: 0;
  width: 1px;
}
/* horizontal entre nível 2 e 3 */
ol.organograma > li ol:after {
  height: 1px;
  left: 1px;
  top: 1em;
  width: 50%;
}
/* horizontal de entrada nível 3 */
ol.organograma > li ol > li:not(:last-of-type):before {
  height: 1px;
  left: 0;
  top: 2em;
  width: 1em;
}
/* vertical de ligação nível 3 */
ol.organograma > li ol > li:not(:last-of-type):after {
  height: 100%;
  left: 0;
  top: 0;
  width: 1px;
}
/* horizontal de entrada último item nível 3 */
ol.organograma > li ol > li:last-of-type:before {
  height: 1px;
  left: 0;
  top: 2em;
  width: 1em;
}
/* vertical de ligação último item nível 3 */
ol.organograma > li ol > li:last-of-type:after {
  height: 2em;
  left: 0;
  top: 0;
  width: 1px;
}
ol.organograma li > div {
  background-color: #fff;
  border-radius: 3px;
  min-height: 2em;
  padding: 0.5em;
}
/*** 1º nível ***/
ol.organograma > li > div {
  background-color: rgba(20,43,88,1);
  margin-left: 1em;
  margin-right: 1em !important;
}
ol.organograma > li > div:before {
  bottom: 2em;
  height: 3px;
  right: -1em;
  width: 1em;
}
ol.organograma > li > div:first-of-type:after {
  bottom: 0;
  height: 2em;
  right: -1em;
  width: 3px;
}
ol.organograma > li > div + div {
  margin-top: 1em;
}
ol.organograma > li > div + div:after {
  height: calc(100% + 1em);
  right: -1em;
  top: -1em;
  width: 3px;
}
/*** 2º nível ***/
ol.organograma > li > ol:before {
  left: inherit;
  right: 0;
}
ol.organograma > li > ol:after {
  left: 0;
  width: 100%;
}
ol.organograma > li > ol > li > div {
  background-color: rgba(20,43,88,1);
}
/*** 3º nível ***/
ol.organograma > li > ol > li > ol > li > div {
  background-color: rgba(6,134,229,1);
}
/*** 4º nível ***/
ol.organograma > li > ol > li > ol > li > ol > li > div {
  background-color: rgba(6,134,229,1);
}
/*** 5º nível ***/
ol.organograma > li > ol > li > ol > li > ol > li > ol > li > div {
  background-color: rgba(6,134,229,1);
}

/*** MEDIA QUERIES ***/
@media only screen and ( min-width: 64em ) {
  ol.organograma {
    margin-left: -1em;
    margin-right: -1em;
  }
  /* 1º nível */
  ol.organograma > li > div {
    display: inline-block;
    float: none;
    margin: 0 1em 1em 1em;
    vertical-align: bottom;
  }
  ol.organograma > li > div:only-of-type {
    margin-bottom: 0;
    width: calc((100% / 1) - 2em - 4px);
  }
  ol.organograma > li > div:first-of-type:nth-last-of-type(2),
  ol.organograma > li > div:first-of-type:nth-last-of-type(2) ~ div {
    width: calc((100% / 2) - 2em - 4px);
  }
  ol.organograma > li > div:first-of-type:nth-last-of-type(3),
  ol.organograma > li > div:first-of-type:nth-last-of-type(3) ~ div {
    width: calc((100% / 3) - 2em - 4px);
  }
  ol.organograma > li > div:first-of-type:nth-last-of-type(4),
  ol.organograma > li > div:first-of-type:nth-last-of-type(4) ~ div {
    width: calc((100% / 4) - 2em - 4px);
  }
  ol.organograma > li > div:first-of-type:nth-last-of-type(5),
  ol.organograma > li > div:first-of-type:nth-last-of-type(5) ~ div {
    width: calc((100% / 5) - 2em - 4px);
  }
  ol.organograma > li > div:before,
  ol.organograma > li > div:after {
    bottom: -1em!important;
    top: inherit!important;
  }
  ol.organograma > li > div:before {
    height: 1em!important;
    left: 50%!important;
    width: 0px!important;
  }
  ol.organograma > li > div:only-of-type:after {
    display: none;
  }
  ol.organograma > li > div:first-of-type:not(:only-of-type):after,
  ol.organograma > li > div:last-of-type:not(:only-of-type):after {
    bottom: -1em;
    height: 3px;
    width: calc(50% + 1em + 3px);
  }
  ol.organograma > li > div:first-of-type:not(:only-of-type):after {
    left: calc(50% + 3px);
  }
  ol.organograma > li > div:last-of-type:not(:only-of-type):after {
    left: calc(-1em - 3px);
  }
  ol.organograma > li > div + div:not(:last-of-type):after {
    height: 3px;
    left: -2em;
    width: calc(100% + 4em);
  }
  /* 2º nível */
  ol.organograma > li > ol {
    display: flex;
    flex-wrap: nowrap;
  }
  /* verticais entre os níveis 1 e 2 */
  ol.organograma > li > ol:before,
  ol.organograma > li > ol > li:before {
    height: 1em!important;
    left: 50%!important;
    top: 0!important;
    width: 1px!important;
  }
  ol.organograma > li > ol:after {
    display: none;
  }
  ol.organograma > li > ol > li {
    flex-grow: 1;
    padding-left: 1em;
    padding-right: 1em;
    padding-top: 1em;
  }
  ol.organograma > li > ol > li:only-of-type {
    padding-top: 0;
  }
  ol.organograma > li > ol > li:only-of-type:before,
  ol.organograma > li > ol > li:only-of-type:after {
    display: none;
  }
  /* horizontais de ligação primeiro e último item entre os níveis 1 e 2 */
  ol.organograma > li > ol > li:first-of-type:not(:only-of-type):after,
  ol.organograma > li > ol > li:last-of-type:not(:only-of-type):after {
    height: 1px;
    top: 0;
    width: 50%;
  }
  ol.organograma > li > ol > li:first-of-type:not(:only-of-type):after {
    left: 50%;
  }
  ol.organograma > li > ol > li:last-of-type:not(:only-of-type):after {
    left: 0;
  }
  /* horizontal de ligação entre os níveis 1 e 2 */
  ol.organograma > li > ol > li + li:not(:last-of-type):after {
    height: 1px;
    left: 0;
    top: 0;
    width: 100%;
  }
}


.diagrama,
.organograma {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 300 !important;
}
.diagrama h3,
.organograma h3 {
  font-size: 2.5vh !important;
  font-weight: 700 !important;
  margin-top: 3vh;
}
.diagrama h4,
.organograma h4 {
  font-size: 2vh !important;
  font-weight: 700 !important;
  margin-top: 3vh;
}
div.grafico {
  background-color: #dddddd;
  height: 4px;
  margin-bottom: 2vh;
  width: 100%;
}
span.positivo {
  background-color: #0686e5;
  float: left;
  height: 100%;
}
span.parcial {
  background-color: #7cbff2;
  float: left;
  height: 100%;
}
span.negativo {
  background-color: #c30d02;
  float: left;
  height: 100%;
}
span.neutro {
  background-color: #cccccc;
  float: left;
  height: 100%;
}
